This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 136836 - Allow setting the statement delimiter externally
Summary: Allow setting the statement delimiter externally
Status: NEW
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: All Windows 8
: P3 blocker (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks: 152817
  Show dependency tree
 
Reported: 2008-06-09 15:59 UTC by Roman Mostyka
Modified: 2013-08-01 12:53 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-06-09 15:59:04 UTC
1. Connect to DB.
2. Open Query Editor.
3. Write and execute following statement: "delimiter \\".
4. Write and execute following statement: "CREATE PROCEDURE p1 () SELECT * FROM t; \\".

Result: Following message appears in Output window: "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 1
Line 1, column 41".

But procedure is created and it can be used.
Comment 1 David Vancouvering 2008-06-16 22:49:50 UTC
I tried this

delimiter \\
create procedure p1() 
begin
  select * from t;
end\\

and it worked

I tried this

delimiter ??
create procedure p3 select * from t; ??

and got

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 'select * from t' at line 1
Line 2, column 1

I think it's not the delimiter but incorrect SQL syntax.
Comment 2 Roman Mostyka 2008-06-17 10:33:48 UTC
No, in your case you forgot brackets after p3.
In my case following statement work fine:
"delimiter \\
CREATE PROCEDURE p1 () SELECT * FROM t; \\".
But if I set delimiter first and then try to create procedure, in the same editor, but without string "delimiter \\",
then I get error. In other words:
1) Open SQL editor and execute statement "delimiter \\".
2) In the same editor remove everything and execute following statement:
"CREATE PROCEDURE p1 () SELECT * FROM t; \\".
And in 2) error arises. It arises because last signs are '\\' and without string "delimiter \\" in the beginning these
signs are treated as incorrect syntax.
If I set delimiter in particular SQL editor it will be good to have ability write what customer need without adding this
additional string every time.
Comment 3 David Vancouvering 2008-06-17 18:47:30 UTC
This is a feature request - to allow specifying delimiter that lasts longer than a single execution of a query editor. 
Currently you need to specify the delimiter as part of the text you are executing.

I do think this may be a problem if you want to execute a single statement - you can't because we currently don't
include the delimiter statement as part of that statement.  I'll investigate as part of beta phase.
Comment 4 Andrei Badea 2008-08-04 14:48:39 UTC
SQuirreL SQL has a field in the SQL editor where the user can set the statement delimiter. Perhaps we can do something
similar.
Comment 5 David Vancouvering 2008-08-04 17:58:51 UTC
Maybe I'm missing something but I thought we already had this - just say 'delimited XXX' and it should work 
Comment 6 Andrei Badea 2008-08-04 18:02:11 UTC
> SQuirreL SQL has a field in the SQL editor where the user can set the statement delimiter

... which both saves the user from puting a "delimiter XXX" statement in the script, and pleases Roman.
Comment 7 Jiri Rechtacek 2009-10-16 14:09:16 UTC
Reassigned to new owner.