Output parameter problem....

Output parameter problem....

Postby mmccord » Tue 18 Jan 2005 15:23

I'm having trouble with output parameters when using mysqldirect.net in Visual Studio with VB and ASP.NET.

Here is the problem:

First of all, for some reason if you look at the property building for a mysqlcommand and look at the parameters tab. It will no longer allow you to select what direction you want the parameter to be. Which is fine because I have just been setting it programmatically. (If some one could tell me why its doing this...it would be appreciated.

The real problem is that I can never get output parameters to work correctly. When ever I make a new output parameter and set its direction and source column and then run the query. It always tells me that the parameter is missing from the commandtext. So, is there something that I am supposed to put in the command text? Please advise. Thanks!
mmccord
 

Re: Output parameter problem....

Postby Oleg » Wed 19 Jan 2005 13:06

MySql server has some problems with out parameters in stored procedures/functions.
On the server side you can use them, but clients (including our) can't get their values.
Exactly so MySqlCommand editor does not support changing of Direction property.
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56

So how...

Postby mmccord » Wed 19 Jan 2005 21:39

So how can I bring individual values out of the database? For instance, how could I bring the value of last_insert_id() function out of the database? Or how could I bring the value of a row item out after I have inserted or updated it? Are there alternatives to using output parameters?
mmccord
 

Postby leek » Thu 20 Jan 2005 14:58

Add handler for the OnRowUpdated event. Run a command such as 'SELECT LAST_INSERT_ID()' within this handler, and set the corresponding row using this value. The .NET documentation has examples in access - can be easily adapted.
leek
 
Posts: 8
Joined: Sun 16 Jan 2005 10:51

Re: So how...

Postby Oleg » Fri 21 Jan 2005 12:05

You can use SELECT ... without FROM clause. You can use several SQL statements at the same command, for example:
Code: Select all
INSERT INTO DEPT VALUES(100, 'SOME NAME','');SELECT * FROM DEPT WHERE
DEPTNO=100;
Oleg
Devart Team
 
Posts: 264
Joined: Thu 28 Oct 2004 13:56


Return to dotConnect for MySQL