H
hymie!
Greetings.
I'm not entirely sure if I have a Perl problem, a MSSQL problem, or a
DBI problem. But it's a problem, and maybe somebody can help me
resolve it.
I have an MSSQL database. It includes a field for ID numbers
that are about 18 digits long.
I have a generic searching tool that I use on this database. It basically
does this:
use DBI;
my $dbh=DBI->connect("DBI:Sybase:$host",$user,$pass) or
die "Couldn't connect to MSSQL: $DBI::errstr\n";
$sth = $dbh->prepare("select * from $ARGV[0]");
$sth->execute;
while (my @row = $sth->fetchrow_array)
{
foreach my $i (0 .. $#row)
{
print "$headings[$i]\t$defs[$i]\n\t$row[$i]\n";
}
print "==========\n";
}
Sadly, I end up with a response that looks like this:
ID bigint 8 not null
9.21474030305498e+18
I'm not doing any mathematical operations on the number. I just need
to know what the actual number is.
Again, I have no idea if this means MSSQL is sending me data in exp format,
or if Perl is doing the changing for me.
But if anybody knows how to fix it, I'd be grateful.
--hymie! http://lactose.homelinux.net/~hymie (e-mail address removed)
-------------------------------------------------------------------------------
I'm not entirely sure if I have a Perl problem, a MSSQL problem, or a
DBI problem. But it's a problem, and maybe somebody can help me
resolve it.
I have an MSSQL database. It includes a field for ID numbers
that are about 18 digits long.
I have a generic searching tool that I use on this database. It basically
does this:
use DBI;
my $dbh=DBI->connect("DBI:Sybase:$host",$user,$pass) or
die "Couldn't connect to MSSQL: $DBI::errstr\n";
$sth = $dbh->prepare("select * from $ARGV[0]");
$sth->execute;
while (my @row = $sth->fetchrow_array)
{
foreach my $i (0 .. $#row)
{
print "$headings[$i]\t$defs[$i]\n\t$row[$i]\n";
}
print "==========\n";
}
Sadly, I end up with a response that looks like this:
ID bigint 8 not null
9.21474030305498e+18
I'm not doing any mathematical operations on the number. I just need
to know what the actual number is.
Again, I have no idea if this means MSSQL is sending me data in exp format,
or if Perl is doing the changing for me.
But if anybody knows how to fix it, I'd be grateful.
--hymie! http://lactose.homelinux.net/~hymie (e-mail address removed)
-------------------------------------------------------------------------------