----- Original Message ----- From: "Tripp Bishop" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Monday, December 19, 2005 3:45 PM
Subject: Re: Declare Cursor Question


Howdy all,

I've got a question about declaring cursors. In
particular is there a way to allow the select
statement used to populate the cursor be variable?
I've tried a couple of the obvious approaches with no
luck. Failing that, is there a way to have a cursor be
an input parameter to a stored procedure? Seems like
the answer is "no" but I had to ask.

You haven't specified which version of MySQL you are using. If you are on Version 4.1.3 or above, you can use SQL Prepared Statements: see http://dev.mysql.com/doc/refman/4.1/en/sqlps.html, especially the example. This should give you the effect you want.

If you are on an earlier version of MySQL and don't mind doing some C programming, a C API with similar functionality was created in an earlier version, although I'm not sure which one. See http://dev.mysql.com/doc/refman/4.1/en/c-api-prepared-statement-function-overview.html for more information.

Rhino


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to