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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: passing variable from sqlplus to korn scripts ..

RE: passing variable from sqlplus to korn scripts ..

From: Afanassiev, Alex <Alex.Afanassiev_at_team.telstra.com>
Date: Thu, 14 Sep 2000 11:40:30 +1100
Message-Id: <10618.116918@fatcity.com>


Hi Deepak

Maybe something like this will do for you ?

#!/bin/ksh
#
#JOBNAME="$0"
#JOBNAME_SHORT=`basename $JOBNAME`

OUT=/tmp/out.log
$ORACLE_HOME/bin/sqlplus -s / > $OUT <<__EOF1 set serveroutput on feed off echo off verify off declare

        bdump varchar2(1000);
begin

        select value
                into bdump
                from v\$parameter
                where name ='background_dump_dest';
        dbms_output.put_line(bdump);

end;
/
exit
__EOF1
DIR=`cat $OUT`
echo $DIR
exit

With regards
Alex Afanassiev
Oracle DBA, TOC OPS/Internet.Operations

Tel:	(03) 8 661 20 61
Fax:	(03) 9 650 36 74



> -----Original Message-----
> From: Thapliyal, Deepak [SMTP:DThapliyal_at_ea.com]
> Sent: Thursday, September 14, 2000 10:02 AM
> To: Multiple recipients of list ORACLE-L
> Subject: passing variable from sqlplus to korn scripts ..
>
> Hi guys
>
> goin thru a brain freeze here .. ur help appreciated in advance
> here is the deal ...
>
> #!/bin/ksh
> #
> ..
> .. ksh code
> .. ksh code
> .. ksh code
> ..
>
> $ORACLE_HOME/bin/sqlplus -s / <<__EOF1
> declare
> bdump varchar2(1000);
> begin
> select value
> into bdump
> from v$parameter
> where name ='background_dump_dest';
> end;
> /
> exit
> __EOF1
>
> ** how to accesss bdump variable value from sql*plas here in shell script
> ??**************
>
> .. ksh code
> .. ksh code
> ..
>
>
> Thx
> deepAk
> --
> Author: Thapliyal, Deepak
> INET: DThapliyal_at_ea.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
Received on Wed Sep 13 2000 - 19:40:30 CDT

Original text of this message

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