0

can you please point me a guide line for the following situation.

  1. I will create a user/schema, a tablespace for that schema.
  2. Then will create sequence [I have script in a separate sql file]
  3. Then will create table and triggers [I have script in a separate sql file]
  4. Then will create Type [I have script in a separate sql file]
  5. Then will create Function [I have script in a separate sql file]
  6. Then will create Views [I have script in a separate sql file]
  7. Then will create StoredProcedures [I have script in a separate sql file]
  8. and may be packages.
  9. I also will have insert statement for all the tables above [separate script]

I have taken the scripts for all of the items above except user/schema and Tablespace.

What now I want is, I will have a MasterScript file, where I will mention my user/schema name and table space and all the script file above.

If I ran the MasterScript file that will handle/execute all the other script file from sql command prompt.

Can someone point me how can I achieve that?

1 Answer 1

1

You can embed the calls to the individual SQL files into your master SQL file, preserving the order in which they should be executed (DDLs follwed by DMLs, taking care of constraints and referential intergrities, if any)

You master script (let's call it master.sql for sake of brevity) will contain entries like:

@{Path}/create_sequences.sql

@{Path}/create_tables.sql

and so on, for all the scripts which you have created so far. You jsut have to call the script which you want to execute by appending @ to the script path

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

2 Comments

Yes, the way I thought, so after connecting to Oracle, I will execute the MasterScript.sql file like @MasterScript.sql, that will resolve my issue, right??
Yes, it will. Give it a try

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.