- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Sqlplus subshell question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
тАО04-07-2009 11:00 AM
тАО04-07-2009 11:00 AM
Sqlplus subshell question
#!/bin/bash
. $HOME/.bashrc
for i in `cat ~allanm/list`
do
(~allanm/bin/sql_db1 passwd <
select COM_1 from table_1 where COM_2=$i
EOF
)
done
Can you figure out why? and how to pass it ...
Thanks,
Allan
- Tags:
- sqlplus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 11:03 AM
тАО04-07-2009 11:03 AM
Re: Sqlplus subshell question
Do a set -x up top in that script.
I suspect $i is not being set.
My $0.02,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 11:12 AM
тАО04-07-2009 11:12 AM
Re: Sqlplus subshell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 11:33 AM
тАО04-07-2009 11:33 AM
Re: Sqlplus subshell question
Thanks,
Allan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 11:43 AM
тАО04-07-2009 11:43 AM
Re: Sqlplus subshell question
#!/bin/bash
. $HOME/.bashrc
for i in `cat ~allanm/list`
do
( export i_out=$i
~allanm/bin/sql_db1 passwd <
select COM_1 from table_1 where COM_2=$i_out
EOF
)
done
HP-Server-Literate since 1979
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 12:34 PM
тАО04-07-2009 12:34 PM
Re: Sqlplus subshell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 12:44 PM
тАО04-07-2009 12:44 PM
Re: Sqlplus subshell question
Try changing:
select COM_1 from table_1 where COM_2=$i
...to:
$(select COM_1 from table_1 where COM_2=$i)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 12:58 PM
тАО04-07-2009 12:58 PM
Re: Sqlplus subshell question
By the way, save a process and eliminate the 'cat'. Let the shell do the work of reading your input.
Instead of:
for i in `cat ~allanm/list`
...which would be better written:
for i in $(cat ~allanm/list)
...but still wastes a process, do:
for i in $(< ~allanm/list)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 02:24 PM
тАО04-07-2009 02:24 PM
Re: Sqlplus subshell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 02:57 PM
тАО04-07-2009 02:57 PM
Re: Sqlplus subshell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-07-2009 02:58 PM
тАО04-07-2009 02:58 PM