Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Error executing a SQL script containing multi-line statements separated by the / character
Error executing a SQL script containing multi-line statements separated by the / character [message #668712] Fri, 06 May 2011 19:47 Go to next message
Stephen Wick is currently offline Stephen WickFriend
Messages: 9
Registered: April 2011
Location: Kansas City, Missouri, US...
Junior Member
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 Go to previous messageGo to next message
Stephen Wick is currently offline Stephen WickFriend
Messages: 9
Registered: April 2011
Location: Kansas City, Missouri, US...
Junior Member
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!
Re: Error executing a SQL script containing multi-line statements separated by the / character [message #763309 is a reply to message #668734] Fri, 09 December 2011 14:46 Go to previous message
aikicricri is currently offline aikicricriFriend
Messages: 1
Registered: December 2011
Junior Member
Use the "go" delimiter between statements. you should be just fine.

select * from table1
go

select * from table2
go



Previous Topic:Test Connection Not Responding -- SQL Server DB
Next Topic:SQL Server Connection Problems
Goto Forum:
  


Current Time: Mon Nov 24 21:46:06 GMT 2014

Powered by FUDForum. Page generated in 0.01865 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software