Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Plus: procedural problem
Ed Steinman wrote:
> select count(*) into errs from err where error_num = 12;
> if errs>0 then
> exit;
> end if;
>
> Of course, "exit" doesn't work this way in pl/sql. And there is no way
> to pass values from pl/sql to sql*plus. My question: what is the best
> product to handle something like this: oraperl, Pro*C, SQR (a reporting
> tool but it has a lot of other capabilities) or something else?
You could do it with sqlplus only: write two "subprogram" scripts, one for exit and one for continued processing and make your script after that END statement:
spool dynascript.sql
select decode(count(*), 0, '@continue', '@exit')
from err where error_num = 12;
spool off
@dynascript
I din't test anything, but you get the idea... Received on Mon Feb 24 1997 - 00:00:00 CST
![]() |
![]() |