[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

PL/SQL Two statements

Posted on 2016-09-30
6
Medium Priority
?
83 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:Allen Pitts
[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:Allen Pitts
ID: 41824215
I execute the script in Oracle SQL Developer V 3.1.07
0
 

Author Comment

by:Allen Pitts
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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

656 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