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: Is IF ELSE statement can be used inside sqlplus?

Re: Is IF ELSE statement can be used inside sqlplus?

From: Officer <raboasia_at_pacific.net.sg>
Date: Tue, 13 Jan 2004 12:05:42 +0800
Message-ID: <btvqqg$3hh$1@nobel.pacific.net.sg>


Hi Michael.

Done.This is the solution. To add, i have just realized that i can not call the function with out parameter due to PL/SQL requirements. ORA-006572

Thanks.

"Michel Cadot" <micadot{at}altern{dot}org> wrote in message news:4002784a$0$28680$626a54ce_at_news.free.fr...
>
> "Officer" <raboasia_at_pacific.net.sg> a écrit dans le message de
> news:bttod8$vj7$1_at_nobel.pacific.net.sg...
> > What i want to accomplish is i want to evaluate returned value from the
> > function.
> >
> > I know if then else is an pl/sql not sql so i post the question
here.just in
> > case anybody has ever done it before.
> >
> > declare
> > myout number;
> > Begin
> > myout:=func_get_valid_answer;
> > if myout equal to true(certain number) then
> > exit from this sqlplus session with exit code 0
> > if myout equal to false then
> > exit from this sqlplus session with exit code 1
> > End;
> >
>
> You can do something like this:
>
> Col retval noprint new_value retval
> Select decode(func_get_valid_answer, <what number you want>, 0, 1) from
dual;
> exit &retval
>
> Regards
> Michel Cadot
>
>
Received on Mon Jan 12 2004 - 22:05:42 CST

Original text of this message

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