Database Administration (MOSC)

MOSC Banner

Issue passing multiple parameters to a sql sript

edited Apr 29, 2013 8:17AM in Database Administration (MOSC) 6 commentsAnswered ✓
Below is my sql script. The script takes user2 and scripts the privileges to be assigned to user1 (that would mirror those of user2), so i need to pass 2 parameters to my script, the username for user1 and username for user2.

When I run my script I am prompted for each parameter every time it comes up in the script. My question is how can I ensure that I am only prompted once for each parameter?

Also the output includes some unnecessary details in the file I spool to, such as:

Enter value for 1: USER1

old   1: select 'grant ' || PRIVILEGE || ' on ' || owner || '.' || TABLE_NAME || ' to ' || &1 || decode(GRANTABLE,'YES',' with grant option;','NO',';') from

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center