Hello,

I am running into an issue with the insert of a number into an INT8 field when that number is larger than the max value of an INTEGER. I have included the test script, output and additional configuration of the machine. Any help would be appreciated.

Thanks,
Steve

This is running on a Sun machine with Solaris 8 and IDS 9.40FC1.
-------------------------
Output
-------------------------
Perl Version 5.008
DBI Version 1.37
DBD::Informix Version 2003.04
IBM Informix CSDK Version 2.81, IBM Informix-ESQL Version 9.53.UC1
# DBI->connect('dbi:Informix:test_db', '', '');
#       Connect Attribute: RaiseError => 1
#       Connect Attribute: ChopBlanks => 1
large_number => 4278190080
inserted_value => -16777216
-------------------------
Script.
-------------------------

use strict;
use warnings;
use DBI;
use DBD::Informix::TestHarness;
use DBD::Informix::TechSupport;
use DBD::Informix qw(:ix_types);

print_versions("Perl DBI DBD::Informix ESQL/C");
my $large_number = 4278190080;
my $table = "test_table";
my $inserted_value;

my $dbh = connect_to_test_database({RaiseError => 1});
$dbh->do(qq%CREATE TEMP TABLE $table (id INT8)%);
my $sth = $dbh->prepare(qq%INSERT INTO $table VALUES(?)%);
$sth->bind_param(1,$large_number, {ix_type => IX_INT8});

$sth->execute($large_number);

$sth = $dbh->prepare(qq%SELECT id FROM $table%);
$sth->bind_columns(\$inserted_value);
$sth->execute;
$sth->fetch;
$sth->finish;

print "large_number => $large_number\n";
print "inserted_value => $inserted_value\n";

exit 0;




Reply via email to