Create Procedure gives SQL syntax errors whatever I do

  • Thread starter Thread starter Gert
  • Start date Start date
G

Gert

cmd.Connection = conn

cmd.CommandText = "CREATE PROCEDURE gert (OUT param1 INT) BEGIN SELECT *
FROM tabel1; END"

cmd.ExecuteScalar()



Please help, whatever sql statement I use I allways get this error

Error 1064 #42000You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'PROCEDURE gert (OUT param1 INT) BEGIN SELECT * FROM tabel1; END' at line 1
 
Gert,

I hate SQL therefore I don't know if this is a SQL error. However if I do
this I use ad least.

cmd.ExecuteNonQuery;

cmd.ExecuteScalar is to retrieve the first value from a select statement.

I hope this helps,

Cor
 
Hi Gert,

Besides Core's advice, did you try executing this statement in some sort of
mysql utility to see if it is correct?
 
Ì used cmd.ExecuteNonQuery first, but in different samples on the internet I
so the otherone. Tried the difference with no luck.

The statement should be correct. I can execute it in mysql-front.
 
Seems like there are no stored procedures in mysql 4. (there is a 5.0 in
beta).

How to pass variables to the update command without stored procedures and
there parameters?
 
MySql 4.x.x. doesnt support stored procedures.
Version >= 5 does.

P.S. Versions < 5 are crap :)
 
Back
Top