Re: Affecter résultat d'une fonction à - Mailing list pgsql-novice

From Stijn Vanroye
Subject Re: Affecter résultat d'une fonction à
Date
Msg-id edp46j$vd7$1@news.hub.org
Whole thread Raw
List 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.

pgsql-novice by date:

Previous
From: Ray Stell
Date:
Subject: Re: archives is not working was (Re: Removing duplicate keys)
Next
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: phppgadmin not working under v. 8.1