RE: continue oracle 11g verses 10g

From: Patterson, Joel <Joel.Patterson_at_crowley.com>
Date: Thu, 27 Dec 2012 15:01:08 -0500
Message-ID: <C95D75DD2E01DD4D81124D104D317ACA23212A18D0_at_JAXMSG01.crowley.com>



Well, good point. Also I see Tim Gorman is agreeing. GOTO is probably the simplest and easiest, and it appears that I will succumb to compromising. Drat, It's just that 'continue' exists now, and goto is like writing in BASIC... :)

Thanks you guys (and gals),

Joel Patterson
Database Administrator
904 727-2546
From: rjamya [mailto:rjamya_at_gmail.com] Sent: Thursday, December 27, 2012 2:35 PM To: Patterson, Joel
Cc: oracle-l
Subject: Re: continue oracle 11g verses 10g

i think GOTO MESSAGE_LOOP still works in 11g, so why not keep it until you move to 11g and then switch to CONTINUE?

Raj

On Thu, Dec 27, 2012 at 2:08 PM, Patterson, Joel <Joel.Patterson_at_crowley.com<mailto:Joel.Patterson_at_crowley.com>> wrote:

I have a function (Solaris 5.10, all versions of oracle), that I wish the same code to compile and run on oracle versions 9, 10, and 11. (you can dismiss 9 however).

CONTINUE was introduced in 11g. Before 11g, there were various work arounds, but in my case I'll use the goto <<label>> method (ie 10g).

I want the for loop to continue iterating regardless of the version. I started looking at PL/SQL conditional compilations Oracle 2005, http://www.oracle.com/technetwork/database/features/plsql/overview/plsql-conditional-compilation-133587.pdf but looks like it is either not right or too complicated for this. Execute immediate also does not appear to work inside the function for this task.

What to the listers recomend?

For I ...
<<message loop>>
... do stuff...

          if v_oracle11g then

-- execute immediate 'continue';
continue; else
-- execute immediate 'goto message_loop';
goto message_loop; end if;

end loop;

Joel Patterson
Database Administrator
904 727-2546<tel:904%20727-2546>
--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Thu Dec 27 2012 - 21:01:08 CET

Original text of this message