<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Just about anything &#187; IDS</title>
	<atom:link href="http://calvinkrishy.wordpress.com/category/ids/feed/" rel="self" type="application/rss+xml" />
	<link>http://calvinkrishy.wordpress.com</link>
	<description>Yet another blog about programming, technology and general musings on life</description>
	<lastBuildDate>Fri, 25 May 2007 13:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='calvinkrishy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7c9c576a4e73956e649570a07e244d87?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Just about anything &#187; IDS</title>
		<link>http://calvinkrishy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://calvinkrishy.wordpress.com/osd.xml" title="Just about anything" />
		<item>
		<title>Variable Precedence</title>
		<link>http://calvinkrishy.wordpress.com/2007/05/25/variable-precedence/</link>
		<comments>http://calvinkrishy.wordpress.com/2007/05/25/variable-precedence/#comments</comments>
		<pubDate>Fri, 25 May 2007 13:44:47 +0000</pubDate>
		<dc:creator>calvinkrishy</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[IDS]]></category>

		<guid isPermaLink="false">http://calvinkrishy.wordpress.com/2007/05/25/variable-precedence/</guid>
		<description><![CDATA[Oracle &#8216;knows&#8217; which token is a variable and which is a column in a table. This becomes important when you are using a variable whose name clashes with that of a column name in a predicate. Consider the following:
create table tbl (x number)
/
insert into tbl values(1)
/
declare
x number;
d number;
begin
select count(*) into d
from tbl where x &#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=calvinkrishy.wordpress.com&blog=279823&post=5&subd=calvinkrishy&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Oracle &#8216;knows&#8217; which token is a variable and which is a column in a table. This becomes important when you are using a variable whose name clashes with that of a column name in a predicate. Consider the following:</p>
<p><code>create table tbl (x number)<br />
/<br />
insert into tbl values(1)<br />
/<br />
declare<br />
x number;<br />
d number;<br />
begin<br />
select count(*) into d<br />
from tbl where x &gt; 0;<br />
end;<br />
</code></p>
<p>This compiles fine under Oracle. Oracle &#8216;knows&#8217; that the x referred to in the query is the column and not the variable.  But a similar piece of code under <a href="http://www-128.ibm.com/developerworks/db2/zones/informix/">Informix</a> results in &#8216;-696 Variable () has undefined value&#8217;. </p>
<p><code>create table tbl(x int);<br />
insert into tbl values(1);<br />
create procedure demo_err()<br />
define d, x int;<br />
select count(*) into d<br />
from tbl where x &gt; 0;<br />
end procedure;<br />
call demo_err();<br />
</code></p>
<p>In fact, the Informix guide explicitly states that the <a href="http://publib.boulder.ibm.com/infocenter/idshelp/v10/topic/com.ibm.sqlt.doc/sqltmst266.htm">local variable takes precedence</a>. </p>
<p>Whose handling is more appropriate? Either way, I feel the IDS folks should throw up easily understandable error &#8211; &#8216;Variable () has undefined value&#8217; spoilt a n00b&#8217;s afternoon <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/calvinkrishy.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/calvinkrishy.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/calvinkrishy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/calvinkrishy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/calvinkrishy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/calvinkrishy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/calvinkrishy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/calvinkrishy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/calvinkrishy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/calvinkrishy.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/calvinkrishy.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/calvinkrishy.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=calvinkrishy.wordpress.com&blog=279823&post=5&subd=calvinkrishy&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://calvinkrishy.wordpress.com/2007/05/25/variable-precedence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f764d8f058bfe650be09fef6d7d425a?s=96&#38;d=identicon" medium="image">
			<media:title type="html">calvinkrishy</media:title>
		</media:content>
	</item>
	</channel>
</rss>