Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: UNIX script problem with sqlplus

Re: UNIX script problem with sqlplus

From: Marti Rijken <mrijken_at_natrix.gld.nl>
Date: 20 Aug 1998 12:17:28 GMT
Message-ID: <6rh3uh$gkr$1@natrix.gld.nl>


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
	;

_END_OF_SQL --

   @..@ 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US