Solved

PL/SQL Two statements

Posted on 2016-09-30
6
71 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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…
Via a live example, show how to take different types of Oracle backups using RMAN.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

756 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