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: Using variable withing shell scripts for calling Oracle DB procedures

Re: Using variable withing shell scripts for calling Oracle DB procedures

From: naniwadekar <nani345_at_hotmail.com>
Date: 27 Sep 2001 01:44:07 -0700
Message-ID: <b4af975d.0109270044.3193d8a1@posting.google.com>


swapandutta_at_yahoo.com (Swapan Dutta) wrote -
> Hello :
> I want to pass variables to oracle procedures.
> I tried the following script, but it failed.
>
> ---------------------------
> #!/bin/sh
> first_var='value'
> sqlplus -s username/password_at_connect <<END
> execute package.proc($first_var,'two','three');
> END
>
> exit 0
> ---------------------------
>
> If I replace $first_var in the execute statement by a static string,
> the script works. What is the syntax for passing variables within
> shell script to oracle procedure?
>

Try enclosing $first_var in quotes.
execute package.proc('$first_var','two','three'); should work.

Received on Thu Sep 27 2001 - 03:44:07 CDT

Original text of this message

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