Good day, all:
I'm writing a script where the user can specify at run-time if they want to
run the entire script or just one numbered piece. One way I thought of
implementing this is pasted below, but the line "goto v_crlabel" is not
recognized - evidently the PL/SQL engine is not substituting in the value
for the variable.
Does anyone know if this is possible? If not, I can just prefix each block
by an if..then statement to test for the value in v_cr . . . but I thought
it could be cool to try it this way.
Thanks
bill
***************************************************************
accept i_cr prompt 'Enter CR to run: '
declare
v_cr number := &&i_cr;
v_crlabel varchar2(30) := 'CR' || to_char(v_cr);
begin
if v_cr is not null then
goto v_crlabel;
else
goto endrun;
end if;
<<CR5>>
dbms_output.put_line('Successfully went to CR5');
goto endrun;
<<CR6>>
dbms_output.put_line('Successfully went to CR6');
goto endrun;
<<CR7>>
dbms_output.put_line('Successfully went to CR7');
goto endrun;
<<ENDRUN>>
NULL;
dbms_output.put_line('Went to ENDRUN');
end;
/
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Magaliff, Bill
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).