Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sqlplus output ...
Marc-Olivier BLANC wrote:
> Hello,
>
> I want to launch sqlplus commands via a shell
> script and then get back the results and put them
> in a text file with a special format. Can someone
> tell me how to launch sql commands and get the
> output ?
>
> Thanks.
Marc,
Here is a sample shell script :-
check your login environment variables if it has all the default oracle parameters set up, for eg;- oracle_sid,oracle_home,oracle_base.
#!/bin/ksh
export ORACLE_SID=DEVP
sqlplus -s scott/tiger @test.sql
On the test.sql script do the following :-
set verify off
set feedback off
spool test.lst
select * from table_name;
spool off
exit
Run the ksh script and it will generate an output file called test.lst
Thanks
Sai
Received on Thu Dec 17 1998 - 08:16:09 CST
![]() |
![]() |