Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Operating System Environment Variables in SQLPLUS

425344Jul 14 2004 — edited Nov 28 2005
I'm looking for a way to use the Operating System Environment Variables inside of a sql script. I'd like to create a generic script that will run on all machines regardless of directory structure. I know that in SQLPLUS I can call on Operating System commands using ! followed by the Operating System command. But I'd like to use a SQL command using a Operating System variable. Example:

spool $ORACLE_BASE/assistants/dbca/logs/CreateDB.log
startup nomount pfile="$ORACLE_BASE/admin/orc3/pfile/init.ora";

If this is not possible to do can I set SQLPLUS variables to match the operating system variables through scripting some way?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2005
Added on Jul 14 2004
12 comments
12,344 views