How to Bundle SQL Scripts for Oracle

oraclescripting

I have bunch of sql-scripts used to create various tables, procedures, functions and views. Everything is in separate files; is there a good way to bundle these and run each file in a specific order? Merging/concatenating all the files into one is also a possibility, but I'd prefer a bundle if possible.

Example (fictional/pseudocode): Master.sql contains the following:

src: DDL/table1.sql
src: DDL/table2.sql
src: fns/function1.sql
src: fns/function2.sql
src: views/view1.sql

…and so on. Running Master.sql would then execute each of the scripts listed in the file in the order listed. Is something like this possible?

Best Answer

Prepend the scripts with an @ in your master.sql script:

@DDL/table1.sql
@DDL/table2.sql
@fns/function1.sql
@fns/function2.sql
@views/view1.sql