This is a discussion on Strange behavior of DBD/DBI Informix within the Informix forums, part of the Database Server Software category; --> I am not sure if this list is the best one to post to regarding this problem. If not ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am not sure if this list is the best one to post to regarding this problem. If not please point me to the better one. Consider the following scenario: 1)$dbh = DBI->connect("dbi:Informix:$database", '', '', { PrintError => 1, RaiseError => 1}); 2)$sql = qq{ INSERT INTO sometable VALUES ( somevalues ) }; 3)$sth = $dbh->prepare( $sql ) or die "Failed to prepare '$sql'\n"; 4)$dbh->disconnect; 5)N statements of the form $sth->bind_param( K, somevalue ); (K=1..N) 6)$ret = $sth->execute; After doing 4) I still can execute 5) and 6) without any obvious error message. Of course no insert occurs but it is not clear why (supposing we do not know about 4). Even more, while testing the return code $ret We still can not understand what is the problem. $ret is equal to '0E0' that can mean 1) "statement does not affect any rows" 2) "cursor is opened successfully" All of $@ $DBI::errstr sqlcode sqlerrm show nothing in this situation. Should I check something else? Is it bug ("feature")? Your comments are very welcome. Alexandre Krasnov. (TERN Group - Russia) sending to informix-list |
| ||||
| iiug-list@tern.ru wrote: > I am not sure if this list is the best one to post to regarding this > problem. If not please point me to the better one. The alternative is dbi-users@perl.org - both work, both are OK. > Consider the following scenario: > 1)$dbh = DBI->connect("dbi:Informix:$database", '', '', > { PrintError => 1, RaiseError => 1}); > 2)$sql = qq{ INSERT INTO sometable VALUES ( somevalues ) }; > 3)$sth = $dbh->prepare( $sql ) or die "Failed to prepare '$sql'\n"; > 4)$dbh->disconnect; > 5)N statements of the form > $sth->bind_param( K, somevalue ); > (K=1..N) > 6)$ret = $sth->execute; > > After doing 4) I still can execute 5) and 6) without any obvious error > message. Of course no insert occurs but it is not clear why (supposing > we do not know about 4). I could live with 5 not causing problems - not happy, but I could live with it. Step 6 should unequivocally fail. > Even more, while testing the return code $ret We still can not > understand what is the problem. $ret is equal to '0E0' that can mean > 1) "statement does not affect any rows" > 2) "cursor is opened successfully" > > All of > $@ > $DBI::errstr > sqlcode > sqlerrm > show nothing in this situation. > > Should I check something else? > Is it bug ("feature")? At first glance, it is a bug - in DBD::Informix. > Your comments are very welcome. > > > Alexandre Krasnov. > (TERN Group - Russia) > sending to informix-list Please - always - send the version information of: Platform (o/s in particular, sometimes h/w) Perl DBI DBD::Informix ESQL/C or CSDK Database server Or use the bug reporting mechanisms provided with DBD::Informix. And please send a simple, self-contained reproduction of the problem. using DBD::Informix::TestHarness; my $dbh = DBI->connect({RaiseError => 1, Printerror => 1}); $dbh->do(q{CREATE TEMP TABLE SomeTable(col01 integer not null)}); my $sql = "INSERT INTO SomeTable VALUES(?)"; my $sth = $dbh->prepare($sql); $dbh->disconnect; $sth->bind_param(1, 1); $sth->execute; This should produce an error, definitely on the execute, and very arguably on the bind_param. I thought there was a test to validate this stuff - but either that test is broken or it is AWOL. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ |
| Thread Tools | |
| Display Modes | |
|
|