<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Two Oracle PL/SQL Features You Probably Don&#8217;t Know About</title>
	<atom:link href="http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<pubDate>Tue, 07 Oct 2008 06:53:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Steven Feuerstein</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-52166</link>
		<dc:creator>Steven Feuerstein</dc:creator>
		<pubDate>Wed, 25 Jun 2008 10:04:22 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-52166</guid>
		<description>Wiz, 

You can add subprograms to a package without losing other subprograms, but when you change a package and recompile, you lose package "state" - which means that the values of package level variables will no longer be valid and available in your session. No way to avoid this, except to reorganize your package into two separate packages: one that contains your subprograms and another that contains the variables. 

Steven Feuerstein</description>
		<content:encoded><![CDATA[<p>Wiz, </p>
<p>You can add subprograms to a package without losing other subprograms, but when you change a package and recompile, you lose package &#8220;state&#8221; - which means that the values of package level variables will no longer be valid and available in your session. No way to avoid this, except to reorganize your package into two separate packages: one that contains your subprograms and another that contains the variables. </p>
<p>Steven Feuerstein</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wiz</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-52165</link>
		<dc:creator>Wiz</dc:creator>
		<pubDate>Tue, 24 Jun 2008 10:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-52165</guid>
		<description>hello,

I'm wondering if there is any way that someone could update and add a function to a package without loosing the other functions and or variables declared previously in that package

best regards,
Wiz</description>
		<content:encoded><![CDATA[<p>hello,</p>
<p>I&#8217;m wondering if there is any way that someone could update and add a function to a package without loosing the other functions and or variables declared previously in that package</p>
<p>best regards,<br />
Wiz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Bradshaw</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-51929</link>
		<dc:creator>Jeremy Bradshaw</dc:creator>
		<pubDate>Fri, 18 Jan 2008 12:10:06 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-51929</guid>
		<description>The main reason you might not want to declare the mutually recursive procedures in the package specification, is that you might not want them visible from the outside, or you may only want one visible from the outside. Abstraction/information-hiding is a powerful concept.</description>
		<content:encoded><![CDATA[<p>The main reason you might not want to declare the mutually recursive procedures in the package specification, is that you might not want them visible from the outside, or you may only want one visible from the outside. Abstraction/information-hiding is a powerful concept.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siri</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-51793</link>
		<dc:creator>Siri</dc:creator>
		<pubDate>Sat, 24 Nov 2007 15:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-51793</guid>
		<description>Just curious to know, how often one (have to) use 'mutual recursive functions' in a common work place?

~ Siri</description>
		<content:encoded><![CDATA[<p>Just curious to know, how often one (have to) use &#8216;mutual recursive functions&#8217; in a common work place?</p>
<p>~ Siri</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50778</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 15 May 2007 16:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50778</guid>
		<description>&lt;p&gt;Ah! I see what you mean. Right, you have to "package" the two mutually recursive functions one way or another.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ah! I see what you mean. Right, you have to &#8220;package&#8221; the two mutually recursive functions one way or another.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Schneider</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50777</link>
		<dc:creator>Laurent Schneider</dc:creator>
		<pubDate>Tue, 15 May 2007 15:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50777</guid>
		<description>&lt;p&gt;LOL ! There you have encapsulated two functions in one... it is almost a package!&lt;/p&gt;

&lt;p&gt;Seriously, you cannot have&lt;/p&gt;

&lt;p&gt;create function f1 return number is begin return f2; end; 
/&lt;/p&gt;

&lt;p&gt;create function f2 return number is begin return f1; end; 
/&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>LOL ! There you have encapsulated two functions in one&#8230; it is almost a package!</p>
<p>Seriously, you cannot have</p>
<p>create function f1 return number is begin return f2; end;<br />
/</p>
<p>create function f2 return number is begin return f1; end;<br />
/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50772</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Mon, 14 May 2007 20:04:42 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50772</guid>
		<description>&lt;p&gt;Laurent, mutual recursion does not have to be coded in a package. The following stored function for example works like a charm:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  CREATE OR REPLACE FUNCTION odd_or_even (n NATURAL) 
     RETURN VARCHAR2
  IS
     l_return_var VARCHAR2 (4);

     FUNCTION odd (n NATURAL )
        RETURN BOOLEAN;   -- forward declaration

     FUNCTION even (n NATURAL)
        RETURN BOOLEAN
     IS
     BEGIN
        IF n = 0
        THEN
           RETURN TRUE;
        ELSE
           RETURN odd (n - 1);   -- mutually recursive call
        END IF;
     END even;

     FUNCTION odd (n NATURAL)
        RETURN BOOLEAN
     IS
     BEGIN
        IF n = 0
        THEN
           RETURN FALSE;
        ELSE
           RETURN even (n - 1);   -- mutually recursive call
        END IF;
     END odd;
  BEGIN
     IF even (n)
     THEN
        l_return_var := 'even';
     ELSIF odd (n)
     THEN
        l_return_var := 'odd';
     ELSE
        l_return_var := 'oops';
     END IF;

     RETURN l_return_var;
  END odd_or_even;
  /
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, as a general rule, I keep away from using standalone functions and procedures and use packages instead.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Laurent, mutual recursion does not have to be coded in a package. The following stored function for example works like a charm:</p>
<pre><code>  CREATE OR REPLACE FUNCTION odd_or_even (n NATURAL)
     RETURN VARCHAR2
  IS
     l_return_var VARCHAR2 (4);

     FUNCTION odd (n NATURAL )
        RETURN BOOLEAN;   -- forward declaration

     FUNCTION even (n NATURAL)
        RETURN BOOLEAN
     IS
     BEGIN
        IF n = 0
        THEN
           RETURN TRUE;
        ELSE
           RETURN odd (n - 1);   -- mutually recursive call
        END IF;
     END even;

     FUNCTION odd (n NATURAL)
        RETURN BOOLEAN
     IS
     BEGIN
        IF n = 0
        THEN
           RETURN FALSE;
        ELSE
           RETURN even (n - 1);   -- mutually recursive call
        END IF;
     END odd;
  BEGIN
     IF even (n)
     THEN
        l_return_var := 'even';
     ELSIF odd (n)
     THEN
        l_return_var := 'odd';
     ELSE
        l_return_var := 'oops';
     END IF;

     RETURN l_return_var;
  END odd_or_even;
  /
</code></pre>
<p>Of course, as a general rule, I keep away from using standalone functions and procedures and use packages instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Schneider</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50769</link>
		<dc:creator>Laurent Schneider</dc:creator>
		<pubDate>Sun, 13 May 2007 06:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50769</guid>
		<description>&lt;p&gt;Do not you need a package to use mutual recursion?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Do not you need a package to use mutual recursion?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50740</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Thu, 03 May 2007 06:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50740</guid>
		<description>&lt;p&gt;Don, yes you could, assuming that by package header you meant package specification, and assuming that your modules are created inside a package. In fact, that's one of the solutions I stated in my post: &lt;em&gt;The second option is to declare my_func2 in the package specification.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;However, what if you do not have a package? Instead you have CREATE FUNCTION for example.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Don, yes you could, assuming that by package header you meant package specification, and assuming that your modules are created inside a package. In fact, that&#8217;s one of the solutions I stated in my post: <em>The second option is to declare my_func2 in the package specification.</em></p>
<p>However, what if you do not have a package? Instead you have CREATE FUNCTION for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don Seiler</title>
		<link>http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50738</link>
		<dc:creator>Don Seiler</dc:creator>
		<pubDate>Wed, 02 May 2007 21:43:07 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2007/04/30/two-oracle-plsql-features-you-probably-don%e2%80%99t-know-about/#comment-50738</guid>
		<description>&lt;p&gt;Could you not put the declarations in the package header?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Could you not put the declarations in the package header?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
