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!

how to execute all script files of directory in sql*plus

prakashOct 6 2011 — edited Oct 6 2011
Hi all,
 Version details are as follows


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE    11.1.0.7.0      Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
I have four script files in C:\Temp directory . script file names are as fallows .
MY_DCR_HIP_001.sql
MY_DCR_HIP_002.sql
MY_DCR_HIP_003.sql
MY_DCR_HIP_004.sql


I am using the following script which will execute only one script at a time .
 SPOOL C:\Temp\MY_DCR_HIP_001.log rep

SHOW user;

SET echo on;

SET define off;

SET serveroutput on size 400000;

SELECT TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS') start_time
  FROM DUAL;

@ C:\Temp\MY_DCR_HIP_001.SQL;

SELECT TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS') end_time
  FROM DUAL;

SPOOL off;

PAUSE;

PAUSE;
 Now my requirement is to  execute all these script files in one sort .
Any help in this regards would be appreciated .


-----------------------------------------------------------------------------------------------------------------------------------------

Thanks,
P Prakash
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2011
Added on Oct 6 2011
7 comments
2,389 views