Re: Affecter résultat d'une fonction à

From: Stijn Vanroye <s(dot)vanroye(at)easytowork(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Affecter résultat d'une fonction à
Date: 2006-09-07 12:39:45
Message-ID: edp46j$vd7$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

ctobini schreef:
> Bonjour,
>
> Débutant avec le SQL, je galère un peu pour insérer dans une
> variable le résultat d'une requête ou d'une fonction;
>
> J'ai une fonction get_last_gids() renvoyant le dernier enregistrement
> d'une table :
>
> CREATE FUNCTION get_last_gids() RETURNS INTEGER AS '
> SELECT gid_id from gids ORDER BY compt DESC LIMIT 1;'
> LANGUAGE 'SQL';
>
> Je voudrais dans une fonction PL/PGSQL affecter à une variable le
> résultat de cette fonction :
>
> CREATE FUNCTION update_gids_links() RETURNS TEXT AS '
> DECLARE
> last_gids INTEGER;
> BEGIN
> SELECT INTO last_gids FROM (SELECT gid_id from gids ORDER BY compt)
> ou SELECT INTO last_gids EXECUTE get_last_gids();
> DESC LIMIT 1);
> RETURN last_gid;
> END;
> ' LANGUAGE 'PLPGSQL';
>
> Mais dans les 2 cas, j'ai une erreur.
>
> Sauriez-vous comment remédier à cela ?
>
> En vous remerciant,
>
> C. Tobini
>
Mes excuses pour le mauvais Francais ;)

Mais ce liste ici est en Englais. Je pense que pas beaucoup de gents ici
parle Francais. Si tu pose votre question en Englais il y a plus de
chance pour obtenir une repondre. Moi, je ne parle pas Francais si bien
pour donner une repondre a votre question ;)

Je ne sais pas si une liste existe seullement en Francais, mais tu peu
rechercher ca aux website de postgresql.

My apologies for the bad French ;)

But this list is in English. I don't think there are a lot of people
here that speak French. If you ask your question in English there's a
better change it will get an answer. I don't speak enough French myself
to give an answer to your question ;)

I don't know if there is a list in French, but you can look that up on
the postgresql website.

Kind regards,

Stijn.

Browse pgsql-novice by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2006-09-07 21:11:38 Re: phppgadmin not working under v. 8.1
Previous Message Ray Stell 2006-09-07 12:32:46 Re: archives is not working was (Re: [NOVICE] Removing duplicate keys)