Re: continue oracle 11g verses 10g

From: Tim Gorman <tim_at_evdbt.com>
Date: Thu, 27 Dec 2012 12:56:00 -0700
Message-ID: <50DCA7D0.3070707_at_evdbt.com>



Assuming that it is non-trivial to properly block-structure this code with conditionals (that sound you hear is Edsgar Dijkstra rolling in his grave), then use the method which works with the lowest version to be supported (i.e. GOTO), along with copious commenting to explain to future programmers why you're doing so.

  On 12/27/2012 12:08 PM, Patterson, Joel 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
> --
> http://www.freelists.org/webpage/oracle-l

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 27 2012 - 20:56:00 CET

Original text of this message