More details would be useful here including :
- do you need to populate the schema name in the package body ?
- will this script be run in interactive mode ?
- which OS ?
Main Topics
Browse All Topics
I want to pass the database schema name to my script that creates a package, how can I do this...?
Thanks Ian
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You can use
ACCEPT schema_name PROMPT 'Schema Name: '
To have the script prompt you for the schema name.
Then you can use this within your script as necessary with the & operator in scripts.
For instance
EXECUTE A_PROC(&Schema_name);
or, within DDL in the script
CREATE OR REPLACE PROCEDURE &schema_name..NEW_PROC AS
Note that if you want the script to have a . (period) after the use of the &varname, you need to use two ..
This is so that you can use the variable name embedded in other names. So, you could do something like:
CREATE OR REPLACE PROCEDURE another_shema.&schema_name
if you had entered XXX as the schema_name at the Accept statement, then this would become
CREATE OR REPLACE PROCEDURE another_shema.XXX_Myproc as
You can still use the & operator without the accept, but the script will prompt you each time the variable substitution is found. Accept also allows you to specify the prompt. If you don't use accept varname prompt 'xxxxxx', then it just prompts for the variable value by name.
Business Accounts
Answer for Membership
by: ISCPosted on 2006-02-28 at 02:53:21ID: 16063761
I should have added that all the procedure are then created under the schema name passsed in...
Thanks Ian