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: Ban Spam <ban-spam_at_operamail.com>
Date: Thu, 27 Sep 2001 01:32:15 GMT
Message-ID: <Xns9128BC929533SunnySD@24.0.3.73>


swapandutta_at_yahoo.com (Swapan Dutta) wrote in news:d220f943.0109261714.3fe7768a_at_posting.google.com:

> 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?
>
> Thanks in advance.
>
> - Swapan.

  1. It I were tasked with this I'd just use Perl.
  2. Alternatively your shell script could produce a "temp.sh" file containing the desired text/strings & the execute it.
  3. I'm sure other here will come up with even more solutions.
Received on Wed Sep 26 2001 - 20:32:15 CDT

Original text of this message

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