MySQL Forums
Forum List  »  Stored Procedures

Calling 'Select' procedure from Perl
Posted by: sainandoor
Date: May 12, 2005 03:16PM

Hi Folks,
I am trying to call a "select" stored procedure from perl. I am not quite sure how to do it. Here is the stored procedure:

CREATE PROCEDURE spTest() begin select x AS X from tblTest;

It works fine when called from within MySQL.

mysql> call spTest():
+------+
| X |
+------+
| 24 |
| 3 |
+------+

I have the following code in perl:

my $spt = $db->prepare("Call spTest()");
$spt->execute();
$spt->bind_columns(\$id);
while($spt->fetchrow_array()){
print "X = $id";
}

I get an error that says I need to use "select into". How do I call this procedure from perl?

Options: ReplyQuote


Subject
Views
Written By
Posted
Calling 'Select' procedure from Perl
3258
May 12, 2005 03:16PM


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.