sintax??? - Mailing list pgsql-general

From Alfonso Peniche
Subject sintax???
Date
Msg-id 3A79FD95.E637213F@iteso.mx
Whole thread Raw
Responses Re: sintax???
List pgsql-general
I have the following:

CREATE FUNCTION RegistrarConexion(char(8),char(16),char(20))
RETURNS integer
AS '
        DECLARE ret integer;

        BEGIN
                INSERT INTO BitacoraConexion(username, IPmaquina,
nombremaquina, conexion)
                VALUES ($1, $2, $3, CURRENT_TIMESTAMP);

                SELECT INTO ret
currval('bitacoraconex_idbitacoracon_seq');

                RETURN ret;
        END;'
LANGUAGE 'plpgsql';

and if I execute this file I get the following error:

psql:SPRegConex.sql:20: ERROR:  parser: parse error at or near
"bitacoraconex_idbitacoracon_seq"

I asume it's due to a sintax error having to do with "currval", but I
can't find what the proper sintax would be for 'plpgsql' for getting the
last sequence value assigned (I even tried

select currval('bitacoraconex_idbitacoracon_seq') as ret

with equal result).

Can someone help me out here??????

Thanx

P.S. Is there a manual for plpgsql sintax, instructions, functions....
somewhere?


pgsql-general by date:

Previous
From: Alvar Freude
Date:
Subject: Re: Is Oracle really so much faster
Next
From: Stephan Szabo
Date:
Subject: Re: sintax???