OK, good to know the official documentation's fairly vague description is wrong.
Performance is still not acceptable though. It doubles the round-trips to the database. I'm wondering if it automatically updates the data structure that
Original Message:
Sent: Wed January 17, 2024 05:15 PM
From: Art Kagel
Subject: getting serial key inserted from .Net Core Informix Provider
Jared:
This post didn't come through to my email, just seeing it now. So, No, DBINFO( 'sqlca.sqerrd1' ) always returns the last serial value inserted in the current session. If the documentation actually says otherwise, it is incorrect!
Here are two sessions that I ran do demonstrate. I executed the two inserts then the two dbinfo() calls in separate sessions:
art@Elezar-II:~/GoogleDrive/iiug/utils2_ak$ dbaccess testdb -
Database selected.
> insert into art_is_sane( one ) values ( 0 );
1 row(s) inserted.
> select dbinfo( 'sqlca.sqlerrd1');
(expression)
259
1 row(s) retrieved.
art@Elezar-II:~/GoogleDrive/Latest Art's Stuff$ dbaccess testdb -
Database selected.
> insert into art_is_sane( one ) values ( 0 );
1 row(s) inserted.
> select dbinfo( 'sqlca.sqlerrd1');
(expression)
260
1 row(s) retrieved.
>
Notice two different values returned. As far as performance, you are probably correct. However, in my testing the call to DBINFO() returned in 66/100,000 of a second which is pretty fast. Less than 7 seconds for 10,000 calls. Agreed, however that it is slower than just reading the sqlca structure.
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
Original Message:
Sent: Wed January 17, 2024 04:06 PM
From: Jared Heath
Subject: getting serial key inserted from .Net Core Informix Provider
DBINFO is a race condition....its retrieving the most recent serial inserted to the table by anyone according to the documentaiton and developer feedback here.
Its also VERY VERY SLOW. As in 25% performance hit vs equivalent 4gl code.
I should have said we already have excluded DBINFO as a viable solution in my original post sorry. Querying the database millions of times vs just reading the SQL communication area that the database already provides is not acceptable.
------------------------------
Jared Heath
Original Message:
Sent: Wed January 17, 2024 03:45 PM
From: Paul Watson
Subject: getting serial key inserted from .Net Core Informix Provider
Not in DBINFO ?On 1/17/2024 2:43 PM, Jared Heath via IBM TechXchange Community wrote:
0100018d1929e97d-8ea330f8-ef2f-4bf6-818d-21c177537c8c-000000@email.amazonses.com">I've spend a couple days searching the documentation and I can't find how to get the equivalent of sqlca.sqlerrd[2] out of .NET Core Informix...
Original Message:
Sent: 1/17/2024 3:43:00 PM
From: Jared Heath
Subject: getting serial key inserted from .Net Core Informix Provider
I've spend a couple days searching the documentation and I can't find how to get the equivalent of sqlca.sqlerrd[2] out of .NET Core Informix connector. I can find sqlcode, I can get number of rows inserted/updated/deleted but I don't see anywhere that this critical information is provided back to .NET
None of our developers can figure it out either.
Anybody know what we are missing?
------------------------------
Jared Heath
------------------------------