On Fri, Aug 24, 2007 at 12:15:24AM +0100, Enrico Zini wrote:
> Here is another report about stored procedures. 

> The attached code should run a simple stored procedure with an input and
> an output parameter, but instead it fails with this error message:

>   Connecting
>   Creating procedure
>   Error 1304 HY000: [MySQL][ODBC 3.51 
> Driver][mysqld-5.0.45-Debian_1-log]PROCEDURE testfunc already exists

As discussed on IRC, the above is a misquoted error; the actual error
message is:

Error 1414 HY000: [MySQL][ODBC 3.51 Driver][mysqld-5.0.41-Debian_1-log]OUT or 
INOUT argument 2 for routine test.testfunc is not a variable or NEW 
pseudo-variable in BEFORE trigger

The problem is that, as discussed in the upstream documentation at
<http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statements.html>,
MySQL 5.0 does not support the use of CALL in prepared statements, and by
virtue of the use of ? parameters in the statement this is a prepared
statement in spite of calling SQLExecDirect rather than SQLPrepare.

So I'm afraid this is not a bug in MyODBC, it's a limitation of the server.

(The last follow-up to this bug report shows a successful use of "call" with
parameters; but this is a case where only an input parameter is needed, so
it's reasonable that this might work where an inout or out parameter would
not.)

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
[EMAIL PROTECTED]                                   http://www.debian.org/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to