Dmitriy
asked on
Printing from stored procedure to perl
I am calling a stored procedure from perl which has a lot of print statements. However, the statements are not printed in the perl output. Is there any way to make perl read and display the PRINT statements from the stored procedure?
Thanks in advance,
Dmitriy
Thanks in advance,
Dmitriy
redirect the output to a file and print the file.
ASKER
What output? I don't get any output from the stored procedure. That's the problem.
from perl in the sense you are using perl connect,preparestatement etc..on in your perl code you are using system or exec or some other utility and runt he ISQL that executes the stored proc.My answer will hold good if you are running it through a ISQL script other can can you please post the perl script part that is calling the stored proc
sorry for the typos
I want to know how you are running the SP
1>using perl connect,preparestatement etc
or
2>using system or exec or some other utility and run the ISQL that executes the stored proc
I want to know how you are running the SP
1>using perl connect,preparestatement etc
or
2>using system or exec or some other utility and run the ISQL that executes the stored proc
ASKER
I declared a variable $dbh->new Sybase::DBlib user password server;
then I ran
$dbh->dbcmd("s_update_proc edure '$param1', '$param2'");
$dbh->dbsqlexec;
if (($result = $dbh->dbresults) ne SUCCEED)
{
print "Error\n";
exit(1);
}
then I ran
$dbh->dbcmd("s_update_proc
$dbh->dbsqlexec;
if (($result = $dbh->dbresults) ne SUCCEED)
{
print "Error\n";
exit(1);
}
ok try exec s_update_procedure '$param1', '$param2' insted
so your command will be
$dbh->dbcmd("exec s_update_procedure '$param1', '$param2'");
so your command will be
$dbh->dbcmd("exec s_update_procedure '$param1', '$param2'");
ASKER
Nope, that didn't work.
ASKER
That didn't work.
However, when I added OUTPUT parameter to the stored procedure and used $dbh->dbretdata and stored the returning values into an array, I got the results I wanted!
Thanks for trying koppcha
However, when I added OUTPUT parameter to the stored procedure and used $dbh->dbretdata and stored the returning values into an array, I got the results I wanted!
Thanks for trying koppcha
Great you got it.ok..error is in perl syntax
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.