Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to use values from SQL to OS?
I usually do like this:
#!/bin/sh
# Setup Oracle environment
ORACLE_HOME=... ; export ORACLE_HOME
NLS_LANG=... ; export NLS_LANG
# etc.
UNIXVAR=`$ORACLE_HOME/bin/sqlplus -s scott/tiger << EOD
set heading off feedback off verify off
select count(*) from emp;
EOD
`
You might need to filter the first (blank) line using awk or another utility.
Cheers,
Gollum
On Fri, 4 Feb 2000 23:35:31 +0200, "Zeev Milin" <zeev.milin_at_dealtime.com> wrote:
>I am writing a script to pass value (select count(*) from emp) to OS.
>I would like to use it with os command - how can i do it?
>
>
Received on Fri Feb 04 2000 - 16:06:11 CST
![]() |
![]() |