On 7/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I have a working informix environment with DBI and DBD::Informix. (see
details for version, configuration below).

I do have the problem that I cannot get the serial after a insert
statement is executed.
I always get '0' back. In the database each inserted record gets a unique
number assigned.

Why?



Answer 2...

Looking at the code in t/t10sqlca.t, there is code there that carefully
checks that the serial number stuff works.  So, first question, did you run
that test and did it pass?  I believe the answer to both will be yes, but
I'll ask anyway.

The other potentially significant detail is that the code in t/t10sqlca.t
tests $dbh->{ix_sqlerrd}[1] and not $sth->{ix_sqlerrd}[1] as in your code.
However, in your defense, the documentation in 'perldoc DBD::Informix'
clearly shows $sth->{ix_sqlerrd}[1] and not the $dbh version, though it says
you can get the information from either.  The QA suite does not appear to
validate that; however, the print_sqlca method (part of
DBD::Informix::TestHarness) is called with statement handles.  So, we should
validate that what is printed by print_sqlca and a statement handle matches
what is validated by the database handle.



The code is as follows:
----------------------------------------------------------
[...]
  else{
   my $id = $sth->{ix_sqlerrd}[1];
[...]
----------------------------------------------------------

Bugreport-Info:

perl -V
---------------------------------------
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
    osname=solaris, osvers=2.8, archname=sun4-solaris
    uname='sunos solaris 5.8 generic_108528-11 sun4u sparc sunw,ultra-5_10
'
    config_args='-Dcc=gcc -B/usr/ccs/bin/'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc -B/usr/ccs/bin/', ccflags ='-fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.3.2', gccosandvers='solaris2.8'
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
[...]




--
Jonathan Leffler <[EMAIL PROTECTED]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."

Reply via email to