RE: continue oracle 11g verses 10g

From: Patterson, Joel <Joel.Patterson_at_crowley.com>
Date: Fri, 28 Dec 2012 07:49:19 -0500
Message-ID: <C95D75DD2E01DD4D81124D104D317ACA23212A1B63_at_JAXMSG01.crowley.com>



P.S. I'm going to put the whole thing in a package with this idea -- and put some other things in it as well.

Joel Patterson
Database Administrator
904 727-2546

-----Original Message-----

From: Patterson, Joel
Sent: Friday, December 28, 2012 7:46 AM
To: Patterson, Joel; oracle-l; Jared Still; tim_at_evdbt.com Subject: RE: continue oracle 11g verses 10g

Jared,

[Pasted your response in original posting here.]

Yes, I looked at http://www.oracle.com/technetwork/database/features/plsql/overview/plsql-conditional-compilation-133587.pdf However, I'm not 'getting it' fast enough. (I like working examples I can follow from the beginning). If you have something more or better on the Conditional Compilation, send it along.

However I thought last night, that what I could do is take the conditions that are deciding whether to continue or not, and put them into a function. Then ignore one of the options. In this particular case I believe the GOTO can be eliminated -- as well as the CONTINUE infact. :) The things you think of when you're not working the problem.

It would look Something like this -- the function will return True or False. If LOOPDONE then

   Print something.
END IF

  • here the loop would continue with next iteration.

Thanks,
....

On Thu, Dec 27, 2012 at 11:08 AM, Patterson, Joel <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).

Joel, have you considered conditional compilation?

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist Oracle Blog: http://jkstill.blogspot.com Home Page: http://jaredstill.com

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Patterson, Joel Sent: Thursday, December 27, 2012 2:08 PM To: oracle-l
Subject: continue oracle 11g verses 10g

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 Fri Dec 28 2012 - 13:49:19 CET

Original text of this message