DBINFO/serial column
Posted in 1999
Topics: Stored Procedures & SPL
Hi,
Is there anyway I can return the last inserted serial id from
a table at the time a row is inserted without benefit of
stored procedures?
table: testtable
Column name Type Nulls
a serial no
b integer yes
c integer yes
INSERT INTO testtable (b,c) values(1,1);
SELECT DBINFO('sqlca.sqlerrd1') FROM testtable;
that is, I would like to combine the above two statements into one.
I'm on Dynamic Server 9.13/Solaris
Thank you
Philip
yukonc@teleport.com
No. If you are using 4GL or ESQL/C you can also get the serial number
from the sqlca structure immediately after the INSERT completes. To do
this in pure SQL will require two statements or a stored procedure that
encapsulates the two statements.
Art S. Kagel
mission critical wrote:
>
> Hi,
> Is there anyway I can return the last inserted serial id from
> a table at the time a row is inserted without benefit of
> stored procedures?
>
> table: testtable
> Column name Type Nulls
> a serial no
> b integer yes
> c integer yes
>
> INSERT INTO testtable (b,c) values(1,1);>
> SELECT DBINFO('sqlca.sqlerrd1') FROM testtable;
>
> that is, I would like to combine the above two statements into one.
>
> I'm on Dynamic Server 9.13/Solaris
>
> Thank you
> Philip
>
> yukonc@teleport.com