30

While entering a SQL statement in Oracle SQL Developer, I noticed that I have two choices. I can either "Run Statement" or "Run Script". A similar choice seems to be available in SQL Maestro as well, although named "Execute query" and "Execute as script".

What exactly is the difference between the two?

2 Answers 2

31

Run Statement will give you a list of all the results in a sortable table. It will also only run the statement under the cursor (or highlighted). You will be prompted for bind variables when you run the statement (any place holder with : in front of it).

E.g.

select * from customers where customer_id = :id

will prompt for a value for id

Run Script will execute all statements in the worksheet, and give a text readout of the results. It will not prompt you for the values of bind variables.

Sign up to request clarification or add additional context in comments.

2 Comments

It looks like they changed the terminology at some point: in SQL Developer 4.0.2.15, there's "Run Statement" and "Run Script", but no "Execute".
I have noticed also that if a single select statement is run as a script, the output is paginated. Not in my view, a terrible useful behavior, but perhaps so to others. To me it is just confusing.
1

I think "Execute Statement" - mean if you want to get results (resultset) "Run Script" - is something you need to execute but don't need a results, like installing database dump, or upgrade script to add columns to the table etc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.