Re: jdbc help needed!
Posted in 1997
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL, Triggers, Constraints & Referential Integrity, Java & JDBC Development
Jeff Sturm wrote:
>
> Peter Wiley (peter@prospect.anprod.csiro.au) wrote:
> : In article <869750631.15772@dejanews.com> r53837@email.sps.mot.com writes:
> : >The first problem I have is that I have no way of figuring out what value
> : >was inserted in a serial column. In embedded SQL, there is the SQLCA
> : >structure, which holds the value inserted into a serial column in the last
> : >insert; however jdbc doesn't allow access to this structure (does it?).
> : >Is there any other way I can do this? I need to know what value was
> : >inserted into the serial column in an insert command, so that I can link
> : >that tupple somewhere else.
>
> : Try using a stored proc to do the insert. THe spl can then get the new
> : serial value and return it to you. Since I haven't got the jdbc drivers to
> : work for Openlink/Informix combo yet, I can't test this, but it should
> : work fine.
>
> Good idea, but unfortunately he is using Online 5.x, in which there is no
> way to access the SQLCA structure in a stored procedure. This is a common
> problem for ODBC access too. Online 7.x fixed the problem with the new
> dbinfo() stored procedure.
I received some information from Informix concerning this. In their
Tech Info Article #4679, they describe a work around that I believe will
work with the 5.0 engines. It involves setting up an insert trigger and
using a global variable. I don't want to type in the example but you can
get Informix to fax the same information they faxed me.
Julie