0

We have multiple .sql files and is there any way we can run them in single job ?

Sample files.

 @task1.sql ; 
 @task2.sql ; 
 @task3.sql ; 

Is there any way can I put all 3 above files in single files and run?

1 Answer 1

1

Well ... yes.

task_main.sql:

@task1.sql
@task2.sql

task1.sql:

select deptno, ename, job, sal
from emp
where deptno = 10;

task2.sql:

select * from dept;

Running task_main from SQL*Plus:

SQL> @task_main

    DEPTNO ENAME      JOB              SAL
---------- ---------- --------- ----------
        10 CLARK      MANAGER         2450
        10 KING       PRESIDENT       5000
        10 MILLER     CLERK           1300


    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.