Hi Folks,
     I am using the perl version 5.005_02 built for MSWin32-x86 and sybase 
9.0.0. I have a DB and a table. I have used bigint as datatype for some columns 
in a table. The bigint values are stored correctly in database. While I trying 
to fetch the columns from the table, the columns which are having bigint 
datatypes (with values greater than 8-digits) are not fetched and it throws the 
below error. The bigint values with 8-digits or less canbe fetched displayed 
correctly. Please let me know the method to fetch the bigint values.
 
DBD::ASAny::st fetchrow failed: Cannot convert 99999999454 to a varchar (DBD: 
fetch failed) at c:\perl\test.pl line 28.
 
Code :
use DBI;
use Math::BigInt;
$protocol  = "ASAny";
$database  = "Sample";
$server    = "asademo9";
$url = "DBI:$protocol:$database:$server";
print "--> connect\n";
$uid1="Sample";
$pwd1="jh35y4";
my $dbh = DBI->connect($url, $uid1,$pwd1) or die "$DBI::errstr\n";
my $sql_op = "SELECT * FROM Chk";
my $sth = $dbh->prepare( $sql_op );
my $num = $sth->execute() or die "$DBI::errstr\n";
$rows1=$sth->rows();
print "Rows : $rows1\n";
while ( my $row =  $sth->fetchrow() )      # This is Line No.28
{ 
my $isbn = $row->{Name};        
my $title = $row->{Value1};                   # bigint
my $type = $row->{Date1};                   # timestamp
my $qty = $row->{Value2};                   # bigint

print "Retrieve: [$isbn], [$title], [$type], [$qty] \n";
}
 
 
Thanks in Advance,
Mohankumar.


                
---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.

Reply via email to