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 from Unix to SQL*Plus

Re: Piping from Unix to SQL*Plus

From: Jining Han <hanj_at_mailcity.com>
Date: Tue, 23 Jan 2001 13:41:52 GMT
Message-ID: <94k1mu$o6u$1@nnrp1.deja.com>

Did you try

    echo "whatever" | sqlplus -s / @filename

For example, you have the following in test.sql

    select count(*) from &&tbl;

Now you can do

    echo "v\$sesion" | sqlplus -s / @test.sql

This may be a very simplied version of your problem, but think along the same line and you may come up with a solution.

--
Jining Han
Sallie Mae

In article <94ae9o$8l4$1_at_nnrp1.deja.com>,
  venkat_rajagopal_at_my-deja.com wrote:

> Hi,
>
> I've got a problem. I want to pipe a file ( all sql*plus commands
> inside the file ) to sqlplus .
>
> cat filename | sqlplus -s /
>
> is ok but won't work for me because in my file 'filename'
> I have '&&' specified in order to accept user input.
> The above method is ok if I don't have the need for user input.
> How can I do this? You might be wondering why on earth I need it
> but I really do. Let me know if you guys have any suggestions
> and If needed and you so desire I will give you more details.
>
> Thanks
>
> Venkat
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com http://www.deja.com/
Received on Tue Jan 23 2001 - 07:41:52 CST

Original text of this message

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