perl mysql procedures

S

Shiraz

I am trying to call procedures within perl that have a statement
"select 'result' ". i have confirmed that the function works in mysql
but errors out in perl.
I found a bug fix on CPAN (http://rt.cpan.org/NoAuth/Bug.html?id=12322)
but that is for DBD-mysql-2.9006 and i have DBD::mysql -- 2.9007. Can
anyone suggest what i should do?

My installation details:
perl, v5.8.0 built for i386-linux-thread-multi
DBD::mysql -- 2.9007
DBI -- 1.48

Script:
$SQL_Text = "call procedure()" ;
$sth=$dbh->prepare($SQL_Text);
$sth->execute();
while ( ($tt) = $sth->fetchrow_array( ) ) { print $tt; }
 
M

Mihail

Shiraz said:
I am trying to call procedures within perl that have a statement
"select 'result' ". i have confirmed that the function works in mysql
but errors out in perl.
I found a bug fix on CPAN (http://rt.cpan.org/NoAuth/Bug.html?id=12322)
but that is for DBD-mysql-2.9006 and i have DBD::mysql -- 2.9007. Can
anyone suggest what i should do?

My installation details:
perl, v5.8.0 built for i386-linux-thread-multi
DBD::mysql -- 2.9007
DBI -- 1.48

Script:
$SQL_Text = "call procedure()" ;
$sth=$dbh->prepare($SQL_Text);
$sth->execute();
while ( ($tt) = $sth->fetchrow_array( ) ) { print $tt; }

May be:
 
P

Paul Lalli

Shiraz said:
I am trying to call procedures within perl that have a statement
"select 'result' ". i have confirmed that the function works in mysql
but errors out in perl.

"errors out" is not helpful. What is the error message? Copy and
paste the exact error message you receive. With what you said, I don't
even know if you're getting a Perl error or a MySQL error.

Have you read the Posting Guidelines for this group?
I found a bug fix on CPAN (http://rt.cpan.org/NoAuth/Bug.html?id=12322)
but that is for DBD-mysql-2.9006 and i have DBD::mysql -- 2.9007. Can
anyone suggest what i should do?

No, because you haven't told us what's going wrong.
My installation details:
perl, v5.8.0 built for i386-linux-thread-multi
DBD::mysql -- 2.9007
DBI -- 1.48

Script:
$SQL_Text = "call procedure()" ;
$sth=$dbh->prepare($SQL_Text);
$sth->execute();
while ( ($tt) = $sth->fetchrow_array( ) ) { print $tt; }

Do you have RaiseError turned on? If not, you should be checking those
prepare() and execute() statements for errors.

Paul Lalli
 
P

Paul Lalli

Mihail said:

What problem do you think that would solve? The OP is selecting one
column, and calling fetchrow_array() in a list context, assigning to a
one-element list. Your two alternatives are simply two other
statements that will do the same thing as the OP's code.

Paul Lalli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top