<?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/"
	>

<channel>
	<title>Furo&#039;s World &#187; Data bases</title>
	<atom:link href="http://www.furo.fr/category/data-bases/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.furo.fr</link>
	<description>Welcome to my piece of web!</description>
	<lastBuildDate>Fri, 15 Jul 2011 08:59:33 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>A 120.000$ easter egg!</title>
		<link>http://www.furo.fr/2008/04/06/a-120000-easter-egg/</link>
		<comments>http://www.furo.fr/2008/04/06/a-120000-easter-egg/#comments</comments>
		<pubDate>Sun, 06 Apr 2008 19:28:43 +0000</pubDate>
		<dc:creator>Flotueur</dc:creator>
				<category><![CDATA[Data bases]]></category>
		<category><![CDATA[Video Games]]></category>
		<category><![CDATA[easter egg]]></category>
		<category><![CDATA[Legend of Zelda]]></category>
		<category><![CDATA[trailer]]></category>

		<guid isPermaLink="false">http://www.furo.fr/2008/04/06/a-120000-easter-egg/</guid>
		<description><![CDATA[Honestly, i&#8217;d like it was true :p But this trailer produced by IGN and released on the 1st of April is nothing more than an easter egg&#8230; And a big one because the production of that trailer costed 120.000$ !! Here is the link of the Legend of Zelda trailer, enjoy]]></description>
			<content:encoded><![CDATA[<p align="left"><img src="http://www.furo.fr/wp-content/zelda64oot_imagenotice1.thumbnail.jpg" alt="Zelda Ocarine Of Time" hspace="10" vspace="10" align="left" />Honestly, i&#8217;d like it was true :p</p>
<p>But this trailer produced by <strong>IGN </strong>and released on the <strong>1st of April</strong> is nothing more than an <strong>easter egg</strong>&#8230; And a big one because the production of that trailer costed <strong>120.000$</strong> !!</p>
<p><a href="http://www.dailymotion.com/video/x4xawt_legend-of-zelda-film-movie_videogames">Here </a>is the link of the <strong>Legend of Zelda</strong> trailer, enjoy <img src='http://www.furo.fr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.furo.fr/2008/04/06/a-120000-easter-egg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ORA-06553: PLS-382: expression is of wrong type</title>
		<link>http://www.furo.fr/2008/03/28/ora-06553-pls-382-expression-is-of-wrong-type/</link>
		<comments>http://www.furo.fr/2008/03/28/ora-06553-pls-382-expression-is-of-wrong-type/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 14:55:13 +0000</pubDate>
		<dc:creator>Flotueur</dc:creator>
				<category><![CDATA[Data bases]]></category>
		<category><![CDATA[ORA-06553]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[pl/sql]]></category>

		<guid isPermaLink="false">http://www.furo.fr/2008/03/28/ora-06553-pls-382-expression-is-of-wrong-type/</guid>
		<description><![CDATA[When you deal with PL/SQL functions, you have sometimes to create a function returning a boolean. This is an example: CREATE OR REPLACE FUNCTION I_AM_A_HERO ( name VARCHAR2) RETURN BOOLEAN is BEGIN if (name = 'Petrelli') THEN RETURN TRUE; ELSE RETURN FALSE; END IF; END; But if you wan&#8217;t to execute it like any other [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.furo.fr/wp-content/oracle1.thumbnail.gif" alt="Oracle Logo" align="left" hspace="10" vspace="10" />When you deal with <strong>PL/SQL</strong> functions, you have sometimes to create a function returning a <strong>boolean</strong>.</p>
<p>This is an example:</p>
<blockquote><p><code>CREATE OR REPLACE FUNCTION I_AM_A_HERO (</code><br />
<code> name VARCHAR2) RETURN BOOLEAN is</code><br />
<code> BEGIN</code><br />
<code> if (name = 'Petrelli') THEN</code><br />
<code> RETURN TRUE;</code><br />
<code> ELSE</code><br />
<code> RETURN FALSE;</code><br />
<code> END IF;</code><br />
<code> END;</code></p></blockquote>
<p>But if you wan&#8217;t to <strong>execute </strong>it like any other PL/SQL function you get that:</p>
<blockquote><p><code>&gt;SELECT I_AM_A_HERO('Petrelli') FROM dual;<br />
ORA-06552: PL/SQL: Statement ignored<br />
ORA-06553: PLS-382: expression is of wrong type</code></p></blockquote>
<p>Why do we have this error? Oracle proposes a <strong>boolean </strong>type for the PL/SQL functions BUT<strong> this type is not implemented</strong> in SQL so basically, you don&#8217;t have the right to do that! However that also means that you <strong>can use</strong> your function <strong>into a PL/SQL block</strong> (of course, it would be meaningless otherwise!). So you can call you function like that:</p>
<blockquote><p><code>DECLARE</code><br />
<code> RESULT BOOLEAN;</code><br />
<code> BEGIN</code><br />
<code> IF (I_AM_A_HERO('Petrelli')) THEN</code><br />
<code> RETURN 1;</code><br />
<code> ELSE</code><br />
<code> RETURN 0;</code><br />
<code> END IF;</code><br />
<code> END;</code></p></blockquote>
<p>Now that you have a good overview of the problem, the solution is obvious. Instead of bothering making a PL/SQL block to access the function, we just have to <strong>change the return type</strong>:</p>
<blockquote><p><code>CREATE OR REPLACE FUNCTION I_AM_A_HERO (<br />
name VARCHAR2) RETURN NUMBER is<br />
BEGIN<br />
if (name = 'Petrelli') THEN<br />
RETURN 1;<br />
ELSE<br />
RETURN 0;<br />
END IF;<br />
END;</code></p></blockquote>
<p>And we get:</p>
<blockquote><p><code>&gt;SELECT I_AM_A_HERO('Petrelli') FROM dual;</code><br />
<code>I_AM_A_HERO('PETRELLI')<br />
-----------------------<br />
1</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.furo.fr/2008/03/28/ora-06553-pls-382-expression-is-of-wrong-type/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

