Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: UNIX script problem with sqlplus
Alan Long <tics28@"spam-off"email.sps.mot.com> wrote:
>
> . ~/.profile
> sqlplus userid/password < temp1.sql
> mail tics28_at_email.sps.mot.com < temp1.lst
>
>This essentially works but temp1.lst contains:
>
> SQL>
> SQL> select part_id
> 2 from product
> 4 ;
>
> PART_ID
> -----------------------------------
> A/32
> SQL>
> SQL> spool off
Adding option -s to sqlplus will get rid of the prompt and other superfluous output. Then you can combine your scripts in one, using a "here document" and piping, and refrain from spooling, like in:
. ~/.profile
sqlplus -s <<- \_END_OF_SQL_ | mail tics28_at_email.sps.mot.com
set pagesize 1000 set linesize 800 set trimout on set pause off set feedback off select part_id from product ;
@..@ Marti Rijken <mrijken_at_prv.gelderland.nl> (`--') private mail: mrijken_at_natrix.demon.nl ( >__< ) URL: http://www.natrix.demon.nl/ Received on Thu Aug 20 1998 - 07:17:28 CDT
![]() |
![]() |