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

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting values into SQLPLUS from Unix

Re: Getting values into SQLPLUS from Unix

From: Cris Carampa <cris119_at_operamail.com>
Date: Thu, 15 Dec 2005 17:01:32 +0100
Message-ID: <43a19385$0$328$5fc30a8@news.tiscali.it>


amerar_at_iwc.net wrote:

> sqlplus /nolog <<EOF
> connect / as sysdba
> ALTER SESSION SET CURRENT_SCHEMA=&1
> exec dbms_snapshot.refresh(UPPER('&1.&2'));
> exit
> EOF
>
> I want to pass in the values for &1 and &2........I am calling this
> from a Unix shell script. Any ideas?

You may want to use shell script parameters, not SQL*Plus ones.

sqlplus /nolog << EOF

    connect / as sysdba
    ALTER SESSION SET CURRENT_SCHEMA=$1; /* semicolon here! */     exec dbms_snapshot.refresh(UPPER('$1.$2'));     exit
EOF HTH. Kind regards,

-- 
Seven-hundred tons of metal a day
Now sir you tell me the world's changed
Once I made you rich enough
Rich enough to forget my name
Received on Thu Dec 15 2005 - 10:01:32 CST

Original text of this message

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