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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Piping Unix output to SQL*plus

Re: Piping Unix output to SQL*plus

From: Avi Abrami <aabrami_at_intersystemsww.com>
Date: Wed, 24 Jan 2001 13:08:19 +0200
Message-ID: <3A6EB7A3.78F6FE99@intersystemsww.com>

See comments inserted between lines of your message...

venkat_rajagopal_at_my-deja.com wrote:

> All,
>
> Thanks for your replies but none of them will work. Let me
> give you a few more details. If I am doing something wrong please
> point it out.
>
> AN example is shown below:
>
> The file test.sql has teh lines below.
>
> $ cat test.sql
>
> SET FEEDBACK OFF
>
> SELECT value
> FROM v$parameter
> WHERE name = '&&X';
>
> The HERE documnet as someone suggested does not work because
> it terminates pematurely as shown below:
>
> $ sqlplus -s / << !
> > @test.sql

param_name
exit
/

>
> >!
>
> Enter value for x:
> User requested Interrupt or EOF detected.
> $
>
> Standard piping does not work as shown below because that also
> terminates prematurely as shown below:
>
> $ cat test.sql | sqlplus -s /
>
> Enter value for x: old 3: WHERE name = '&&X'
> new 3: WHERE name = ''
> $
>
> I want the script to prompt for x, then exit.

Then I suggest you write a "wrapper" script that parses the file "test.sql", gets the value for (using your example) "&&X" and then edits "test.sql" and replaces "&&X" with the accepted value.

>
>
> There are reasons I am asking for this. If you can help, please
> do. Someone suggested that I change the design - I will if I need
> to , but I want to know if this can be done. Chnaging the design
> at this point is not in the equation. .
>
> Hope that helps. Try it out yourself and see if it works for you.
>
> Thanks
> Venkat
>
> Sent via Deja.com
> http://www.deja.com/
  Received on Wed Jan 24 2001 - 05:08:19 CST

Original text of this message

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