oblem) if I try:
SQL ="INSERT INTO koe (name) values ('uusi');
SELECT currval('koe_pkey_id') as val;"
It causes no error, but I cannot retrieve the value because the
queries seem not return any recordsets (nothig can be fetched).
Any hints are valuable!
Thanks
Esa Pikkarainen
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,
AAAHHH, I DID IT
That:
SQL="SELECT nextval('koe_pkey_id');
INSERT INTO koe (id, name) VALUES
(SELECT currval('koe_pkey_id'), 'uusi');"
Now it returns the correct Serial value of the record it inserts.
Yee, I'm glad now
:-