Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run SQL*Plus Script That Runs Other Script files

Ok, so I read this but I don't think the answer matches the question. I believe the OP is asking how to create a SQLPlus script that runs other SQLPlus scripts but the chosen answer reveals how to run a SQL script in SQL*Plus.

I would like to know how to create a SQLPlus script that, when run, executes other SQLPlus scripts within the same directory.

like image 989
Mushy Avatar asked Jun 09 '14 11:06

Mushy


1 Answers

The given answer is correct. Create a directory with two files: control.sql second.sql

make control.sql contain:

set serveroutput on

prompt "Start of control"
/

@second.sql
/

prompt "End of control"
/

make second.sql contain:

prompt "Start of Second"
/

prompt "End of Second"
/

Then run control.sql

like image 136
Robert3452 Avatar answered Sep 18 '22 21:09

Robert3452