W
Wonderinguy
Hi everybody , I have been trying to execute a simple DB2 stored
Procedure from perl. But it doesn't work. Could anybody please help me
find out why this is happening :
here is my perl script that execute the SP :
<snip>
my $dbh = DBI->connect( "dbiB2:$database","user1","passwd1") || die
"cannot connect to db2";
my $callstmt = "CALL SPACESP('DB','TEXAS')";
my $sth = $dbh->prepare($callstmt) || die "can't do
prepare",$dbh->errstr(),"\n";
$sth->execute || die "Can't do executed:" , $dbh->errstr(),"\n";
<snip>
When I execute this I get this on the apache error.log :
Premature end of script headers: get_dbspace.cgi, referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Use of
uninitialized value in warn at C:/Program Files/Apache
Group/Apache2/cgi-bin/space/get_dbspace.cgi line 8., referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Warning:
something's wrong at C:/Program Files/Apache
Group/Apache2/cgi-bin/space/get_dbspace.cgi line 8., referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] DBD:B2::st
execute failed: [IBM][CLI Driver][DB2] SQL0440N No function by the
name "SPACESP" having compatible arguments was found in the function
path. SQLSTATE=42884
, referer: http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Can't do
executed:[IBM][CLI Driver][DB2] SQL0440N No function by the name
"SPACESP" having compatible arguments was found in the function path.
SQLSTATE=42884
, referer: http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] , referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Database handle
destroyed without explicit disconnect., referer:
http://localhost/space.html
I have tested the stored procedure manually. I can execute the stored
procedure from a command line or a third party tool.
Any input is greatly appreciated
Thanks
Procedure from perl. But it doesn't work. Could anybody please help me
find out why this is happening :
here is my perl script that execute the SP :
<snip>
my $dbh = DBI->connect( "dbiB2:$database","user1","passwd1") || die
"cannot connect to db2";
my $callstmt = "CALL SPACESP('DB','TEXAS')";
my $sth = $dbh->prepare($callstmt) || die "can't do
prepare",$dbh->errstr(),"\n";
$sth->execute || die "Can't do executed:" , $dbh->errstr(),"\n";
<snip>
When I execute this I get this on the apache error.log :
Premature end of script headers: get_dbspace.cgi, referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Use of
uninitialized value in warn at C:/Program Files/Apache
Group/Apache2/cgi-bin/space/get_dbspace.cgi line 8., referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Warning:
something's wrong at C:/Program Files/Apache
Group/Apache2/cgi-bin/space/get_dbspace.cgi line 8., referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] DBD:B2::st
execute failed: [IBM][CLI Driver][DB2] SQL0440N No function by the
name "SPACESP" having compatible arguments was found in the function
path. SQLSTATE=42884
, referer: http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Can't do
executed:[IBM][CLI Driver][DB2] SQL0440N No function by the name
"SPACESP" having compatible arguments was found in the function path.
SQLSTATE=42884
, referer: http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] , referer:
http://localhost/space.html
[Fri May 07 15:14:56 2004] [error] [client 127.0.0.1] Database handle
destroyed without explicit disconnect., referer:
http://localhost/space.html
I have tested the stored procedure manually. I can execute the stored
procedure from a command line or a third party tool.
Any input is greatly appreciated
Thanks