- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to return varchar from a an oracle functio...
Operating System - HP-UX
1752805
Members
5570
Online
108789
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
тАО03-26-2004 05:14 AM
тАО03-26-2004 05:14 AM
How to return varchar from a an oracle function to Korn Shell
All,
I need to return some varchar values from Oracle to Shell and then pass that as a parameter to shell script. I can do it by spooling the output in a file,Is there any other better way of doing it. I also need to do some inserts into oracle taking the shell parameters. How can I do it. Can someone send me a sample code for it.
Thanks in advance.
Suman
I need to return some varchar values from Oracle to Shell and then pass that as a parameter to shell script. I can do it by spooling the output in a file,Is there any other better way of doing it. I also need to do some inserts into oracle taking the shell parameters. How can I do it. Can someone send me a sample code for it.
Thanks in advance.
Suman
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2004 05:35 AM
тАО03-26-2004 05:35 AM
Re: How to return varchar from a an oracle function to Korn Shell
Just make sqlplus report as little as possible using glogin.sql or explicit instructions in the sql script to execute.
Then run is silently ( -s ) and act on teh output for example with a simple foreach or perhaps a read.
foreach name (`sqlplus -s "/ as sysdba" < test.sql`)
? echo test $name test
? end
test SYS test
test SYSTEM test
:
and feeding them back into an other sql task:
foreach name (`sqlplus -s "/ as sysdba" < test.sql`)
? echo "\ntest\n" $name
? echo "select * from dba_users where username = '$name'" | sqlplus -s "/ as sysdba"
? end
:
The script used for this was:
set heading off
set feedback off
select username from dba_users;
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2004 06:53 PM
тАО03-26-2004 06:53 PM
Re: How to return varchar from a an oracle function to Korn Shell
I think you already have a good answer above, but thought I'd add another one.
Just turn 'spool' on in sql.
Run your query
and sed/awk/grep/cut what you need from the spooled output.
It is dirty, but it works in any situation.
Steve
Just turn 'spool' on in sql.
Run your query
and sed/awk/grep/cut what you need from the spooled output.
It is dirty, but it works in any situation.
Steve
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