continue oracle 11g verses 10g

From: Patterson, Joel <Joel.Patterson_at_crowley.com>
Date: Thu, 27 Dec 2012 14:08:20 -0500
Message-ID: <C95D75DD2E01DD4D81124D104D317ACA23212A181E_at_JAXMSG01.crowley.com>


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
Received on Thu Dec 27 2012 - 20:08:20 CET

Original text of this message