 




<?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: Updation of Oracle tables</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 12:30:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: randym</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42914</link>
		<dc:creator>randym</dc:creator>
		<pubDate>Thu, 07 Oct 2004 11:19:17 +0000</pubDate>
		<guid isPermaLink="false">#comment-42914</guid>
		<description><![CDATA[The problem with the temp table idea is that with orginally stated number of records of 5 million, you will be in effect executing 5 million select statements.  That could make it slower than a function.]]></description>
		<content:encoded><![CDATA[<p>The problem with the temp table idea is that with orginally stated number of records of 5 million, you will be in effect executing 5 million select statements.  That could make it slower than a function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: randym</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42915</link>
		<dc:creator>randym</dc:creator>
		<pubDate>Thu, 07 Oct 2004 11:13:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-42915</guid>
		<description><![CDATA[The problem with the temp table idea is that you are going to be in effect executing 5 million (as originally stated number of records to update) select statements on that table.  That may result in slow speed.  The idea of a function would be quicker and you could write a program to build the function based on the temp table.]]></description>
		<content:encoded><![CDATA[<p>The problem with the temp table idea is that you are going to be in effect executing 5 million (as originally stated number of records to update) select statements on that table.  That may result in slow speed.  The idea of a function would be quicker and you could write a program to build the function based on the temp table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mangeler</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42916</link>
		<dc:creator>mangeler</dc:creator>
		<pubDate>Thu, 07 Oct 2004 11:04:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-42916</guid>
		<description><![CDATA[I like  KShorting&#039;s Idea with a temp table to map the values...]]></description>
		<content:encoded><![CDATA[<p>I like  KShorting&#8217;s Idea with a temp table to map the values&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kshorting</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42917</link>
		<dc:creator>kshorting</dc:creator>
		<pubDate>Thu, 07 Oct 2004 10:48:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-42917</guid>
		<description><![CDATA[You could try using a decode statement as follows.

update t1 set col2 = decode(col2,&#039;a&#039;,&#039;1&#039;,&#039;b&#039;,2&#039;)

But with 500 values, I know you will hit a maximum limit for the decode function. You will also have to code all
500 possibilities. 

You should be able to store the before and after values in a temporary table and update col2 based on the lookup as follows.

update t1 set (col2) = (select temp.col2_new from temp
where col2_old = t1.col2)
]]></description>
		<content:encoded><![CDATA[<p>You could try using a decode statement as follows.</p>
<p>update t1 set col2 = decode(col2,&#8217;a',&#8217;1&#8242;,&#8217;b',2&#8242;)</p>
<p>But with 500 values, I know you will hit a maximum limit for the decode function. You will also have to code all<br />
500 possibilities. </p>
<p>You should be able to store the before and after values in a temporary table and update col2 based on the lookup as follows.</p>
<p>update t1 set (col2) = (select temp.col2_new from temp<br />
where col2_old = t1.col2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: randym</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42918</link>
		<dc:creator>randym</dc:creator>
		<pubDate>Thu, 07 Oct 2004 09:32:26 +0000</pubDate>
		<guid isPermaLink="false">#comment-42918</guid>
		<description><![CDATA[A function that basically uses a case statement, If statement or maybe even an array would be efficent.  

Your statement would look something like this:  
Update t1 set col2 = setvalue(col2).

Your function would look something like this:
create or replace function 
   setvalue (invalue in varchar2) return varchar2 as
begin
 case invalue
   when &#039;1&#039; then
     return(&#039;a&#039;);
   when &#039;2&#039; then
     return(&#039;b&#039;);
 etc.....
   else
     return(&#039;?&#039;);
 end case;
end;

The greatest amount of time would probably be spent creating the function.  Indexing would make a great difference.]]></description>
		<content:encoded><![CDATA[<p>A function that basically uses a case statement, If statement or maybe even an array would be efficent.  </p>
<p>Your statement would look something like this:<br />
Update t1 set col2 = setvalue(col2).</p>
<p>Your function would look something like this:<br />
create or replace function<br />
   setvalue (invalue in varchar2) return varchar2 as<br />
begin<br />
 case invalue<br />
   when &#8217;1&#8242; then<br />
     return(&#8216;a&#8217;);<br />
   when &#8217;2&#8242; then<br />
     return(&#8216;b&#8217;);<br />
 etc&#8230;..<br />
   else<br />
     return(&#8216;?&#8217;);<br />
 end case;<br />
end;</p>
<p>The greatest amount of time would probably be spent creating the function.  Indexing would make a great difference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vikramranabhatt</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42919</link>
		<dc:creator>vikramranabhatt</dc:creator>
		<pubDate>Thu, 07 Oct 2004 01:19:37 +0000</pubDate>
		<guid isPermaLink="false">#comment-42919</guid>
		<description><![CDATA[u can use stored procedure that will greatly improve the performance. u hav to use index to modify the col2 but if  u use store procedure then it will help u
]]></description>
		<content:encoded><![CDATA[<p>u can use stored procedure that will greatly improve the performance. u hav to use index to modify the col2 but if  u use store procedure then it will help u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mangeler</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42920</link>
		<dc:creator>mangeler</dc:creator>
		<pubDate>Thu, 07 Oct 2004 01:14:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-42920</guid>
		<description><![CDATA[use a cursor to loop through your selected records and update them as required. :)]]></description>
		<content:encoded><![CDATA[<p>use a cursor to loop through your selected records and update them as required. <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rickprice</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/updation-of-oracle-tables/#comment-42921</link>
		<dc:creator>rickprice</dc:creator>
		<pubDate>Thu, 07 Oct 2004 00:42:53 +0000</pubDate>
		<guid isPermaLink="false">#comment-42921</guid>
		<description><![CDATA[Why not use a PL/SQL function or CASE statement to convert the  values? 

You would then be able to run the update once.

Rick]]></description>
		<content:encoded><![CDATA[<p>Why not use a PL/SQL function or CASE statement to convert the  values? </p>
<p>You would then be able to run the update once.</p>
<p>Rick</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/9 queries in 0.011 seconds using memcached
Object Caching 370/373 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 14:37:26 -->