1 year ago
#329974
newdeveloper
stored procedure bigint type fails in perl dbi
I have two stored procedures one works. When the db admin changed variables from int to unsigned bigint the procedure fails.
use DBI qw(:sql_types);
use DBD::Sybase;
use Data::Dumper;
my $dbh = DBI->connect($connect,$usr,$pwd)or die "Couldn't connect!\n" . DBI->errstr;
my $sth = $dbh->prepare("exec progress_web \@id=?, \@as_select=?");
$sth->bind_param(1,5374,SQL_INTEGER);
$sth->bind_param(2,1,SQL_BIT);
$sth->execute;
while(my $row = $sth->fetch) {
print Dumper($row);
}
$sth->finish;
$dbh->disconnect;
The above works, however when the admin made the exact same procedure but changed return data as unsigned bigint the above fails. I did a trace and here is what I get.
DBI::st=HASH(0x562ae415c100) trace level set to 0x0/4 (DBI @ 0x0/0) in DBI 1.643-ithread (pid 3156660)
-> execute for DBD::Sybase::st (DBI::st=HASH(0x562ae415c2c8)~0x562ae415c100) thr#562ae3d1c2a0
bind :p1 (@request_id) <== 5374 (size 94742215246952/18695992639489/0, ptype 1, otype 8)
bind :p1 <== '5374' (size 9, ok 1)
datafmt: type=8, name=@request_id, status=256, len=4
saved type: 8
bind :p2 (@as_select) <== 1 (size 94742215246976/18695992639489/0, ptype 1, otype 8)
bind :p2 <== '1' (size 9, ok 1)
datafmt: type=8, name=@as_select, status=256, len=4
saved type: 8
cmd_execute() -> ct_send() OK
cmd_execute() -> set inUse flag
st_next_result() -> ct_results(4040) == 1
ct_res_info() returns 10 columns
STORE DBI::st=HASH(0x562ae415c100) 'NUM_OF_FIELDS' => 10
describe() retcode = 0
st_next_result() -> lasterr = 0, lastsev = 0
st_next_result() -> force CS_CMD_FAIL return
st_next_result() -> got CS_CMD_FAIL: resetting ACTIVE, moreResults, dyn_execed, exec_done
clear_sth_flags() -> resetting ACTIVE, moreResults, dyn_execed, exec_done
clear_sth_flags() -> reset inUse flag
<- execute= ( undef ) [1 items] at ./sybase_test.pl line 24
-> fetch for DBD::Sybase::st (DBI::st=HASH(0x562ae415c2c8)~0x562ae415c100) thr#562ae3d1c2a0
<- fetch= ( undef ) [1 items] at ./sybase_test.pl line 26
-> finish for DBD::Sybase::st (DBI::st=HASH(0x562ae415c2c8)~0x562ae415c100) thr#562ae3d1c2a0
<- finish= ( 1 ) [1 items] at ./sybase_test.pl line 29
-> DESTROY for DBD::Sybase::st (DBI::st=HASH(0x562ae415c100)~INNER) thr#562ae3d1c2a0
syb_st_destroy: called on e4073900...
syb_st_destroy(): freeing imp_sth->statement
Working procedure
declare @rtrn int,
@num_files int,
.....
Failed procedure
declare @rtrn int,
@num_files unsigned bigint,
....
perl
sybase
0 Answers
Your Answer