Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Thomas J. Girsch — — source: Informix-list mailing list archive (1991-1998)
Within SPL you can just do:
LET nrow = DBINFO("sqlca.sqlerrd2");
or
LET lastser = DBINFO("sqlca.sqlerrd1");
There's no need to do that SELECT.
Katrin Goericke wrote in message <36544CDE.2172@taz.de>...
>> I especially need to know last serial id of an inserted row (any faq?)
>> Until now I'm using max() but it could cause concurrency troubles.
>
>The estimated count of rows you get in this way:
>
>create procedure getnumrow()
> returning int;>
> define nrow int;
> select unique dbinfo("sqlca.sqlerrd2") into nrow
> from "informix".systables;> return nrow;
>end procedure;
>
>... the next serial
>
>CREATE PROCEDURE getnextid()
>returning int;>
> define mid int;
> select unique dbinfo("sqlca.sqlerrd1") into mid
> from "informix".systables;> return mid;
>
>END PROCEDURE;
>
>--
>Gru' Katrin
>__________
>
> _/_/_/_/_/ _/_/_/_/ _/_/_/_/ Katrin Goericke katrin@taz.de
> _/ _/ _/ _/ die tageszeitung
> _/ _/_/_/_/ _/ Germany
> _/ _/ _/ _/ D-10969 Berlin Phone:
>+49-30-2516092
> _/ _/ _/ _/_/_/_/ Kochstr. 18 FAX :
>+49-30-2510694
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.