Solved

PL/SQL Two statements

Posted on 2016-09-30
6
49 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
Comment Utility
What tool do you or your DBA use to execute the script ?
0
 

Author Comment

by:9apit
Comment Utility
I execute the script in Oracle SQL Developer V 3.1.07
0
 

Author Comment

by:9apit
Comment Utility
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
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now