1

I am trying to run multiple select SQL statements in TOAD using Execute command and not as execute as a script, Each statement ending with a semicolon but unfortunately TOAD is not allowing me to do this.

Tried running as a single block by using begin and end but that attempt also failed.

Is there any way to achive this..

Siva
  • 9,043
  • 12
  • 40
  • 63
  • Why don't you want to execute as a script if you have multiple statements to run together? That's what it's for. And how/why did running them in a block fail - are you doing DDL or just DML? You only mention selects; where should the results of those go? Maybe you're trying to get all the results in a single data grid? – Alex Poole Feb 29 '16 at 12:56

1 Answers1

1

you can run it as a script in Toad:

exec dbms_output.put_line('aaa');
exec dbms_output.put_line('bbb');

or use the following anonymous PL/SQL block and execute it as a statement:

begin
    dbms_output.put_line('aaa');
    dbms_output.put_line('bbb');
end;
/
MaxU - stand with Ukraine
  • 205,989
  • 36
  • 386
  • 419
  • The first part of this answer and Alex's comment is the way to go. Run as a script, F5. If the statements are SELECT's you'll get a grid for each this way, but don't include them in a block, just have them exist as standalone statements. Note that you can run out of memory if your result sets are large. You can also run each statement in its own Editor tab using F9 if the second statement is not dependent on the first. – Michael S. Feb 29 '16 at 15:44