Unix Technical Forum

ISPY and DBD:Informix

This is a discussion on ISPY and DBD:Informix within the Informix forums, part of the Database Server Software category; --> I ran into a problem where $sth->err was not being set to the appropriate Informix SQL error. It was ...


Go Back   Unix Technical Forum > Database Server Software > Informix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 07:23 AM
comp.databases.informix
 
Posts: n/a
Default ISPY and DBD:Informix

I ran into a problem where $sth->err was not being set to the
appropriate Informix SQL error. It was always being set to undef. This
only happens when I was using an ISPY server. If I run the exact code
and point it to the actual Informix server, $sth->err gets set correct.
Here is some of the dbi trace output. It shows the SQL error, and that
->err is being set to undef.

***ERROR***
SQL: -239: Could not insert new row - duplicate value in a UNIQUE INDEX
column.
ISAM: -100: ISAM error: duplicate value for a record with unique key.
<<-- DBD::Informix::dbd_ix_exec()
<<-- DBD::Informix::dbd_ix_st_execute()
<- execute('92' '100001533899' ...)= undef at micro_upd.pl line 68
<- err= undef at micro_upd.pl line 69

Here is the actual code.


$sth_ins->execute($order_id,$serial_num,$man_date,$phone,$s tatus,$last_update_y4md.$last_update_hms);
print "inserted ",$rows ,"
xxxxxxx",defined($sth_ins->err)?" defined":" not defined","\n";
if ($sth_ins->err()) {
print "ERROR-INS:",$DBI::err,"
:$order_id,$man_date,$phone,$status,$last_update_y 4md.$last_update_hms,$serial_num\n";
$ins_errors++;
}else{
$rows_ins=$rows_ins+$sth_ins->rows;
}


I am using DBI 1.35, DBD 2003.04 and perl 5.8.0 on AIX 5.2 using
informix 9.30 uc7.

Rick

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 07:31 AM
Jonathan Leffler
 
Posts: n/a
Default Re: ISPY and DBD:Informix

comp.databases.informix wrote:

> I ran into a problem where $sth->err was not being set to the
> appropriate Informix SQL error. It was always being set to undef. This
> only happens when I was using an ISPY server. If I run the exact code
> and point it to the actual Informix server, $sth->err gets set correct.
> Here is some of the dbi trace output. It shows the SQL error, and that
> ->err is being set to undef.
>
> ***ERROR***
> SQL: -239: Could not insert new row - duplicate value in a UNIQUE INDEX
> column.
> ISAM: -100: ISAM error: duplicate value for a record with unique key.
> <<-- DBD::Informix::dbd_ix_exec()
> <<-- DBD::Informix::dbd_ix_st_execute()
> <- execute('92' '100001533899' ...)= undef at micro_upd.pl line 68
> <- err= undef at micro_upd.pl line 69
>
> Here is the actual code.
>
>
> $sth_ins->execute($order_id,$serial_num,$man_date,$phone,$s tatus,$last_update_y4md.$last_update_hms);
> print "inserted ",$rows ,"
> xxxxxxx",defined($sth_ins->err)?" defined":" not defined","\n";
> if ($sth_ins->err()) {
> print "ERROR-INS:",$DBI::err,"
> :$order_id,$man_date,$phone,$status,$last_update_y 4md.$last_update_hms,$serial_num\n";
> $ins_errors++;
> }else{
> $rows_ins=$rows_ins+$sth_ins->rows;
> }
>
>
> I am using DBI 1.35, DBD 2003.04 and perl 5.8.0 on AIX 5.2 using
> informix 9.30 uc7.


Dear Rick,

I've not had a chance to investigate this problem. It is not obvious
how the DBD::Informix code could be affected by whether it is I-Spy or
IDS that it connects to, assuming that the I-Spy actually relays the
errors accurately. Does an ESQL/C application - such as DB-Access -
get the errors?

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com