MySQL Forums
Forum List  »  Perl

How to retrieve output parameter from stored procedure?
Posted by: Steve Porter
Date: October 22, 2007 12:48PM

I have stored procedure that returns a couple output parameters. I have spent 2 days searching the web for how to retrieve these values, but nothing I have tried works. Here is the current version of the test code I am using. How do I retrieve values from a stored procedure?

use DBI;

my $hDb = DBI->connect( 'dbi:mysql:dictionary',
) || die "Database connection not made: $DBI::errstr";
print "connected\n";

# see if the stored procedure will work
my $strCreateDictEnt = $hDb->prepare( 'call CreateDictionaryEntry(7,?,?, @nSenseId, @pszMsg);' );
$strCreateDictEnt->bind_param( 2, 'junk42' );
$strCreateDictEnt->bind_param( 3, 'N' );
my @nSenseId = $dbh->selectrow_array("SELECT @nSenseId");
@strMsg = $dbh->selectrow_array("SELECT @pszMsg");



The selectrow_array lines always return an error, in this case it is Can't call method "selectrow_array" on an undefined value.

Thanks, Steve

Options: ReplyQuote

Written By
How to retrieve output parameter from stored procedure?
October 22, 2007 12:48PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.