<?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: A binary flag with three values</title>
	<atom:link href="http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<pubDate>Wed, 20 Aug 2008 17:48:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: thierry</title>
		<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4185</link>
		<dc:creator>thierry</dc:creator>
		<pubDate>Tue, 04 Apr 2006 21:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4185</guid>
		<description>&lt;p&gt;maybe 'designed' for performance, to keep the index on open_flag as small as possible?
welcome in the wonderfull world of Oracle Applications. Wait till Fusion when it will support multiple databases.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>maybe &#8216;designed&#8217; for performance, to keep the index on open_flag as small as possible?<br />
welcome in the wonderfull world of Oracle Applications. Wait till Fusion when it will support multiple databases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4184</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Tue, 04 Apr 2006 17:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4184</guid>
		<description>&lt;p&gt;The open_flag is always relevant. An order can either be open or closed, no third value. That's the business rule.&lt;/p&gt;

&lt;p&gt;It turns out that the standard Oracle Applications (11.0.3) functionality sets open_flag to NULL (instead of 'N') when the order is closed, and to 'Y' when the order is open. That explains why the majority of rows have NULL in the open_flag (old closed orders).&lt;/p&gt;

&lt;p&gt;So basically, in this case, NULL was given the meaning of 'N'.&lt;/p&gt;

&lt;p&gt;NULL should mean nothing, and any design that relies on NULL to mean something, is, in my opinion, a bad design.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The open_flag is always relevant. An order can either be open or closed, no third value. That&#8217;s the business rule.</p>
<p>It turns out that the standard Oracle Applications (11.0.3) functionality sets open_flag to NULL (instead of &#8216;N&#8217;) when the order is closed, and to &#8216;Y&#8217; when the order is open. That explains why the majority of rows have NULL in the open_flag (old closed orders).</p>
<p>So basically, in this case, NULL was given the meaning of &#8216;N&#8217;.</p>
<p>NULL should mean nothing, and any design that relies on NULL to mean something, is, in my opinion, a bad design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: L</title>
		<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4182</link>
		<dc:creator>L</dc:creator>
		<pubDate>Tue, 04 Apr 2006 17:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4182</guid>
		<description>&lt;p&gt;It could be a clue to the problem (especially if there aren't any other rows with it null).  If the record was created but the process failed before it was able to set open_flag....  As I remember we've seen cases in Oracle Apps 11.5.4 where dates aren't set even though they should be (though obviously not required) because the entire process didn't complete successfully.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It could be a clue to the problem (especially if there aren&#8217;t any other rows with it null).  If the record was created but the process failed before it was able to set open_flag&#8230;.  As I remember we&#8217;ve seen cases in Oracle Apps 11.5.4 where dates aren&#8217;t set even though they should be (though obviously not required) because the entire process didn&#8217;t complete successfully.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: APC</title>
		<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4181</link>
		<dc:creator>APC</dc:creator>
		<pubDate>Tue, 04 Apr 2006 16:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4181</guid>
		<description>&lt;p&gt;Well this is just the old argument about NULL.  Arguably all columns in a database should be NOT NULL, with suitable values decided upon for each meaning we might assign to NULL (inapplicable, unknown, file not found, etc).  This is, of course, particularly tricky to implement for numeric, without using magic numbers.  I know of no database anywhere that does this.  We all live with NULLs.&lt;/p&gt;

&lt;p&gt;Still this did remind me of a happy few weeks I spent on a Forms 3 project many years ago.  One of the clients wanted all the flag columns to be trivalent.  I got chosen to go through all the Forms, making the flag columns optional, removing the default values and changing the code to handle null values.   Even now it still sends shudders down my spine.&lt;/p&gt;

&lt;p&gt;Cheers, APC&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well this is just the old argument about NULL.  Arguably all columns in a database should be NOT NULL, with suitable values decided upon for each meaning we might assign to NULL (inapplicable, unknown, file not found, etc).  This is, of course, particularly tricky to implement for numeric, without using magic numbers.  I know of no database anywhere that does this.  We all live with NULLs.</p>
<p>Still this did remind me of a happy few weeks I spent on a Forms 3 project many years ago.  One of the clients wanted all the flag columns to be trivalent.  I got chosen to go through all the Forms, making the flag columns optional, removing the default values and changing the code to handle null values.   Even now it still sends shudders down my spine.</p>
<p>Cheers, APC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Vollman</title>
		<link>http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4179</link>
		<dc:creator>Robert Vollman</dc:creator>
		<pubDate>Tue, 04 Apr 2006 16:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/2006/04/04/a-binary-flag-with-three-values/#comment-4179</guid>
		<description>&lt;p&gt;Is it ever possible for the "open_flag" to be irrelevant or not applicable?  That would be an appropriate use of NULL for a flag.&lt;/p&gt;

&lt;p&gt;Query the table for all cases where open_flag is NULL and look for a common thread.  Maybe they're all a special type of order that is never open nor closed.  Without knowing more about the business, its hard to really conclude when/if NULL is appropriate.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Is it ever possible for the &#8220;open_flag&#8221; to be irrelevant or not applicable?  That would be an appropriate use of NULL for a flag.</p>
<p>Query the table for all cases where open_flag is NULL and look for a common thread.  Maybe they&#8217;re all a special type of order that is never open nor closed.  Without knowing more about the business, its hard to really conclude when/if NULL is appropriate.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
