Skip to main content



      Home
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 12:43 Go to next message
Eclipse UserFriend
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 #640717 is a reply to message #640238] Mon, 22 November 2010 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Is there an executeBatch option you can use instead. That allows you to
add lots of individual statements and run them in one go.
Re: Semicolon problem on multiple inserts [message #640724 is a reply to message #640717] Mon, 22 November 2010 17:09 Go to previous message
Eclipse UserFriend
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.
Previous Topic:Where are "vendor filter" in Driver Definition (in Helios) ?
Next Topic:How to create a database object by code
Goto Forum:
  


Current Time: Thu Jul 03 11:04:27 EDT 2025

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

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

Back to the top