- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Can operating system variables be used in spoo...
Operating System - HP-UX
1752569
Members
5213
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:29 AM
тАО01-21-2004 03:29 AM
Can operating system variables be used in spool file naming within SQL?
Hi.
This is related to my earlier request for sysdate values in spool file names. Can an operating system variable be used for the location of a spool file within sql.
e.g export SCRDIR=/usr/app/oracle
sql> spool $SCRDIR/spoolfile_name
output file should be in /usr/app/oracle/spoolfile_name
Thanks once again
Dave
This is related to my earlier request for sysdate values in spool file names. Can an operating system variable be used for the location of a spool file within sql.
e.g export SCRDIR=/usr/app/oracle
sql> spool $SCRDIR/spoolfile_name
output file should be in /usr/app/oracle/spoolfile_name
Thanks once again
Dave
why do i do this to myself
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:39 AM
тАО01-21-2004 03:39 AM
Re: Can operating system variables be used in spool file naming within SQL?
You could try to do this by redirection on the command line
eg:
NAME=Chris
sql $DATABASE < EOF
select * from address where name = '$NAME'
EOF
I know that this works for an Ingres database, so I'd expect that Oracle can cope with it too.
eg:
NAME=Chris
sql $DATABASE < EOF
select * from address where name = '$NAME'
EOF
I know that this works for an Ingres database, so I'd expect that Oracle can cope with it too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 04:18 AM
тАО01-21-2004 04:18 AM
Re: Can operating system variables be used in spool file naming within SQL?
echo spoolfilename | sql / @
and in
accept v_spoolfilename
spool &v_spoolfilename
...
sql code
...
spool off
Regards
Jean-Luc
and in
accept v_spoolfilename
spool &v_spoolfilename
...
sql code
...
spool off
Regards
Jean-Luc
fiat lux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 12:53 PM
тАО01-21-2004 12:53 PM
Re: Can operating system variables be used in spool file naming within SQL?
export CRUSER=brian
export PASS=crabtree
sqlplus user/pass <> $ORACLE_SID.log
create user \$CRUSER identified by \$PASS;
grant user connect to \$CRUSER;
exit;
!
This really only works inside of a shell script. Otherwise, you can pass the variables in the command line, and access them with &1 and &2.
Thanks,
Brian
export PASS=crabtree
sqlplus user/pass <> $ORACLE_SID.log
create user \$CRUSER identified by \$PASS;
grant user connect to \$CRUSER;
exit;
!
This really only works inside of a shell script. Otherwise, you can pass the variables in the command line, and access them with &1 and &2.
Thanks,
Brian
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP