<?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>Edi Yanto (何 萬 新) &#187; performance</title>
	<atom:link href="http://ediyanto83.wordpress.com/tag/performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://ediyanto83.wordpress.com</link>
	<description>Welcome to my weblog</description>
	<lastBuildDate>Sun, 08 Nov 2009 07:24:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ediyanto83.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/a744dbd9a2c0cfeb9b03e383ec662828?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Edi Yanto (何 萬 新) &#187; performance</title>
		<link>http://ediyanto83.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ediyanto83.wordpress.com/osd.xml" title="Edi Yanto (何 萬 新)" />
		<item>
		<title>ORA-01652: unable to extend temp segment by 128 in tablespace TEMP</title>
		<link>http://ediyanto83.wordpress.com/2009/04/19/ora-01652-unable-to-extend-temp-segment-by-128-in-tablespace-temp/</link>
		<comments>http://ediyanto83.wordpress.com/2009/04/19/ora-01652-unable-to-extend-temp-segment-by-128-in-tablespace-temp/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 09:40:23 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/?p=493</guid>
		<description><![CDATA[ Cause: Failed to allocate an extent of the required number of blocks for a temporary segment in the tablespace indicated. 
Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated. 
MetaLink has a very detailed and informative article concerning ORA-01652 and RAC.  There is some troubleshooting required [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=493&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-align:justify;"><strong><span style="color:black;"> <strong>Cause:</strong></span></strong><span style="color:black;"> Failed to allocate an extent of the required number of blocks for a temporary segment in the tablespace indicated. </span></p>
<p class="MsoNormal"><span style="color:black;"><strong>Action:</strong> Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated. </span></p>
<p style="text-align:justify;"><a title="Troubleshooting ORA-1652 Errors in RAC" href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:2840960078839325001::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,280578.1,1,1,1,helvetica" target="_blank">MetaLink</a> has a very detailed and informative article concerning ORA-01652 and RAC.  There is some troubleshooting required with ORA-01652 in RAC because there are two common causes in this area.</p>
<ol>
<li>ORA-01652 may occur because there is simply no space available in the temp tablespace of which is being used.</li>
<li>ORA-01652 may have to do with the local temp segment not being able to extent space even though there is space in other instances.</li>
</ol>
<p style="text-align:justify;">To troubleshoot for ORA-01652,  and find out which of the above scenarios are causing ORA-01652 use this query offered by MetaLink:</p>
<p><em>select sum(free_blocks)<br />
from gv$sort_segment<br />
where tablespace_name = &#8216;&lt;TEMP TABLESPACE NAME&gt;&#8217;</em></p>
<p style="text-align:justify;">You will know that the first scenario is causing ORA-01652 to be thrown if the free block reads &#8216;0&#8242; because it signifies that there is no free space.</p>
<p style="text-align:justify;">If there is a good amount of space, you know that there is another cause for ORA-01652, and it is probably the second scenario.  It is important to note that in a non-RAC environment, local instances are not able to extend the temp segments.</p>
<p>In sever cases, a slowdown may occur, in which you might want try one of the following work-arounds:</p>
<ol type="1">
<li class="MsoNormal"><em>Increase size of the      temp tablespace </em></li>
<li class="MsoNormal"><em>Increase sort_area_size      and/or pga_aggregate_target </em></li>
</ol>
<p style="text-align:justify;">If ORA-01652 is causing the slowdown, SMON will probably not be able to process the sort segment requests, you  should try to diagnose the contention:</p>
<ul type="disc">
<li class="MsoNormal">Output from the      following query periodically during the problem:<em><br />
select inst_id, tablespace_name, total_blocks, used_blocks, free_blocks<br />
from gv$sort_segment;</em></li>
<li class="MsoNormal">Global hang analyze and systemstate dumps</li>
</ul>
<p>Reference: <a title="ORA-01652: unable to extend temp segment by string in tablespace string tips" href="http://www.dba-oracle.com/sf_ora_01652_unable_to_extend_temp_segment_by_string_in_tablespace_string.htm" target="_blank"><span style="font-size:x-small;"><em>Oracle Error Tips by Burleson Consulting</em></span></a></p>
Posted in Oracle Tagged: performance, troubleshooting <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=493&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2009/04/19/ora-01652-unable-to-extend-temp-segment-by-128-in-tablespace-temp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>
	</item>
		<item>
		<title>Recompile Invalid Objects using DBMS_DDL or Custom Script Using EXECUTE IMMEDIATE</title>
		<link>http://ediyanto83.wordpress.com/2009/01/07/recompile-invalid-objects-using-dbms_ddl-or-custom-script-using-execute-immediate/</link>
		<comments>http://ediyanto83.wordpress.com/2009/01/07/recompile-invalid-objects-using-dbms_ddl-or-custom-script-using-execute-immediate/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 04:49:53 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/?p=345</guid>
		<description><![CDATA[Operations such as upgrades, patches and DDL changes can invalidate schema objects.  For this reason it makes sense to recompile invalid objects in advance of user calls. It also allows you to identify if any changes have broken your code base.
In order to compile a program, you must own that program (in other words, the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=345&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Operations such as upgrades, patches and DDL changes can invalidate schema objects.  For this reason it makes sense to recompile invalid objects in advance of user calls. It also allows you to identify if any changes have broken your code base.</p>
<p>In order to compile a program, you must own that program (in other words, the schema you specify is the owner of the program for which you request compilation) or your schema must have been granted the ALTER ANY PROCEDURE privilege to compile another schema&#8217;s programs.</p>
<pre class="programlisting">GRANT ALTER ANY PROCEDURE TO name_of_user;</pre>
<p><strong>DBMS_DDL.ALTER_COMPILE<br />
</strong></p>
<blockquote><p>CREATE OR REPLACE PROCEDURE recompile_objects<br />
(status_in IN VARCHAR2 := &#8216;INVALID&#8217;,<br />
name_in IN VARCHAR2 := &#8216;%&#8217;,<br />
type_in IN VARCHAR2 := &#8216;%&#8217;,<br />
schema_in IN VARCHAR2 := USER)<br />
IS<br />
v_objtype VARCHAR2(100);</p>
<p>CURSOR obj_cur IS<br />
SELECT owner, object_name, object_type<br />
FROM ALL_OBJECTS<br />
WHERE status LIKE UPPER (status_in)<br />
AND object_name LIKE UPPER (name_in)<br />
AND object_type LIKE UPPER (type_in)<br />
AND owner LIKE UPPER (schema_in)<br />
ORDER BY<br />
DECODE (object_type,<br />
&#8216;PACKAGE&#8217;, 1,<br />
&#8216;FUNCTION&#8217;, 2,<br />
&#8216;PROCEDURE&#8217;, 3,<br />
&#8216;PACKAGE BODY&#8217;, 4);<br />
BEGIN<br />
FOR rec IN obj_cur<br />
LOOP<br />
IF rec.object_type = &#8216;PACKAGE&#8217;<br />
THEN<br />
v_objtype := &#8216;PACKAGE SPECIFICATION&#8217;;<br />
ELSE<br />
v_objtype := rec.object_type;<br />
END IF;</p>
<p>DBMS_DDL.ALTER_COMPILE (v_objtype, rec.owner, rec.object_name);</p>
<p>DBMS_OUTPUT.PUT_LINE<br />
(&#8216;Compiled &#8216; || v_objtype || &#8216; of &#8216; ||<br />
rec.owner || &#8216;.&#8217; || rec.object_name);<br />
END LOOP;<br />
END recompile_objects;<br />
/</p></blockquote>
<p class="para">The ALTER_COMPILE procedure may raise any of the following exceptions:</p>
<dl class="variablelist">
<dt class="term">ORA-20000</dt>
<dd class="listitem">
<p class="para">Insufficient privileges or object does not exist. You must either own the specified object or be granted the CREATE ANY PROCEDURE privilege.</p>
</dd>
<dt class="term">ORA-20001</dt>
<dd class="listitem">
<p class="para">Remote object, cannot compile. You can only recompile objects on the local database instance.</p>
</dd>
<dt class="term">ORA-20002</dt>
<dd class="listitem">
<p class="para">Bad value for object type. You need to provide one of the values listed in the previous section.</p>
</dd>
</dl>
<p class="para">Notice that these exceptions are not defined in the specification of the package. Instead, ALTER_COMPILE simply calls RAISE_APPLICATION_ERROR with one of the above error numbers. These error numbers may therefore conflict with your own -20NNN error number usages. If you embed calls to ALTER_COMPILE inside your application or utility, watch out for the confusion such conflicts can cause.</p>
<p class="para">
<p><strong>Custom Script Using EXECUTE IMMEDIATE</strong></p>
<blockquote><p>CREATE OR REPLACE PROCEDURE recompile_object<br />
AS<br />
CURSOR my_cur<br />
IS<br />
SELECT   *<br />
FROM dba_objects<br />
WHERE status = &#8216;INVALID&#8217;<br />
ORDER BY owner, object_type, object_name;<br />
BEGIN<br />
FOR cur IN my_cur<br />
LOOP<br />
BEGIN<br />
IF cur.object_type = &#8216;PACKAGE BODY&#8217;<br />
THEN<br />
EXECUTE IMMEDIATE    &#8216;ALTER PACKAGE &#8216;<br />
|| cur.owner<br />
|| &#8216;.&#8217;<br />
|| cur.object_name<br />
|| &#8216; COMPILE BODY&#8217;;<br />
ELSE<br />
EXECUTE IMMEDIATE    &#8216;ALTER &#8216;<br />
|| cur.object_type<br />
|| &#8216; &#8216;<br />
|| cur.owner<br />
|| &#8216;.&#8217;<br />
|| cur.object_name<br />
|| &#8216; COMPILE&#8217;;<br />
END IF;<br />
EXCEPTION<br />
WHEN OTHERS<br />
THEN<br />
DBMS_OUTPUT.put_line (SQLERRM);<br />
DBMS_OUTPUT.put_line (   cur.object_type<br />
|| &#8216; : &#8216;<br />
|| cur.owner<br />
|| &#8216; : &#8216;<br />
|| cur.object_name<br />
);<br />
END;<br />
END LOOP;<br />
EXCEPTION<br />
WHEN OTHERS<br />
THEN<br />
DBMS_OUTPUT.put_line (SQLERRM);<br />
END recompile_object;<br />
/<br />
<strong></strong></p></blockquote>
<p><strong><br />
</strong></p>
Posted in Oracle Tagged: development, performance, query <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=345&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2009/01/07/recompile-invalid-objects-using-dbms_ddl-or-custom-script-using-execute-immediate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>
	</item>
		<item>
		<title>Reducing Loop Overhead for DML Statements and Queries (FORALL,BULK COLLECT)</title>
		<link>http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/#comments</comments>
		<pubDate>Thu, 31 May 2007 03:49:04 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/</guid>
		<description><![CDATA[PL/SQL sends SQL statements such as DML and queries to the SQL engine for execution, and SQL returns the result data to PL/SQL. You can minimize the performance overhead of this communication between PL/SQL and SQL by using the PL/SQL language features known collectively as bulk SQL. The FORALL statement sends INSERT, UPDATE, or DELETE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=61&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>PL/SQL sends SQL statements such as DML and queries to the SQL engine for execution, and SQL returns the result data to PL/SQL. You can minimize the performance overhead of this communication between PL/SQL and SQL by using the PL/SQL language features known collectively as bulk SQL. The <strong>FORALL </strong>statement sends <em>INSERT</em>, <em>UPDATE</em>, or <em>DELETE </em>statements in batches, rather than one at a time. The <strong>BULK COLLECT</strong> clause brings back batches of results from SQL. If the DML statement affects four or more database rows, the use of bulk SQL can improve performance considerably.<span id="more-61"></span></p>
<ul>
<li><strong><em>Using the FORALL Statement</em></strong>, the keyword <strong>FORALL </strong>lets you run multiple DML statements very efficiently. It can only repeat a single DML statement, unlike a general-purpose <em>FOR </em>loop.<br />
The following example loads some data into PL/SQL collections. Then it inserts the<br />
collection elements into a database table twice: first using a <em>FOR </em>loop, then using a<br />
<strong>FORALL </strong>statement. The <strong>FORALL </strong>version is much faster.<br />
<a href="http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/for-all/" target="_blank" rel="attachment wp-att-62" title="For All"><img src="http://ediyanto83.files.wordpress.com/2007/05/forall.jpg" alt="For All" /><br />
</a></li>
<li><strong>Retrieving Query Results into Collections with the BULK COLLECT Clause, </strong>using the keywords <strong>BULK COLLECT </strong>with a query is a very efficient way to retrieve the result set. Instead of looping through each row, you store the results in one or more collections, in a single operation. You can use these keywords in the <em>SELECT INTO</em> and <em>FETCH INTO</em> statements, and the <em>RETURNING INTO</em> clause.With the <strong>BULK COLLECT</strong> clause, all the variables in the <strong>INTO</strong> list must be collections. The table columns can hold scalar or composite values, including object types. The following example loads two entire database columns into nested tables:<a href="http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/bulk-collect-clause/" target="_blank" rel="attachment wp-att-64" title="Bulk Collect Clause"><img src="http://ediyanto83.files.wordpress.com/2007/05/bulk_collect_clause.jpg" alt="Bulk Collect Clause" /></a></li>
</ul>
<p><font size="2">source: <em>PL/SQL User&#8217;s Guide and Reference 10g Release 1 (10.1)</em></font></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/61/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/61/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=61&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/31/reducing-loop-overhead-for-dml-statements-and-queries-forallbulk-collect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/forall.jpg" medium="image">
			<media:title type="html">For All</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/bulk_collect_clause.jpg" medium="image">
			<media:title type="html">Bulk Collect Clause</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic SQL with RETURNING BULK COLLECT INTO Clause</title>
		<link>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-returning-bulk-collect-into-clause/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-returning-bulk-collect-into-clause/#comments</comments>
		<pubDate>Fri, 25 May 2007 10:00:40 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-returning-bulk-collect-into-clause/</guid>
		<description><![CDATA[Only INSERT, UPDATE, and DELETE statements can have output bind variables. You bulk-bind them with the RETURNING BULK COLLECT INTO clause of EXECUTE IMMEDIATE. With this clause, you can see which data have been inserted, updated or deleted.

Example:
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=56&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Only INSERT, UPDATE, and DELETE statements can have output bind variables. You bulk-bind them with the RETURNING BULK COLLECT INTO clause of EXECUTE IMMEDIATE. With this clause, you can see which data have been inserted, updated or deleted.</p>
<p><span id="more-56"></span><br />
Example:<a href="http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-returning-bulk-collect-into-clause/bulk_returningjpg/" rel="attachment wp-att-57" title="bulk_returning.jpg"><img src="http://ediyanto83.files.wordpress.com/2007/05/bulk_returning.jpg" alt="bulk_returning.jpg" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/56/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/56/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=56&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-returning-bulk-collect-into-clause/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/bulk_returning.jpg" medium="image">
			<media:title type="html">bulk_returning.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic SQL with BULK COLLECT INTO Clause</title>
		<link>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-bulk-collect-into-clause/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-bulk-collect-into-clause/#comments</comments>
		<pubDate>Fri, 25 May 2007 08:48:40 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-bulk-collect-into-clause/</guid>
		<description><![CDATA[Bulk SQL passes entire collections back and forth, not just individual elements. This technique improves performance by minimizing the number of context switches between the PL/SQL and SQL engines. You can use a single statement instead of aloop that issues a SQL statement in every iteration.
Bulk binding lets Oracle bind a variable in a SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=52&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Bulk SQL passes entire collections back and forth, not just individual elements. This technique improves performance by minimizing the number of context switches between the PL/SQL and SQL engines. You can use a single statement instead of aloop that issues a SQL statement in every iteration.</p>
<p>Bulk binding lets Oracle bind a variable in a SQL statement to a collection of values. The collection type can be any PL/SQL collection type (index-by table, nested table, or varray). The collection elements must have a SQL datatype such as CHAR, DATE, or NUMBER.<br />
<span id="more-52"></span>You can bind define variables in a dynamic query using the BULK COLLECT INTO clause. As the following example shows, you can use that clause in a bulk FETCH or bulk EXECUTE IMMEDIATE statement:</p>
<p><a href="http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-bulk-collect-into-clause/bulk_immediate_fetchjpg/" rel="attachment wp-att-55" title="bulk_immediate_fetch.jpg"><img src="http://ediyanto83.files.wordpress.com/2007/05/bulk_immediate_fetch.jpg" alt="bulk_immediate_fetch.jpg" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=52&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/25/dynamic-sql-with-bulk-collect-into-clause/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/bulk_immediate_fetch.jpg" medium="image">
			<media:title type="html">bulk_immediate_fetch.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Assigning Nested Tables with Set Operators</title>
		<link>http://ediyanto83.wordpress.com/2007/05/16/assigning-nested-tables-with-set-operators/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/16/assigning-nested-tables-with-set-operators/#comments</comments>
		<pubDate>Wed, 16 May 2007 02:54:56 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/16/assigning-nested-tables-with-set-operators/</guid>
		<description><![CDATA[The SQL language has long offered the ability to apply set operations (UNION, INTERSECT, and MINUS) to the result sets of queries. In Oracle Database 10g, you can now use those same high-level, very powerful operators against nested tables (and only nested tables) in your PL/SQL programs and on nested tables declared as columns inside [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=40&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span class="bodycopy"></span><span class="bodycopy">The SQL language has long offered the ability to apply set operations (</span><tt>UNION, INTERSECT</tt><span class="bodycopy">, and </span><tt>MINUS</tt><span class="bodycopy">) to the result sets of queries. In Oracle Database 10<em>g</em>, you can now use those same high-level, very powerful operators against nested tables (and only nested tables) in your PL/SQL programs and on nested tables declared as columns inside relational tables.</span></p>
<p>Nested Table Function:</p>
<ul>
<li><strong>MULTISET UNION</strong>, all elements in both nested table x and nested table y are returned.  If tables x and y are both empty then the returned table will be empty.</li>
<li><strong>MULTISET INTERSECT</strong>, elements in nested table x that also appear in nested table y are returned. If tables x and y have no common elements the returned table will be empty.</li>
<li><strong>MULTISET EXCEPT</strong>, elements in nested table x that do not appear in nested table y are returned. If table x has no elements that are not in table y the returned table will be empty.</li>
<li><strong>SUBMULTISET OF</strong> and <strong>NOT SUBMULTISET OF</strong> compare two nested tables to determine if all elements in the first nested table also appear in second nested table. This function returns a Boolean value TRUE, FALSE or NULL. The key word OF is optional.</li>
</ul>
<p><span id="more-40"></span>The <strong>DISTINCT </strong>keyword in nested table function (MULTISET UNION, MULTISET INTERSECT, MULTISET EXCEPT)  eliminates duplicate elements from the results. Nested table x, y and the returned table must all be of the same type. If either x or y is null, then the returned table is null.</p>
<p><a href="http://ediyanto83.wordpress.com/2007/05/16/assigning-nested-tables-with-set-operators/nested_table_functionjpg/" rel="attachment wp-att-46" title="nested_table_function.jpg"><img src="http://ediyanto83.files.wordpress.com/2007/05/nested_table_function.jpg" alt="nested_table_function.jpg" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=40&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/16/assigning-nested-tables-with-set-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/nested_table_function.jpg" medium="image">
			<media:title type="html">nested_table_function.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Possible Exceptions for Collection Assignments</title>
		<link>http://ediyanto83.wordpress.com/2007/05/15/possible-exceptions-for-collection-assignments/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/15/possible-exceptions-for-collection-assignments/#comments</comments>
		<pubDate>Tue, 15 May 2007 05:23:05 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/15/possible-exceptions-for-collection-assignments/</guid>
		<description><![CDATA[Assigning a value to a collection element can cause various exceptions:

If the subscript is null or is not convertible to the right datatype, PL/SQL raises the predefined exception VALUE_ERROR. Usually, the subscript must be an integer. Associative arrays can also be declared to have VARCHAR2 subscripts.
 If the subscript refers to an uninitialized element, PL/SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=38&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Assigning a value to a collection element can cause various exceptions:</p>
<ul>
<li>If the subscript is null or is not convertible to the right datatype, PL/SQL raises the predefined exception <strong>VALUE_ERROR</strong>. Usually, the subscript must be an integer. Associative arrays can also be declared to have VARCHAR2 subscripts.</li>
<li> If the subscript refers to an uninitialized element, PL/SQL raises <strong>SUBSCRIPT_BEYOND_COUNT</strong>.</li>
<li>If the collection is atomically null, PL/SQL raises <strong>COLLECTION_IS_NULL</strong> (Refence to uninitialized collection).</li>
</ul>
<p><span id="more-38"></span><a href="http://ediyanto83.wordpress.com/2007/05/15/possible-exceptions-for-collection-assignments/exceptions-for-collections/" rel="attachment wp-att-39" title="Exceptions for Collections"><img src="http://ediyanto83.files.wordpress.com/2007/05/collections.jpg" alt="Exceptions for Collections" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=38&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/15/possible-exceptions-for-collection-assignments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/05/collections.jpg" medium="image">
			<media:title type="html">Exceptions for Collections</media:title>
		</media:content>
	</item>
		<item>
		<title>Exit Early from Nested FOR Loop</title>
		<link>http://ediyanto83.wordpress.com/2007/05/14/exit-early-from-nested-for-loop/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/14/exit-early-from-nested-for-loop/#comments</comments>
		<pubDate>Mon, 14 May 2007 09:49:41 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/14/exit-early-from-nested-for-loop/</guid>
		<description><![CDATA[If you want to exit from any enclosing loop, but not just the current loop, you can label the enclosing loop and use the label in an EXIT statement.
&#60;&#60;outer&#62;&#62;
FOR i IN 1..5 LOOP
. . . . .
FOR j IN 1..10 LOOP
. . . . .
EXIT outer WHEN . . . .
. . . . .
END [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=37&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you want to exit from any enclosing loop, but not just the current loop, you can label the enclosing loop and use the label in an <strong>EXIT </strong>statement.</p>
<p>&lt;&lt;outer&gt;&gt;<br />
FOR i IN 1..5 LOOP<br />
. . . . .<br />
FOR j IN 1..10 LOOP<br />
. . . . .<br />
EXIT outer WHEN . . . .<br />
. . . . .<br />
END LOOP;<br />
END LOOP outer;<br />
. . . . .</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=37&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/14/exit-early-from-nested-for-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>
	</item>
		<item>
		<title>Tuning PL/SQL Procedure Calls with the NOCOPY Compiler Hint</title>
		<link>http://ediyanto83.wordpress.com/2007/05/01/tuning-plsql-procedure-calls-with-the-nocopy-compiler-hint/</link>
		<comments>http://ediyanto83.wordpress.com/2007/05/01/tuning-plsql-procedure-calls-with-the-nocopy-compiler-hint/#comments</comments>
		<pubDate>Tue, 01 May 2007 07:20:52 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/05/01/tuning-plsql-procedure-calls-with-the-nocopy-compiler-hint/</guid>
		<description><![CDATA[NOCOPY is a hint to the compiler about how you would like the PL/SQL engine to work with the data structure being passed in as an OUT or IN OUT parameter. By default, OUT and IN OUT parameters are passed by value. The values of any IN OUT parameters are copied before the subprogram is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=35&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>NOCOPY </strong>is a hint to the compiler about how you would like the PL/SQL engine to work with the data structure being passed in as an OUT or IN OUT parameter. By default, OUT and IN OUT parameters are passed by value. The values of any IN OUT parameters are copied before the subprogram is executed. During subprogram execution, temporary variables hold the output parameter values. If the subprogram exits normally, these values are copied to the actual parameters. If the subprogram exits with an unhandled exception, the original parameters are unchanged.</p>
<p>When the parameters represent large data structures such as collections, records, and<br />
instances of object types, this copying slows down execution and uses up memory. In<br />
particular, this overhead applies to each call to an object method: temporary copies are<br />
made of all the attributes, so that any changes made by the method are only applied if<br />
the method exits normally.</p>
<p><span id="more-35"></span> To avoid this overhead, you can specify the <strong>NOCOPY </strong>hint, which allows the PL/SQL<br />
compiler to pass OUT and IN OUT parameters by reference. If the subprogram exits<br />
normally, the behavior is the same as normal. If the subprogram exits early with an<br />
exception, the values of OUT and IN OUT parameters (or object attributes) might still<br />
change. To use this technique, ensure that the subprogram handles all exceptions.<br />
A call to the procedure that uses <strong>NOCOPY </strong>makes much less time.</p>
<p>DECLARE<br />
TYPE EmpTabTyp IS TABLE OF emp%ROWTYPE;<br />
emp_tab EmpTabTyp := EmpTabTyp(NULL); &#8212; initialize<br />
t1 NUMBER;<br />
t2 NUMBER;<br />
t3 NUMBER;<br />
PROCEDURE get_time (t OUT NUMBER) IS<br />
BEGIN t := dbms_utility.get_time; END;<br />
PROCEDURE do_nothing1 (tab IN OUT EmpTabTyp) IS<br />
BEGIN NULL; END;<br />
PROCEDURE do_nothing2 (tab IN OUT NOCOPY EmpTabTyp) IS<br />
BEGIN NULL; END;<br />
BEGIN<br />
SELECT * INTO emp_tab(1) FROM emp where rownum &lt;= 1;<br />
emp_tab.EXTEND(49999, 1); &#8212; copy element 1 into 2..50000<br />
get_time(t1);<br />
do_nothing1(emp_tab); &#8212; pass IN OUT parameter<br />
get_time(t2);<br />
do_nothing2(emp_tab); &#8212; pass IN OUT NOCOPY parameter<br />
get_time(t3);<br />
dbms_output.put_line(&#8216;Call Duration (secs)&#8217;);<br />
dbms_output.put_line(&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8217;);<br />
dbms_output.put_line(&#8216;Just IN OUT: &#8216; || TO_CHAR((t2 &#8211; t1)/100.0));<br />
dbms_output.put_line(&#8216;With NOCOPY: &#8216; || TO_CHAR((t3 &#8211; t2))/100.0);<br />
END;</p>
<p><strong>Result:</strong><br />
Call Duration (secs)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Just IN OUT: .22<br />
With NOCOPY: 0</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=35&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/05/01/tuning-plsql-procedure-calls-with-the-nocopy-compiler-hint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>
	</item>
		<item>
		<title>Suppress Duplicate Values in Oracle</title>
		<link>http://ediyanto83.wordpress.com/2007/04/18/suppress-duplicate-values-in-oracle/</link>
		<comments>http://ediyanto83.wordpress.com/2007/04/18/suppress-duplicate-values-in-oracle/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 02:48:09 +0000</pubDate>
		<dc:creator>Edi Yanto</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://ediyanto83.wordpress.com/2007/04/18/suppress-duplicate-values-in-oracle/</guid>
		<description><![CDATA[In the below example, we can suppress duplicate values in the MGR column, display a blank line between manager number groups, and suppress the display of repeated values in the DEPTNO column using the BREAK command.
SQL&#62; BREAK ON mgr SKIP 1 ON deptno
when the query executes, the report output is organized based on the specifications [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=32&subd=ediyanto83&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In the below example, we can suppress duplicate values in the <em>MGR </em>column, display a blank line between manager number groups, and suppress the display of repeated values in the <em>DEPTNO </em>column using the <strong>BREAK </strong>command.</p>
<p><strong>SQL&gt; BREAK ON mgr SKIP 1 ON deptno<br />
</strong>when the query executes, the report output is organized based on the specifications you made in the <strong>BREAK </strong>command.</p>
<p><img class="alignnone size-full wp-image-33" src="http://ediyanto83.files.wordpress.com/2007/04/break_command.jpg?w=345&#038;h=495" alt="" width="345" height="495" /></p>
<p><a title="break_command.jpg" rel="attachment wp-att-33" href="http://ediyanto83.wordpress.com/2007/04/18/suppress-duplicate-values-in-oracle/break_commandjpg/"></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ediyanto83.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ediyanto83.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ediyanto83.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ediyanto83.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ediyanto83.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ediyanto83.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ediyanto83.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ediyanto83.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ediyanto83.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ediyanto83.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ediyanto83.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ediyanto83.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ediyanto83.wordpress.com&blog=848929&post=32&subd=ediyanto83&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ediyanto83.wordpress.com/2007/04/18/suppress-duplicate-values-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a46483722032898c6cbfab66b430a214?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Edi</media:title>
		</media:content>

		<media:content url="http://ediyanto83.files.wordpress.com/2007/04/break_command.jpg" medium="image" />
	</item>
	</channel>
</rss>