Martin Fedy Fedorko
Martin Fedy Fedorko

Reputation: 333

Run different pl/sql scripts from one file

I have several PL/SQL scripts that are transforming data accoriding to specification day by day. I would like to run them in the loop for each day of the year. Is this possible to handle somehow in Toad?

I have found that I can run some other scripts by calling them via @name_of_script , but it doesn't work for me in Toad.

I just need something like:

BEGIN
FOR i IN day1 TO dayx
  EXECUTE SQL1;
  EXECUTE SQL2;
  EXECUTE SQL3;
END LOOP;
END

Is there any way how to run these scripts somehow "managed" except to change them to procedures? Thank you for answer.

Upvotes: 0

Views: 842

Answers (1)

Sayan Malakshinov
Sayan Malakshinov

Reputation: 8655

@ is an SQLPlus command

But toad partially supports it too: there are 2 common options:

  1. Use SQL Editor - it should execute scripts in case of @ command as in SQL*Plus
  2. Use "Execute as script" --> "Execute via SQL plus": it should start SQL*plus connected to your database, there you can run your scripts.

Upvotes: 1

Related Questions