Re: Getting the last serial field inserted per session
Posted in 2005
If it works in isql it should work on .net, I suppose...
I can't offer an answer here but as you are using (ado).net why don't
you use the Informix Ole db provider whith the newer CDSK 2.9, maybe
this will help.
J.
Dave Thacker wrote:
> Toolset:
> -IDS 9.4FC6, ODBC 2.81, MS .Net, ADO.Net
>
> One of our developers is trying to find a way to get the last serial value
> inserted into a table for a particular session. He's trying to use this
> query, which works in ISQL, but does not work from the .NET app.
>
> insert into kenn_test(testtext) values('7');> select dbinfo('sqlca.sqlerrd1') from systables where tabid=1
>
> Schema for the table is
> { TABLE "kenn".kenn_test row size = 25 number of columns = 2 index size = 0 }
> create table "kenn".kenn_test
> (
> uid serial not null ,
> testtext varchar(20)
> ) in invty2 extent size 16 next size 16 lock mode row;
> revoke all on "kenn".kenn_test from "public";>
> When he runs the query from isql, he gets the last serial value. When he runs
> it from .Net, it always returns 0. Any ideas to give him?
>
> DT
sending to informix-list