Home » Eclipse Projects » DTP » Semicolon problem on multiple inserts(Semicolon problem on multiple inserts)
Semicolon problem on multiple inserts [message #640238] |
Fri, 19 November 2010 17:43 |
Ken Messages: 3 Registered: November 2010 |
Junior Member |
|
|
I'm running Eclipse Helios with Data Tools 1.8.1. Windows XP. I created a Derby DB (embedded driver). When I put multiple 'Insert' statements in DDL, select them, click 'Execute Selected Text', I get a syntax on the first semicolon. For example: 'Syntax error: Encountered ";" at line 9, column 1.' If I select and run them separately, no error. Also, multiple other types of statements (separated with semicolons) run fine with no error - just seems to be happening on inserts. Looks like the parser is passing the semicolon to the DB instead of splitting the insert statements maybe???
Example is below. I can run these individually, but if I select and run together I get the syntax.
insert into TABLE1
(G_TIME_IND, DESCRIPTION)
values
('M','Morning'),
('A','Afternoon'),
('E','Evening'),
('L','Late','B'),
('B','Both','T')
;
INSERT IGNORE INTO GTEST
(G_ID, G_NAME)
VALUES
(1, '100608'),
(2, '100719'),
(3, '100719'),
(4, '100722'),
(5, '101104')
;
|
|
| |
Re: Semicolon problem on multiple inserts [message #640724 is a reply to message #640717] |
Mon, 22 November 2010 22:09 |
Ken Messages: 3 Registered: November 2010 |
Junior Member |
|
|
There's no executeBatch option that I see. Just: 'Execute All', 'Execute Selected Text', and 'Execute Selected Text as One Statement'. 'Execute All' tries to run the whole file regardless of what is selected, which is not what I need. Both of the other two options give me the same error which I initially posted. As I said in my post, this works fine for everything except multiple 'insert' statements. I can do multiple drops, creates, etc. all separated with semicolons and they all work fine. If I have more than 1 insert, however, that fails with this syntax error. If I then highlight the inserts individually and run them one at a time, they work fine.
|
|
|
Goto Forum:
Current Time: Wed Apr 24 16:45:31 GMT 2024
Powered by FUDForum. Page generated in 0.03356 seconds
|