Error executing a SQL script containing multi-line statements separated by the / character [message #668712] |
Fri, 06 May 2011 19:47 |
|
I am using Eclipse Helios on Windows Vista to connect to an Oracle 10i Express Edition database on another server.
example.sql
select *
from USER/
select *
from GROUP/
I opened example.sql in Eclipse. Eclipse used the SQL Scrapbook editor to open the file. The preferences for SQL Editor is set to "Execute SQLs between delimiters: [ / ]". I right-clicked on the text area, and clicked on "Execute All".
This is what I see in the "SQL Results" panel:
select *
from USER/
select *
from GROUP/
ORA-00933: SQL command not properly ended
Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms.
Now, I changed the example.sql as you see below:
select * from USER/
select * from GROUP/
No change. Same error.
Finally, I changed the example.sql as you see below:
select *
from USER;
select *
from GROUP;
Now it works.
Is there a bug related to using the "/" delimiter in Eclipse Helios?
|
|
|
Re: Error executing a SQL script containing multi-line statements separated by the / character [message #668734 is a reply to message #668712] |
Fri, 06 May 2011 21:43 |
|
I found another issue.
It looks like I cannot execute two ALTER statements successively...
example.sql
CREATE table "USER" (
"USERID" VARCHAR2(100) NOT NULL,
"PASSWORD" VARCHAR2(100) NOT NULL,
"USERNAME" VARCHAR2(200) NOT NULL,
"EMAIL" VARCHAR2(1000),
constraint "USER_PK" primary key ("USERID")
);
CREATE table "GROUP" (
"GROUPID" VARCHAR2(100) NOT NULL,
"GROUPNAME" VARCHAR2(200) NOT NULL,
"GROUPDESC" VARCHAR2(1000),
constraint "GROUP_PK" primary key ("GROUPID")
);
CREATE table "GROUP_USER" (
"GROUPID" VARCHAR2(100) NOT NULL,
"USERID" VARCHAR2(100) NOT NULL
);
alter table "GROUP_USER" add constraint "GROUP_USER_PK" primary key ("GROUPID","USERID");
ALTER TABLE "GROUP_USER" ADD CONSTRAINT "GROUP_USER_FK1"
FOREIGN KEY ("GROUPID")
REFERENCES "GROUP" ("GROUPID")
ON DELETE CASCADE;
ALTER TABLE "GROUP_USER" ADD CONSTRAINT "GROUP_USER_FK2"
FOREIGN KEY ("USERID")
REFERENCES "USER" ("USERID")
ON DELETE CASCADE;
SQL Results:
ORA-00911: invalid character
(0 rows affected)
Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms.
Now, if I highlight the first 3 CREATE statements and the 1st ALTER statement, and click on "Execute Selected Text", they execute just fine. If I highlight each ALTER statement by itself, it executes just fine, but there are way too many ALTER statements in this script to do that manually. It should just work.
Any thoughts? Has anyone else experienced this problem? Am I doing something wrong?
Cheers!
|
|
|
|
Powered by
FUDForum. Page generated in 0.04224 seconds