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

Re: unix script

From: Kris Klindworth <kris.klindworth_at_carle.com>
Date: Mon, 24 Aug 1998 13:38:51 -0500
Message-ID: <35E1B33B.14C7E58D@carle.com>

jeff9580_at_my-dejanews.com wrote:

> I'm writing a Unix script that needs to use some values frorm Oracle as
> variables:
>
> ex: select Apples, Oranges, Pears
> from table;
>
> I need to make Apples, Oranges, etc each it's own variable in the script. Can
> I do this without writing 3 different select statements?
>

Something like this ...

select 'Apples=' || Apples || '; Oranges=' || Oranges || '; Pears=' || Pears from table;should return a string which you can use asand argument to the "eval" command. Say the returned string is in the environment varable "result", then when you run "eval $result" it will set the environment variables Apples, Oranges, and Pears.


Kris Klindworth                 kris.klindworth_at_carle.com
Oracle DBA                        602 West University
Carle Clinic Association        Urbana, IL 61801


Received on Mon Aug 24 1998 - 13:38:51 CDT

Original text of this message

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