Hi Glen,

I hope you don't mind the (nearly) fullquote to keep the list informed.

"G S" <[EMAIL PROTECTED]> wrote:
> Hi Hans,
> 
> Thank you for your response.  I was able to capture $retCode using your 
> suggestion.  I eventually removed the error handler (after the "||") just to 
> isolate something I do not understand.  I am tracking down an issue where 
> errors are not returned from $sth->execute() when a parameter data type 
> mismatch occurs when calling a stored procedure.  It actually looks like it 
> might be a bug somewhere.  Maybe in the Sybase driver.
> 
> Here is my example with updated comments.  The problem is in scenario 2.
> Do you have an explanation for it? Thanks.  Glen
> 
> # Execute query. Capture $retCode for later examination.
> 
> $retCode = $sth->execute()
> 
> # Examine $retCode, err, and errstr
> 
> print "<BR>after execute retCode is: $retCode <br>";
> printf("dbh->execute():<br>" .
> "dbh->err= '%s'<br>" .
> "dbh->errstr= '%s'<br>",
> $dbh->err,
> $dbh->errstr
> );
> 
[ ... ]
> scenario 2 ------------------------------------------
> Here I deliberately passed an incorrect data type as a parameter to the 
> stored procedure.  As you can see, there was an error, but the value 
> returned from $sth->execute() was -1.  I would expect it to be undefined.  
> This looks like a bug, maybe in the Sybase driver.  What do you think?
> 
> after execute retCode is: -1
> dbh->execute():
> dbh->err= '257'
> dbh->errstr= 'Server message number=257 severity=16 state=1 line=0 
> server=SCATS1P_SQL procedure=sc_deal_update text=Implicit conversion from 
> datatype 'VARCHAR' to 'SMALLINT' is not allowed. Use the CONVERT function to 
> run this query.'
> 
[ ... ]

As I am no sybase expert, I am bringing the question back to the list.
Perhaps you could send a sample SQL code that demonstrates the problem
to the list? Other potentially useful information includes the version
of DBD::Sybase you are using, the DBI version, the version of your Sybase
(or FreeTDS) client library, and of your DB Server.


Hans

-- 
Hans Ranke                                          [EMAIL PROTECTED]
Lehrstuhl fuer                                             Institute for
Entwurfsautomatisierung                     Electronic Design Automation
              Technische Universitaet Muenchen, Germany                
Phone +49 89 289 23660                              Fax +49 89 289 63666


Reply via email to