|
|
sybperl-l Archive
Up Prev Next
From: Sharif Islam <mislam at uiuc dot edu>
Subject: Re: DBD::Sybase datatype issue
Date: Apr 4 2008 3:18PM
Michael Peppler wrote:
> Sharif Islam wrote:
>
>> # run the stored proc
>> my $sp_qry = "EXEC Find_Changed_rows ?" ;
>> my $sth1 = $dbh->prepare($sp_qry) ;
>> $sth1->bind_param(1, $row[0],SQL_TIMESTAMP);
>> $sth1->execute($sp_qry);
>>
>> When I run this:
>>
>> DBD::Sybase::st execute failed: Server message number=257 severity=16
>> state=3 line=0 server=MYSERVER procedure=Find_Changed_rows
>> text=Implicit conversion from data type char to timestamp is not
>> allowed. Use the CONVERT function to run this query. at
>> track_changes.pl line 35
>
> SQL_TIMESTAMP is not the same as a T-SQL "timestamp" datatype.
>
> Try using SQL_BINARY as the type to see if this works any better.
Thanks. I tried this, now I don't get the error but it is returning
empty result set. I turned on all the error checking I am aware of but
it seems, the stored procedure still not interpreting the datatype
correctly.
__CODE__
my $sp_qry = "EXEC Find_Changed_rows ? ";
print $sp_qry;
my $sth1 = $dbh->prepare($sp_qry) ;
$sth1->bind_param(1,$row[0], SQL_BINARY);
$sth1->execute($sp_qry)
or die "Couldn't execute statement: " . $sth1->errstr;
print "\n";
print Dumper($sth1);
while(my @d = $sth1->fetchrow_array)
{
print "\n";
print "Result: @d\n";
}
___CODE___
# perl track_changes.pl
0000000000071b59 // this is my min_active_rowversion
EXEC Find_Changed_rows ? // print sp_qry
$VAR1 = bless( {}, 'DBI::st' ); // sth1
|