[This topic is migrated from our old forums. The original author name has been removed]
I'm having issues with @delimiter. As a test, I made a version of the "@delimiter" example from the DbVis 7.0 manual, modified for mySQL:
DROP FUNCTION if exists dbVis_Add;
@echo 'about to change delimiter and create FUNCTION';
@delimiter ++;
CREATE FUNCTION dbVis_Add (parm1 INTEGER, parm2 INTEGER) RETURNS INTEGER DETERMINISTIC
BEGIN
SET @x='dbVis';
RETURN parm + parm2;
END;
++
@delimiter ;++
When I run this from a DbVis SQL commander window, it seems to work fine, and creates the function. However, if I put the code in a text file ("badrun_func.sql") and try and "@run" it, I have problems.
@run badrun_func.sql;
This either shows the "Parsing..." barberpole forever, or comes back with errors like the following:
17:40:54 @RUN - 0 row(s), 0.000 secs] Command processed
17:40:54 DROP - 0 row(s), 0.001 secs] Command processed. No rows were affected
Code: 1305 SQL State: HY000 --- FUNCTION dbVis_Add does not exist
17:40:54 @ECHO - 0 row(s), 0.000 secs] 'about to change delimiter and create FUNCTION'
17:40:54 @DELIMITER - 0 row(s), 0.000 secs] Command processed
17:40:54 CREATE - 0 row(s), 0.000 secs] Error Code: 1064, SQL State: 42000] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 4
17:40:54 PARM2; - 0 row(s), 0.000 secs] Error Code: 1064, SQL State: 42000] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'parm2;
END' at line 1
17:40:54 @DELIMITER - 0 row(s), 0.000 secs] Command processed
17:40:54 UNDEF - 0 row(s), 0.000 secs] Error Code: 0, SQL State: S1009] Can not issue NULL query.
... 8 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.001/0.000 sec 4 successful, 1 warnings, 3 errors]
I tried using "~" instead of "++" as the delimiter, with no better results. The code that works directly in the commander is literally cut and paste from the file I'm trying to @run, so I'm either misunderstanding things, or there is something funky about the @delimiter command when used inside a file that is being @run. I'll do some more playing around, but I'd hate to beat my head in if it is a known bug... :)
DbVis 7.0.6, mySQL 5.0.88, OSX 10.6.3 with 64-bit JAVA 1.6.0_17.
anonymous