RE: can't return a result set in the given context

"Wechsler, Steven" <[email protected]> Tue, 1 Apr 2008 09:42:21 -0400
Newsgroups gmane.comp.db.mysql.perl
Message-ID <9BFA664319211B4780C5F8A4FB060FF50121A3D2@LAZYTOWN.mtvn.ad.viacom.com>
It's a simple stored proc that returns two result sets (but the script doing the calling needs to be able to handle any stored proc, since it's not aware of what it's calling).

The stored proc call is a simple 

> call storedproc;

The context is just a simple execute command, which is where it gets the error (i.e. it doesn't actually execute the stored procedure):

$rc = $sth->execute();

As far as the syb_err_handler is concerned, it can handle Sybase, SQL Server and MySQL. The name is a legacy, because the script was originally written for Sybase.

Thanks,

Steve



Steve Wechsler | [email protected]
Sybase/SQL Server/MySQL Database Administrator
212-846-5683

MTV Networks


-----Original Message-----
From: Selke, Gisbert W. [mailto:[email protected]] 
Sent: Tuesday, April 01, 2008 8:03 AM
To: Wechsler, Steven
Cc: [email protected]
Subject: AW: can't return a result set in the given context

> -----Ursprüngliche Nachricht-----
> Von: Wechsler, Steven [mailto:[email protected]]
> Gesendet: Montag, 31. März 2008 23:14
> I get the above error whenever I try to call a stored procedure using
> DBI with DBD::MySQL. The exact message is:
> 
> DBD::mysql::st execute failed: PROCEDURE <procname> can't return a
> result set in the given context at /dba/steve/scripts/run_sql.pl line
> 517, <FILE> line 2.
> 
> Here is the connect string:
> 
> $dsn =
> DBI:mysql:database=<dbname>;host=<hostname>;port=3316;mysql_mu
> lti_result
> s=1
> DBI->connect($dsn, $login, $password,
>                                {PrintError => 1, AutoCommit => 1,
>                                 syb_err_handler => 
> \&message_handler } )
> 
> 
> DBD::mysql version is 3.0007
It may be hard to tell for anyone not knowing the stored procedure that you
try to call, and not knowing the "given context" that is, in fact, not
given.
On a side note, are you sure you want a syb_err_handler for a MySQL
connection?

\Gisbert

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]