Re: DBD::Informix on Solaris



On 7/4/06, Govinda.Pfister@xxxxxxxxxx <Govinda.Pfister@xxxxxxxxxx> 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 <jonathan.leffler@xxxxxxxxx> #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."


Relevant Pages

  • Re: Size matters to some
    ... The underlying remote database connection ... physical layer is actually managing it all, the logical layer is forced to ... constraints as specified by developers. ... want to validate the information getting written. ...
    (comp.databases.pick)
  • Re: Please help: Numeric class properties
    ... > that reflects a table in my database. ... I wish to validate the property values before writing them ... TextBox entry BEFORE you attempt to assign it anywhere? ... Function IsDigitsOnly(Value As String) As Boolean ...
    (microsoft.public.vb.general.discussion)
  • Re: OOP database tables <-> php interface (semi LONG)
    ... So potentially in a table with 25 columns I can have 25 getXXX and 25 setXXX methods, database related methods, etc. ... Thus I'm declaring one generic fieldSpecs array that provides properties for the fields so that the generic getters and setters as well as the generic Validator will take care of the rest. ... now how are you going to validate the entry? ...
    (comp.lang.php)
  • Re: removing last chrs (with different browsers giving different last chrs )
    ... I don't have one function which tries to validate everything. ... This ensures the value is an integer and puts out a meaningful error message if it isn't. ... that proper escaping of each and every data before db manipulation is done by the db class. ... but otherwise perfectly valid I would model this into the database. ...
    (comp.lang.php)
  • Validate logins with ASP, MS Access and Cookies error
    ... while trying to validate username and password on login form I am ... Microsoft JET Database Engine error '80040e10' ... dim cnStr ...
    (microsoft.public.inetserver.asp.db)