In a script I have something like this:
The stored procedure is like this:$db = DBI->connect('dbi:ODBC:'.$DSN, $UID, $PWD, {PrintError => 0,Rais +eError => 1,LongReadLen => 65536}); ... $FetchPagesWithUpdatedTranslations = $db->prepare('exec FetchPagesWith +UpdatedTranslations ?, ?'); # product_id, time ... my $res = $FetchPagesWithUpdatedTranslations->execute( $prodId, SQLtim +e($FILES{':'.$section})); ... sub SQLtime { my $time = shift() || 0; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($time); $year+=1900; $mon++; return "$year-$mon-$mday $hour:$min:$sec"; }
This code works fine with Perl 5.6.1. (ActiveState build 631), but reportsCREATE PROCEDURE FetchPagesWithUpdatedTranslations ( @ProductId Int, @Date datetime = NULL ) AS ...
with Perl 5.8 (ActiveState build 804). Both running under Win2k server with MS SQL 2000.DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Inval +id character value for cast specification (SQL-22018)(DBD: st_execute +/SQLExecute err=-1) at ...
I tried it with DBI 1.30 (from PPM) and DBI 1.32 (compiled by myself) and with DBD::ODBC 0.43 (from PPM), 1.02 and 1.04 (compiled by myself) and it crashed every time.
I also tried to change the stored procedure to
and that worked with both 5.6.1 and 5.8. Does anyone have any idea what could be wrong? In this case I can change the stored procedure, but in the future this could be a problem.CREATE PROCEDURE FetchPagesWithUpdatedTranslations ( @ProductId Int, @DateS varchar(20) = NULL ) AS ...
Thanks, Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |