Re: SQLPLUS Question

From: Gerard H. Pille <ghpille_at_hotmail.com>
Date: Mon, 18 Jan 2010 00:56:43 -0800 (PST)
Message-ID: <358ceb66-2e8e-43c6-bab6-f77b782e624c_at_l19g2000yqb.googlegroups.com>



On 17 jan, 17:34, Jeremy <jeremy0..._at_gmail.com> wrote:
> In article <hithhv$d1..._at_solani.org>, gogala.mla..._at_gmail.com says...>
>
>
>
> > On Sat, 16 Jan 2010 20:24:36 +0000, Jeremy wrote:
>
> > > In article <hit6ej$ph..._at_solani.org>, gogala.mla..._at_gmail.com says...>
> > >> On Sat, 16 Jan 2010 18:37:24 +0000, Jeremy wrote:
>
> > >> > Can you create sqlplus scripts with "conditions" such that if for
> > >> > example a SQL statement returns a particular value or error condition
> > >> > then path A or path B is followed?
>
> > >> Yes. It's called PL/SQL and is available as of the version 6.
>
> > > Is that intended to be serious answer?
>
> > Yes. That is precisely what PL/SQL is intended for: you run SQL and
> > follow some logic path depending on the outcome.
>
> Perhaps I assumed I had conveyed more of my requirements to the post
> than I did.
>
> It's about conditional execution of .sql files - am looking at ways to
> automate install/upgrades which cannot be done using PL/SQL.
>
> --
> jeremy

Well, you could simply do a:

if [ ... ]
then
  SCRIPT=script_A
else
  SCRIPT=script_B
fi
print -p "start $SCRIPT" Received on Mon Jan 18 2010 - 02:56:43 CST

Original text of this message