I found the problem. It was related due to a byte swap error on big endian machines in freetds V 0.53.
Now everything is working as expected. Martin > -----Ursprüngliche Nachricht----- > Von: Sauer (ext_evosoft) Martin > Gesendet am: Freitag, 5. April 2002 08:35 > An: '[EMAIL PROTECTED]' > Betreff: AW: Problem with SQL errorhandling using DBD:Oracle and > DBD:Sybas e > > I'm sorry, I also found this rollback handling error and now its working > for > Oracle. But still not for DBD::Sybase!! > > I tried V 0.91 and V 0.94 - both the same. All servermessages get printed > to > stderr and I get an undef in the program. > That's also for the servermessages at connect time. (The first two lines > in > the appended level 2 trace) > > Need desperate help. > > I've tried to understand the code and that's how far I came: > The problem seems to be in the result handling > st_next_result() -> ct_results(13) == 1 -> CS_CMD_FAIL > st_next_result() -> ct_results(12) == 1 -> CS_CMD_SUCCED > ct_results() final retcode = 15 -> CS_END_RESULT > st_next_result() -> lasterr = 0, lastsev = 0 -> with no error > !!!! > > Is there anybody, who can tell me how this handling is supposed to be > working??? > > > Martin > > > > Here's the trace output: > > Changed database context to 'wsdbs'. > Changed language setting to us_english. > DBI 1.21-nothread dispatch trace level set to 2 > -> do for DBD::Sybase::db (DBI::db=HASH(0x1e7214)~0x1f3af8 'INSERT > INTO > wsdb_fehlerbeschreibung ( FEHLER_ID, CREATION_TS) VALUES ( 1491, > '27.02.2002 > 10:41:00')') > 2 -> prepare for DBD::Sybase::db (DBI::db=HASH(0x1f3af8)~INNER 'INSERT > INTO wsdb_fehlerbeschreibung ( FEHLER_ID, CREATION_TS) VALUES ( 1491, > '27.02.2002 10:41:00')' undef) > 2 <- prepare= DBI::st=HASH(0x1e7244) at Sybase.pm line 131 > -> execute for DBD::Sybase::st (DBI::st=HASH(0x1e7244)~0x174fb0) > syb_db_opentran() -> ct_command( > BEGIN TRAN DBI105808 > ) = 1 > syb_db_opentran() -> ct_send() = 1 > syb_db_opentran() -> ct_results(12) == 1 > syb_st_execute() -> ct_command() OK > syb_st_execute() -> ct_send() OK > The conversion of a char data type to a datetime data type resulted in an > out-of-range datetime value. > The statement has been terminated. > st_next_result() -> ct_results(13) == 1 > st_next_result() -> ct_results(12) == 1 > ct_results() final retcode = 15 > st_next_result() -> lasterr = 0, lastsev = 0 > syb_st_execute() -> got CS_CMD_DONE: resetting ACTIVE, moreResults, > dyn_execed > <- execute= undef at Sybase.pm line 132 > <- do= undef at tst7.pl line 27 > -> $DBI::err (*) FETCH from lasth=DBI::st=HASH(0x174fb0) > <- err= undef > Use of uninitialized value in concatenation (.) or string at tst7.pl line > 42. > -> $DBI::errstr (&) FETCH from lasth=DBI::st=HASH(0x174fb0) > >> DBD::Sybase::st::errstr > Use of uninitialized value in concatenation (.) or string at tst7.pl line > 42. > > > > > -----Ursprüngliche Nachricht----- > > Von: David Kirol [SMTP:[EMAIL PROTECTED]] > > Gesendet am: Donnerstag, 4. April 2002 15:00 > > An: Sauer (ext_evosoft) Martin > > Betreff: RE: Problem with SQL errorhandling using DBD:Oracle and > > DBD:Sybase > > > > Martin, > > The oracle error string is undefined in the sub because you are > > reading the > > error string from the roll back. Error trapping in perl is usually done > > with > > eval. > > HTH > > > > -----Original Message----- > > From: Sauer (ext_evosoft) Martin > > [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, April 04, 2002 1:21 AM > > To: '[EMAIL PROTECTED]' > > Subject: Problem with SQL errorhandling using DBD:Oracle and DBD:Sybase > > > > > > I have installed the following SW on Solaris 2.6: > > perl 5.6.1 > > DBI-1.21 > > DBD:Oracle-1.12 > > DBD:Sybase-0.94 > > freetds-0.53 (connecting to MS-SQL 7.0 with TDS_VER 7.0) > > > > Because I'm new to DBI, I tried to write some programs > > (copies/modifications > > of examples found in the documentation) to learn the handling. > > Now I stuck at the error handling of SQL-Statements. Here is my test: > > > > use DBI; > > #my $server = "dbi:Oracle:$obase"; > > my $server = "dbi:Sybase:server=$obase"; > > > > my $DbS = DBI->connect($server, $ouser, $opass, > > { AutoCommit => 0, RaiseError => 0, PrintError => 0 } ) > > or die $DBI::errstr; > > > > my $stmt = "INSERT INTO tbl1( ID, CREATION_TS) VALUES (1491, '27.02.2002 > > 10:41:00')"; > > #Should return 'uniq constraint' on Oracle and 'out-of-range datetime' > on > > MS-SQL > > $DbS->do($stmt) or err_trap("Error during do"); > > $DbS->disconnect; > > > > #--------------------------------------------------------------- > > # Subroutines > > #--------------------------------------------------------------- > > sub err_trap > > { > > my $error_message = shift(@_); > > $DbS->rollback; > > die "$error_message\n ERROR: $DBI::err ($DBI::errstr)\n"; > > } > > > > > > I thought after reading the documentation, I should be able to test in > > err_trap via $DBI::err for specific SQL error codes and handle them. > > But... > > Connecting to MS-Sql, I get the following output: > > > > Changed database context to 'wsdbs'. > > Changed language setting to us_english. > > The conversion of a char data type to a datetime data type resulted in > > an > > out-of-range datetime value. > > The statement has been terminated. > > Use of uninitialized value in concatenation (.) or string at tst4.pl > > line > > 33. > > Use of uninitialized value in concatenation (.) or string at tst4.pl > > line > > 33. > > Error during do > > ERROR: () > > Issuing rollback() for database handle being DESTROY'd without > explicit > > disconnect(). > > > > Connecting to Oracle, I get the following output: > > > > Use of uninitialized value in concatenation (.) or string at tst5.pl > > line > > 37. > > Use of uninitialized value in concatenation (.) or string at tst5.pl > > line > > 37. > > Error during do > > ERROR: () > > > > So here are the things which I don't understand: > > > > 1) Why are $DBI::err and $DBI::errstr set to undef at that point of > > execution? Is this the wrong way to check for errors? Do I need to test > > them > > via the database handle ( $DbS->err ) ? > > > > 2) I also tied to use > > $DbS->do($stmt) or die " State: ", $DBI::state, ", Error: ", > > $DBI::err, ", Msg: ", $DBI::errstr, "\n"; > > and got for that specific part: > > Use of uninitialized value in die at tst4.pl line 22. > > Use of uninitialized value in die at tst4.pl line 22. > > State: , Error: , Msg: > > So why do I get this errormsg only 2 times and not 3 times? > > > > 3) Were are the additional lines of output coming from using the > > DBD:Sybase > > driver? How can I get rid of them? > > > > It seems to me, that I've done something in an incorrect way, but I have > > no > > idea what? So any help would be appriciated. > > > > Thanks > > > > Martin Sauer > > > >