MySQL Forums
Forum List  »  Perl

Re: How to retrieve output parameter from stored procedure?
Posted by: Steve Porter
Date: October 23, 2007 10:29AM

I finally figured it out. I modified the code as follows:

use DBI;

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

# see if the stored procedure will work
my $nSenseId;
my $strMsg;
$hDb->do( "call CreateDictionaryEntry( 7,'junk46', 'N', \@nSenseId, \@strMsg );" );
$nSenseId = $hDb->selectrow_array("SELECT \@nSenseId");
$strMsg = $hDb->selectrow_array("SELECT \@strMsg");

$hDb->disconnect();

exit;

The backslashes are needed in front of the @.

Steve

Options: ReplyQuote


Subject
Written By
Posted
Re: How to retrieve output parameter from stored procedure?
October 23, 2007 10:29AM


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.