<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: &#9733; Why WHEN OTHERS THEN RAISE Can Be Harmful</title>
	<atom:link href="http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/feed/" rel="self" type="application/rss+xml" />
	<link>http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/</link>
	<description>News, views, tips and tricks on Oracle and other fun stuff</description>
	<lastBuildDate>Mon, 21 May 2012 00:26:47 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/comment-page-1/#comment-53426</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Sun, 03 May 2009 01:40:10 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=1089#comment-53426</guid>
		<description>&lt;p&gt;@Mihajlo I have just dug up your comment from the spam queue. I have no idea why it got stuck there.&lt;/p&gt;

&lt;p&gt;You&#039;re right, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE can be very useful ... when used. I even wrote a &lt;a href=&quot;http://awads.net/wp/2006/07/25/how-to-find-where-an-error-was-raised-in-plsql/&quot; rel=&quot;nofollow&quot;&gt;post about it&lt;/a&gt; a while ago.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Mihajlo I have just dug up your comment from the spam queue. I have no idea why it got stuck there.</p>

<p>You&#8217;re right, DBMS_UTILITY.FORMAT_ERROR_BACKTRACE can be very useful &#8230; when used. I even wrote a <a href="http://awads.net/wp/2006/07/25/how-to-find-where-an-error-was-raised-in-plsql/" rel="nofollow">post about it</a> a while ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/comment-page-1/#comment-53425</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Fri, 17 Apr 2009 03:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=1089#comment-53425</guid>
		<description>&lt;p&gt;@Justis LOL!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Justis LOL!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justis</title>
		<link>http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/comment-page-1/#comment-53424</link>
		<dc:creator>Justis</dc:creator>
		<pubDate>Thu, 16 Apr 2009 19:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=1089#comment-53424</guid>
		<description>&lt;p&gt;Amen.  I think it is a manifestation of masochism or schadenfreude, depending on the individual. :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Amen.  I think it is a manifestation of masochism or schadenfreude, depending on the individual. <img src='http://awads.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihajlo Tekic</title>
		<link>http://awads.net/wp/2009/04/14/why-when-others-then-raise-can-be-harmful/comment-page-1/#comment-53423</link>
		<dc:creator>Mihajlo Tekic</dc:creator>
		<pubDate>Wed, 15 Apr 2009 14:42:56 +0000</pubDate>
		<guid isPermaLink="false">http://awads.net/wp/?p=1089#comment-53423</guid>
		<description>&lt;p&gt;Hi Eddie,&lt;/p&gt;

&lt;p&gt;I agree that WHEN OTHERS THEN RAISE hides the bug. However if used with DBMS_UTILITY.FORMAT_ERROR_BACKTRACE (available from 10.1.x) and DBMS_UTILITY.FORMAT_ERROR_STACK, one can still get the line where the error occurred.&lt;/p&gt;

&lt;p&gt;Example&lt;/p&gt;

&lt;pre&gt;
SQL&gt;  DECLARE
  2       l_var   varchar2 (30);
  3    BEGIN
  4       SELECT   object_name
  5         INTO   l_var
  6         FROM   all_objects
  7        WHERE   ROWNUM &lt;= 2;
  8    EXCEPTION
  9        WHEN OTHERS
 10        THEN
 11      DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_stack());
 12      DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_backtrace());
 13           RAISE;
 14*   END;
SQL&gt; /
&lt;b&gt;ORA-01422: exact fetch returns more than requested number of rows

ORA-06512: at line 4 &lt;i&gt;&lt;== DBMS_UTILITY.FORMAT_ERROR_BACKTRACE output&lt;/i&gt;&lt;/b&gt;

DECLARE
*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 13


SQL&gt;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Eddie,</p>

<p>I agree that WHEN OTHERS THEN RAISE hides the bug. However if used with DBMS_UTILITY.FORMAT_ERROR_BACKTRACE (available from 10.1.x) and DBMS_UTILITY.FORMAT_ERROR_STACK, one can still get the line where the error occurred.</p>

<p>Example</p>

<pre>
SQL&gt;  DECLARE
  2       l_var   varchar2 (30);
  3    BEGIN
  4       SELECT   object_name
  5         INTO   l_var
  6         FROM   all_objects
  7        WHERE   ROWNUM &#60;= 2;
  8    EXCEPTION
  9        WHEN OTHERS
 10        THEN
 11      DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_stack());
 12      DBMS_OUTPUT.PUT_LINE(DBMS_UTILITY.format_error_backtrace());
 13           RAISE;
 14*   END;
SQL&gt; /
<b>ORA-01422: exact fetch returns more than requested number of rows

ORA-06512: at line 4 <i>&lt;== DBMS_UTILITY.FORMAT_ERROR_BACKTRACE output</i></b>

DECLARE
*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 13


SQL&gt;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

