Thank you,
Yet another way to do it ;-)
but unfortunately it did not solve my problem. Now I have no access 
to the value of nextval('koe_pkey_id'). This query does not return 
any recordset.
Is it possible to embed Insert query as a subquery into a Select 
query? I have not managed to dot it. I mean something like:

SELECT nextval('koe_pkey_id') as val, (INSERT INTO koe (id, name) 
values (val, 'uusi')) as dummy FROM koe;"

That would both insert new record and return serial value - if it 
just worked...

Thanks 
Esa

Alessio Bragadini wrote (15 Dec 00,):
> Esa Pikkarainen wrote:
> > SQL ="SELECT nextval('koe_pkey_id') as val;
> >       INSERT INTO koe (id, name) values (val, 'uusi');"

> INSERT INTO koe (id, name) (SELECT nextval('koe_pkey_id'), 'uusi');

Reply via email to