Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle proc to execute script from file and write to output file

bhaskar_subbiahOct 21 2016 — edited Oct 24 2016

Hi All,

This is the first question that i am posting here. I looked solution for a task but i did not get exact reply.This is an test queries automation task given to me. Kindly please help.

My requirement is,

1. A oracle code that will execute all the sql scripts(test queries) in a text file placed inside a folder.

2. After executing the scripts, it should dump the result to a flat file. If my query returns NO result it will print in file as 'PASS.

3. If the script returns any result it should print in output file as 'FAIL' with the records returned by the script.

4.In the source script i have parameter variable star date and end date.So when the oracle procedure starts running it should ask for start date and end date to enter.

I tried and got few clues but unable to incorporate all functionalities in single oracle procedure. I tried this with java but getting error in production.Since oracle runs directly in toad it will create any issue.

I really please to help me with this. If any further info needed please let me know.

Warm Regards

Bhaskar.S

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2016
Added on Oct 21 2016
10 comments
905 views