Jeevan
Jeevan

Reputation: 457

Multiple insert into in SQL Developer worksheet

I just installed SQL Developer 4 and I'm using Oracle Database 11g. I want to execute multiple insert into statements in the worksheet at once. That works fine if I copy paste via command line of SQL but in Develop 4, only one row is being inserted at a time. Is there any way to fix this? I don't want to type line by line and also don't want directly enter via data tab though the textboxes. I want be able to execute the following in one single worksheet. Please help

INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00001','ivan bayross','bombay',400054,'maharashtra',15000);
INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00002','vandana saitwal','madras',780001,'tamil nadu',0);
INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00003','pramada jaguste','bombay',400057,'maharashtra',5000);
INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00004','basu navindgi','bombay',400056,'maharashtra',0);
INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00005','ravi sreedharan','delhi',100001,'delhi',2000);
INSERT INTO client_master(client_no,name,city,pincode,state,bal_due) VALUES ('c00006','rukmini','bombay',400057,'maharashtra',0);

Upvotes: 1

Views: 12501

Answers (2)

avalon07
avalon07

Reputation: 13

After all of the insert statements are in the "Query" Builder window, you can "hilight" (Control A) and then hit "Control" and "Enter" at the same time.

Upvotes: 1

Alex Poole
Alex Poole

Reputation: 191570

From the documentation (3.2 since 4 is still beta):

SQL Worksheet toolbar (under the Worksheet tab): Contains icons for the following operations:

Execute Statement executes the statement at the mouse pointer in the Enter SQL Statement box. The SQL statements can include bind variables and substitution variables of type VARCHAR2 (although in most cases, VARCHAR2 is automatically converted internally to NUMBER if necessary); a pop-up box is displayed for entering variable values.

Run Script executes all statements in the Enter SQL Statement box using the Script Runner. The SQL statements can include substitution variables (but not bind variables) of type VARCHAR2 (although in most cases, VARCHAR2 is automatically converted internally to NUMBER if necessary); a pop-up box is displayed for entering substitution variable values.

To run multiple statements together you need to Run Script, either from the toolbar icon or by pressing F5.

Upvotes: 4

Related Questions