Solved

PL/SQL Two statements

Posted on 2016-09-30
6
69 Views
Last Modified: 2016-09-30
Hello expert,

I need to go to the DBA with a script to delete rows in two tables.

Wrote

DELETE FROM J3131_ACP_D_NOTE_SEGMENT
where NOTE_ID = 798105 and SEGMENT_ID in (2359467, 2359468, 2359469);

DELETE FROM J3131_ACP_D_NOTE_SEGMENT_MKT
where NOTE_ID = 798105 and SEGMENT_ID in (2359467, 2359468, 2359469);

COMMIT;

But it only executes the first statement

Have tried running the two statements in separate queries with positive
result. But when combined only the first goes.

Was told by the DB expert that the semicolon is needed after
the first statement, Is he wrong?

Thanks.

Allen in Dallas
0
Comment
Question by:9apit
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:flow01
ID: 41824209
What tool do you or your DBA use to execute the script ?
0
 

Author Comment

by:9apit
ID: 41824215
I execute the script in Oracle SQL Developer V 3.1.07
0
 

Author Comment

by:9apit
ID: 41824241
Hello flow01,

Figured it out.
I clicked the green triangle icon (Run Statement).
But I should have been clicking the icon next to the Run Statement
icon which is the Run Script (looks like a piece of paper with a green triangle).

This made both statements run.

Thanks.
0
 
LVL 20

Accepted Solution

by:
flow01 earned 500 total points
ID: 41824248
I don't  use that normally, but in Oracle pl/sql developer when  there are more statements by default only 1 is executed (where the cursor is located).
But if you select al statement and use the  'run' button, all statements are executed.

And I just tried SQL Developer  Version 4.0.3.16 and that works the same : select all statement  and run.
But it works also without selecting:
the first run symbol (ctrl-enter) runs 1 statement (if nothing is selected)
the second run symbol (f5)  runs the script.

So try if that works in your version also.
0
 
LVL 20

Expert Comment

by:flow01
ID: 41824253
You already found it.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question