Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MySQL Create Procedure
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
MySQL Create Procedure
Miscellaneous
Thread ID:
01396861
Message ID:
01396861
Views:
110
I'm adapting Rick Strahl's wwbusiness class (which is designed for MS SQL) to work with MySQL. It uses a stored procedure that I'm having trouble duplicating in MySQL.
lcSQL=[CREATE PROCEDURE sp_ww_NewID ]+;
			[@cName char(30),]+;
			[@nRetval int OUTPUT ]+;
			[AS ]+;
			[UPDATE mytableids ]+;
			[SET id = id + 1,]+;
			[@nRetval = id + 1 ]+;
			[WHERE TableName = @cName ]
which is called via SPT with
PRIVATE pnID
pnID = 0
lcSQL="Execute sp_ww_NewId '" + lcTableName + "',?@pnID"
So my adaption to MySQL is:
lcSQL=[CREATE PROCEDURE sp_ww_NewID (cName char(30), out nRetval integer) ]+;
		[UPDATE mytableids SET id = id + 1,]+;
		[nRetval = id + 1 ]+;
		[WHERE TableName = cName ]
and then calling it via SPT with:
PRIVATE pnID
pnID = 0
lcSQL="call sp_ww_NewId('" + lcTableName + "', @pnID)"
But attempting to call the stored procedure gives the error message:
"Connectivity error: [MySQL][ODBC 5.1 Driver][mysqld-5.1.30]Unknown column 'nRetval' in 'field list' [1526:1054]"

What am I doing wrong?
Brandon Harker
Sebae Data Solutions
Next
Reply
Map
View

Click here to load this message in the networking platform