Calling stored procedures

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
AlexKilpatrick

Calling stored procedures

Post by AlexKilpatrick » Sat 28 Jan 2006 03:44

I am calling a MySQL stored procedures using a MySQlCommand object with named parameters. My understanding is that this is supposed to allow me to disregard the order of the parameters in the stored procedure. However, it doesn't appear to be working that way. If I switch the order of the parameters in the stored procedure (which shouldn't affect anything) the values of the columns get switched.

Am I missing something here, or is this a problem with the library?

Serious

Post by Serious » Mon 30 Jan 2006 09:05

Retrieving stored procedure parameters information requires a roundtrip to server. Thus command parameters (in case when ParameterCheck=true and CommandType=CommandType.StoredProcedure) are updated only on Prepare() or Execute*() call.
Please follow the instructions provided in the "Using Parameters" article ("Using parameters with stored procedures in synchronization mode" paragraph) to avoid the problem.

AlexKilpatrick

Post by AlexKilpatrick » Tue 28 Feb 2006 23:55

Hi,

I have read this article, and I am setting ParameterCheck = true. I don't call Prepare() because I am using a stored procedure. But the order of arguments still seems messed up. It is dependent upon which order I add the parameters to the command object.

I am essentially building a database builder, so I can't know the order that the parameters will be added to the command object. I need to be able to set the paramters by name, independent of the order.

Thanks for your help.

Serious

Post by Serious » Wed 01 Mar 2006 10:52

We have fixed this problem for the MySQLDirect .NET.
Look forward for the next build.

Post Reply