 




<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Expression to insert value to a table column in SQL</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 15:01:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115415</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Sun, 20 Jan 2013 01:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115415</guid>
		<description><![CDATA[Great.]]></description>
		<content:encoded><![CDATA[<p>Great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115414</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Sun, 20 Jan 2013 00:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115414</guid>
		<description><![CDATA[...though it could indeed be replaced by overflow/underflow if the data isn&#039;t good. -- Tom]]></description>
		<content:encoded><![CDATA[<p>&#8230;though it could indeed be replaced by overflow/underflow if the data isn&#8217;t good. &#8212; Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115413</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Sun, 20 Jan 2013 00:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115413</guid>
		<description><![CDATA[SQL0406 is &quot;Conversion error on assignment to column &amp;2.&quot; It&#039;s a conversion error (as noted in the question). It goes away when the CAST() is done. -- Tom]]></description>
		<content:encoded><![CDATA[<p>SQL0406 is &#8220;Conversion error on assignment to column &amp;2.&#8221; It&#8217;s a conversion error (as noted in the question). It goes away when the CAST() is done. &#8212; Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115412</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Sun, 20 Jan 2013 00:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115412</guid>
		<description><![CDATA[Apparently not.&#160;This&#160;was a question about&#160;error SQL0406 which is, I believer, an overflow situation.]]></description>
		<content:encoded><![CDATA[<p>Apparently not.&nbsp;This&nbsp;was a question about&nbsp;error SQL0406 which is, I believer, an overflow situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115411</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Sat, 19 Jan 2013 22:12:59 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115411</guid>
		<description><![CDATA[Error handling for possible overflow/underflow is always a good idea. Can&#039;t argue against it. However, the values in A, B, C and D should sanity checked at the point of entry (or update). If values that will be trouble are not allowed into the file in the first place, later tests can be minimized for processing efficiency. This current process is only updating FLD1, so it might be rational to _assume_ that the existing values will work. Maybe. -- Tom]]></description>
		<content:encoded><![CDATA[<p>Error handling for possible overflow/underflow is always a good idea. Can&#8217;t argue against it. However, the values in A, B, C and D should sanity checked at the point of entry (or update). If values that will be trouble are not allowed into the file in the first place, later tests can be minimized for processing efficiency. This current process is only updating FLD1, so it might be rational to _assume_ that the existing values will work. Maybe. &#8212; Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115410</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Sat, 19 Jan 2013 20:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115410</guid>
		<description><![CDATA[Don&#039;t know if a case can be used in the update..might be two updates with where clauses .. 99999etc where A*B*C/10**D &gt; 9999999999999.99 and the other updates the field with the actual value.&#160;]]></description>
		<content:encoded><![CDATA[<p>Don&#8217;t know if a case can be used in the update..might be two updates with where clauses .. 99999etc where A*B*C/10**D &gt; 9999999999999.99 and the other updates the field with the actual value.&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115409</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Sat, 19 Jan 2013 20:12:11 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115409</guid>
		<description><![CDATA[so I would probably do a case filling the field with 9s when the result is &gt; 9999999999999.99]]></description>
		<content:encoded><![CDATA[<p>so I would probably do a case filling the field with 9s when the result is &gt; 9999999999999.99</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115408</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Sat, 19 Jan 2013 20:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115408</guid>
		<description><![CDATA[…SET FLD1 = A*B*C/cast(10**D as int)Will fail with divide by zero error when D is a negative number...Doesn&#039;t matter what you do on the right, process&#160;will&#160;fail with error SQL0406&#160;when updating FLD1&#160;when the answer has more than 13 significant digits as in 1234567890123.45 * 1234567890123. * 12345678.90123 / 10 * 1&#160;]]></description>
		<content:encoded><![CDATA[<p>…SET FLD1 = A*B*C/cast(10**D as int)Will fail with divide by zero error when D is a negative number&#8230;Doesn&#8217;t matter what you do on the right, process&nbsp;will&nbsp;fail with error SQL0406&nbsp;when updating FLD1&nbsp;when the answer has more than 13 significant digits as in 1234567890123.45 * 1234567890123. * 12345678.90123 / 10 * 1&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomLiotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115397</link>
		<dc:creator>TomLiotta</dc:creator>
		<pubDate>Sat, 19 Jan 2013 07:59:30 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115397</guid>
		<description><![CDATA[I should have thought of this immediately. The exponentiation is causing an intermediate floating-point result to be created, and that causes floating-point to be carried through each subsequent intermediate result. Try it this way:
&lt;PRE&gt;...SET FLD1 = A*B*C/cast(10**D as int)&lt;/PRE&gt;

By casting as an INTEGER, the division works much better and final conversion to the FLD1 data type is fairly straightforward.
&#160;
Tom]]></description>
		<content:encoded><![CDATA[<p>I should have thought of this immediately. The exponentiation is causing an intermediate floating-point result to be created, and that causes floating-point to be carried through each subsequent intermediate result. Try it this way:</p>
<pre>&#8230;SET FLD1 = A*B*C/cast(10**D as int)</pre>
<p>By casting as an INTEGER, the division works much better and final conversion to the FLD1 data type is fairly straightforward.<br />
&nbsp;<br />
Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: philpl1jb</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115394</link>
		<dc:creator>philpl1jb</dc:creator>
		<pubDate>Fri, 18 Jan 2013 23:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/itanswers/expression-to-insert-value-to-a-table-column-in-sql/#comment-115394</guid>
		<description><![CDATA[Sorry .. had half my mind on work .. and that&#039;s the most of it.]]></description>
		<content:encoded><![CDATA[<p>Sorry .. had half my mind on work .. and that&#8217;s the most of it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/8 queries in 0.014 seconds using memcached
Object Caching 395/396 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 16:04:13 -->