Qasim0787
Qasim0787

Reputation: 301

How to execute oracle query that was saved in a .txt file

I have too long oracle query that I saved in .txt file. and I am using Toad to execute that..

some it is too difficult to open such large code file and execute the code.. Is there any query that I can execute and give path to file that execute the code placed in that file.

For example something like that:

 Execute code C:/My Code/code1.txt;

Upvotes: 0

Views: 4163

Answers (1)

aturegano
aturegano

Reputation: 1036

If you have a TOAD locally installed, you can use

@C:/My Code/code1.txt

This works from an editor tab in Toad 12.10.0.30 with the slashes going either direction and pressing F5 or "execute as script". The file can end in .txt or .sql but it is better to use .sql extension as it represents what the file contains.

It also works when using other programs such as sqlplus or sqlDeveloper

Upvotes: 1

Related Questions