Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PL/SQL Developer: Multiple statements?

I have a script that generates a text file containing several SQL UPDATE statements:

UPDATE TableX SET Field1 = 'New value 1' WHERE Field2='1';
UPDATE TableX SET Field1 = 'New value 2' WHERE Field2='2';
UPDATE TableX SET Field1 = 'New value 3' WHERE Field2='3';
etc.

When I paste the above block of text into an SQL Window in PL/SQL Developer, it tells me that the semicolon is an invalid character. When I remove it, it informs me that my first statement was not terminated properly.

How do I run these statements in a single execution?

like image 970
IVR Avenger Avatar asked Aug 02 '11 22:08

IVR Avenger


2 Answers

I also faced this error. You need to go to tools->preferences. In window types go to SQL window and select "Auto select statement". This should remove the error.

like image 94
Priyanka Avatar answered Sep 21 '22 06:09

Priyanka


try this way;

UPDATE TableX SET Field1 = 'New value 1' WHERE Field2='1'
/
UPDATE TableX SET Field1 = 'New value 2' WHERE Field2='2'
/
UPDATE TableX SET Field1 = 'New value 3' WHERE Field2='3'
/
like image 41
dursun Avatar answered Sep 20 '22 06:09

dursun