Accessing row serial number after insert
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL
Hello, Do Intersolv's Informix ODBC drivers allow access to the serial number assigned to a row following an insert as per the NewEra/4GL SQLCA.SQLERRD[2] mechanism ? If so how does it work ? Platfrom: NT4 Server: Informix5 running on Dynix/PTX Apps: VB5/6 using ADO2.0 Driver: Intersolv 3.11 Informix
>Hello, >Do Intersolv's Informix ODBC drivers allow access to the serial number >assigned to a row following an insert as per the NewEra/4GL SQLCA.SQLERRD[2] >mechanism ? > >If so how does it work ? There is no direct support for it. But you can always call a procedure that returns dbinfo('sqlca.sqlerrd1') Bashar Chalabi
Thanks Bashar! I'll give that a shot. John Bashar Chalabi wrote in message <922964909.29215.0.nnrp-11.c29fbb28@news.demon.co.uk>... >>Hello, >>Do Intersolv's Informix ODBC drivers allow access to the serial number >>assigned to a row following an insert as per the NewEra/4GL >SQLCA.SQLERRD[2] >>mechanism ? >> >>If so how does it work ? > > >There is no direct support for it. But you can always call a procedure that >returns dbinfo('sqlca.sqlerrd1') > >Bashar Chalabi > > >
In article <7dvm3k$7s0$1@starburst.uk.insnet.net>, jclynes@family.co.uk says... >Thanks Bashar! > >I'll give that a shot. > >John > >Bashar Chalabi wrote in message >>There is no direct support for it. But you can always call a procedure that >>returns dbinfo('sqlca.sqlerrd1') >> >>Bashar Chalabi Good luck in using it with VB 5 or 6. It is not that easy to control exactly what VB does when it accesses databases; I suspect you'll find that there are other database calls that will make the dbinfo call useless. William Harris william@carsinfo.com
> >Bashar Chalabi wrote in message > >>There is no direct support for it. But you can always call a procedure that > >>returns dbinfo('sqlca.sqlerrd1') > >> > >>Bashar Chalabi > > Good luck in using it with VB 5 or 6. It is not that easy to control exactly > what VB does when it accesses databases; I suspect you'll find that there are > other database calls that will make the dbinfo call useless. Dear William, Can you be more specific in the problems that could arise from this imperfection in VB? We are using the dbinfo call to get serial numbers after inserting rows in our applications built in VB 6. Is there a way to test this unwanted behaviour? Many thanks in advance, Sven Eric, the Netherlands
Hi All,
Having just read this, I'm glad to hear I'm not alone in this problem.
I've also considered doing dbinfo('sqlca.sqlerrd1') , to get a serial
number after an insert. I'm slightly concerned though about what kind of
locking to use. For example, if the DB is locked at row level, surely an
insert into another table will update the value in sqlca.sqlerrd1 ? Ifthe insert and dbinfo are placed in a BEGIN / END will that solve the
problem ?
Can anyone shed some light on this problem? Sorry if these are very
newbie questions, but I'm quite new to Informix and in fact DBs in
general !
Thanks for any advice offered,
Dan Leong
daniel.leong@uk.point4.com
Sven Eric wrote:
>
> > >Bashar Chalabi wrote in message
> > >>There is no direct support for it. But you can always call a procedure that
> > >>returns dbinfo('sqlca.sqlerrd1')
> > >>
> > >>Bashar Chalabi
> >
> > Good luck in using it with VB 5 or 6. It is not that easy to control exactly
> > what VB does when it accesses databases; I suspect you'll find that there are
> > other database calls that will make the dbinfo call useless.
>
> Dear William,
>
> Can you be more specific in the problems that could arise from this
> imperfection in VB? We are using the dbinfo call to get serial numbers
> after inserting rows in our applications built in VB 6.
>
> Is there a way to test this unwanted behaviour?
>
> Many thanks in advance,
>
> Sven Eric, the Netherlands