Anyone know of a way to get the ID or Primary Key of a row that
was just inserted via SQLPrepare and then SQLExecute? In
Informix ESQL/C you could access the sqlca.sqlerrd[1] field to
get the long primary key value of the inserted row (if applicable).
Is there a way to do this in ODBC 3.0?
Thanks,
Curtiss.
*************************************************************************
So powerful is the light of unity that it can illuminate the whole earth.
Curtiss Murphy -- Senior Software Engineer -- Appropriate Technologies
cmu...@NOSPAMapp-tech.com -- www.app-tech.com/staff/cmurphy
*************************************************************************
Dietrich Neuman
Curtiss Murphy <cmu...@NOSPAMapp-tech.com> wrote in article
<01bd5e7e$e8f80320$9310...@ati147.app-tech.com>...
Thanks, Jon
--
To reply to me, please remove the _ from my email address.
Dietrich Neuman wrote in message
<01bd5f46$e2ce9220$1e2da8c0@dietrichn_pc2>...
The ThreadID is needed in the DB table only temporary, so you can use
almost any field except the ID field to store the ThreadID and in the
UPDATE statement overwrite it with the correct value of the field.
I dont know if this is a good way, so any comments are welcome.
/Per Olsson
P.S. If the ODBC driver supports it, it is possible to use
SQLBulkOperations to add record(s) and get bookmark(s) to the added
record(s) in return. You cant use an SQL INSERT statement to add the
record(s) with this method. See the ODBC API Help file for
SQLBulkOperations.
----
--
If everything else fails, read the instructions.
Hope this helps
Michael Bowman
Client/Server Y2K team COMSYS & VERTICAL WORKS
Per Olsson wrote in message <3530FCD6...@algonet.se>...
> > >> Anyone know of a way to get the ID or Primary Key of a row that
> > >> was just inserted via SQLPrepare and then SQLExecute? In
> > >> Informix ESQL/C you could access the sqlca.sqlerrd[1] field to
> > >> get the long primary key value of the inserted row (if applicable).
I just follow the insert with a query based on some fields in the record I
just inserted. Since there ought to be some combiantion of columns not
including the primary key that make the record unique, the query should
return exactly one row.
CF
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading