-
Is any way to pass the UNIX environmental variables to SQL*Plus script?
I am using Oracle 8.0.6 on HP, and have defined the environmental variable $BANK.
I want to use this variable in SQL*Plus script and later pass it into stored procedure.
Or can I just pass the environmental variable to stored procedure?
Kazik
-
Hi,
you can create a script file that will deine a UNIX env parameter and call for it in the sql block :
---------------- CUT HERE ----------------------------
#!/bin/csh -fb
set param ="3"
sqlplus system/manager@orcl << EOF | tee /tmp/$$TMP_FILE
select some_value from some_table where some_param = $param
EOF
---------------- CUT HERE ----------------------------
** If you are selecting from v$ views you should use v\$:
select * from v\$session;
because the OS will think it is a UNIX variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|