On Wed, 13 Mar 2002, Marcelo Pereira wrote:
> Hello All,
>
> I have two tables, the first is parental and the second is a child of the
> first.
>
> Ex.:
>
> create table first (id SERIAL, descrip CHAR(20));
> create table second (id INTEGER references first(id), state CHAR(2));
>
> I have `all' the values to make the inserts in the two tables (ie, descrip
> and state), so I `would' use:
>
> INSERT into first (descrip) values ($descr);
> INSERT into second (id,state) values (?????????,$state);
currval('first_id_seq') should get you the last sequence value given to
your session.