2
votes

I am having a great deal of trouble porting some stored procedures to regular MySQL statements.

We have stuff like this example

http://dev.mysql.com/doc/refman/5.0/en/stored-programs-defining.html

BEGIN SET @x = 0; REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT; END

Where many statements are executed. Several If statements and variable declarations, the whole 9 yards. But for some reason I can't just copy and paste the logic of the stored procedure into MySQL's query browser and execute it nor will it execute in a query execution via a C# program

I tried porting these queries via parameterized queries in C# but I still get a "check the manual error" every time =O

I really need help i can't find an answer anywhere on the internet. Am I completely screwed trying to get sequential execution without stored procedures?

Is the only way to do this to port the logic to the actual program? (I really don't want to do this)

1
Are you sure the stored porc you are converting actually works? - HLGEM
If you have a working stored proc that does what you need. Why are you trying to convert it? - HLGEM
in order to handle errors with instead of having a query fail silently in the night or doing it in the procedure. As far as I know this is the best solution. - Brian Rosamilia
Yes the stored procedure works. That was my intial idea of why it wasn't working also. - Brian Rosamilia

1 Answers

1
votes

Edit: I have reading comprehension issues. This link says that the looping constructs only work within stored programs, so you are out of luck I think.