hi,
first of all, great improvements in RC4 :D
my problem: i want to create a stored procedure like in:
-----------------------------------------------
USE ...;
DROP TABLE IF EXISTS foo;
CREATE TEMPORARY TABLE IF NOT EXISTS foo (...);
DROP PROCEDURE IF EXISTS bar;
DELIMITER '/';
CREATE PROCEDURE bar (...)
BEGIN
...
END/
DELIMITER ';'/
CALL bar(...);
SELECT * FROM foo;
-----------------------------------------------
but when executed then an error message concerning the syntax of "delimiter" pops up. is there a chance that delimiter will be supported? i know that someone asked about this in january 2007, but there was no answer to his or her post ...
delimiter support?
it's needed to define stored procedures:
DELIMITER '/';
CREATE PROCEDURE bar (...)
BEGIN
DO CLEVER STUFF;
DO MORE CLEVER STUFF
DO EVEN MORE CLEVER STUFF;
END/
DELIMITER ';'/
if there was no way to change the delimiter then the CREATE PROCEDURE command would be ended after the first ';' (and the execution would break with syntax error).
by changing the delimiter one is able to use the ';' as delimiter inside the procedure definition and at the same time end the CREATE PROCEDURE command with the previously set delimiter '/' (END/). after the procedure definition the delimiter is changed back to ';' so the stored procedure can be executed.
sadly there is no way to 'box' the BEGIN ... END block (like for example with '[]', '""' or '{}').
DELIMITER '/';
CREATE PROCEDURE bar (...)
BEGIN
DO CLEVER STUFF;
DO MORE CLEVER STUFF
DO EVEN MORE CLEVER STUFF;
END/
DELIMITER ';'/
if there was no way to change the delimiter then the CREATE PROCEDURE command would be ended after the first ';' (and the execution would break with syntax error).
by changing the delimiter one is able to use the ';' as delimiter inside the procedure definition and at the same time end the CREATE PROCEDURE command with the previously set delimiter '/' (END/). after the procedure definition the delimiter is changed back to ';' so the stored procedure can be executed.
sadly there is no way to 'box' the BEGIN ... END block (like for example with '[]', '""' or '{}').
ah: Revision 674 has a button which switches the default delimiter to // instead of ; so you can use that whithin these statements.
http://svn.sourceforge.net/heidisql/?rev=674&view=rev
http://svn.sourceforge.net/heidisql/?rev=674&view=rev
Please login to leave a reply, or register at first.