<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>Ora-06502: Oracle scripts and errors</title>
	<link>http://www.ora-06502.com</link>
	<description></description>
	<pubDate>Tue, 17 Jun 2008 10:21:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>How to solve oracle errors such as ora-06502</title>
		<link>http://www.ora-06502.com/uncategorized/how-to-solve-oracle-errors-such-as-ora-06502</link>
		<comments>http://www.ora-06502.com/uncategorized/how-to-solve-oracle-errors-such-as-ora-06502#comments</comments>
		<pubDate>Tue, 17 Jun 2008 10:21:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ora-06502.com/uncategorized/how-to-solve-oracle-errors-such-as-ora-06502</guid>
		<description><![CDATA[When we are programming and we get an oracle error, we can capture this error in an exception block. Within this block, we could use the variable sqlerrm in order to know its description.
Here it is an example:
 declare
tmp varchar2(10);
begin
tmp:=&#8217;aaaaaaaaaaaaaa&#8217;;
exception
when others then
dbms_output.put_line(sqlcode&#124;&#124;&#8217;&#8211;&#62;&#8217;&#124;&#124;sqlerrm);
end; 
In this example, we have forced an ora-06502 error and we have captured [...]]]></description>
			<content:encoded><![CDATA[<p>When we are programming and we get an oracle error, we can capture this error in an exception block. Within this block, we could use the variable sqlerrm in order to know its description.</p>
<p>Here it is an example:</p>
<blockquote><p><em> declare<br />
tmp varchar2(10);<br />
begin<br />
tmp:=&#8217;aaaaaaaaaaaaaa&#8217;;<br />
exception<br />
when others then<br />
dbms_output.put_line(sqlcode||&#8217;&#8211;&gt;&#8217;||sqlerrm);<br />
end; </em></p></blockquote>
<p>In this example, we have forced an ora-06502 error and we have captured it with the clause &#8220;when others&#8221;. We obtain the code with the internal variable  <strong>sqlcode</strong> and we can obtain its description using the internal variable <strong><em>sqlerrm</em>.</strong></p>
<p>I hope you enjoyed it.</p>
<p> <img src='http://www.ora-06502.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-06502.com/uncategorized/how-to-solve-oracle-errors-such-as-ora-06502/feed</wfw:commentRss>
		</item>
		<item>
		<title>Creating tables</title>
		<link>http://www.ora-06502.com/scripts/creating-tables</link>
		<comments>http://www.ora-06502.com/scripts/creating-tables#comments</comments>
		<pubDate>Mon, 11 Feb 2008 09:16:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.ora-06502.com/?p=9</guid>
		<description><![CDATA[To create a new table in our database, we use the CREATE TABLE statement. It&#8217;s very similar to the sentence in oder database systems. But in Oracle we can specify some Oracle specific features such as the storage or the tablespace.
Here it is an example of use of the CREATE TABLE statement.
CREATE TABLE AYUDA
(
ID NUMBER(10) [...]]]></description>
			<content:encoded><![CDATA[<p>To create a new table in our database, we use the CREATE TABLE statement. It&#8217;s very similar to the sentence in oder database systems. But in Oracle we can specify some Oracle specific features such as the storage or the tablespace.</p>
<p>Here it is an example of use of the CREATE TABLE statement.</p>
<p>CREATE TABLE AYUDA<br />
(<br />
ID NUMBER(10) NOT NULL,<br />
FIELD1 NUMBER(10),<br />
FIELD2 VARCHAR2(250 BYTE)<br />
)<br />
TABLESPACE myTablespace<br />
PCTUSED    0<br />
PCTFREE    10<br />
INITRANS   1<br />
MAXTRANS   255<br />
STORAGE    (<br />
INITIAL          64K<br />
MINEXTENTS       1<br />
MAXEXTENTS       2147483645<br />
PCTINCREASE      0<br />
BUFFER_POOL      DEFAULT<br />
)<br />
LOGGING<br />
NOCACHE<br />
NOPARALLEL<br />
MONITORING;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-06502.com/scripts/creating-tables/feed</wfw:commentRss>
		</item>
		<item>
		<title>Revoking privileges</title>
		<link>http://www.ora-06502.com/scripts/revoking-privileges</link>
		<comments>http://www.ora-06502.com/scripts/revoking-privileges#comments</comments>
		<pubDate>Fri, 11 Jan 2008 11:29:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.ora-06502.com/?p=7</guid>
		<description><![CDATA[We can revoke priviliges on tables and functions/procedures using REVOKE. Let’s see a couple of example to better understand it.
We can revoke privileges for common DML statements (select, insert, update and delete). We use sentences like this:
REVOKE select, insert ON mytable FROM myuser;
We can also revoke privileges for some DDL statements. If we want to [...]]]></description>
			<content:encoded><![CDATA[<p class="entry">We can revoke priviliges on tables and functions/procedures using <strong>REVOKE</strong>. Let’s see a couple of example to better understand it.</p>
<p>We can revoke privileges for common DML statements (select, insert, update and delete). We use sentences like this:</p>
<blockquote><p><em>REVOKE select, insert ON mytable FROM myuser;</em></p></blockquote>
<p>We can also revoke privileges for some DDL statements. If we want to let an user modify the structure of a table, we use a sentence like this:</p>
<blockquote><p><em> REVOKE alter ON mytable FROM myuser; </em></p></blockquote>
<p>Another use of the REVOKE sentence is to remove permission to execute procedures and functions.</p>
<blockquote><p><em>REVOKE execute ON myfunction FROM myuser;</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-06502.com/scripts/revoking-privileges/feed</wfw:commentRss>
		</item>
		<item>
		<title>Granting privileges</title>
		<link>http://www.ora-06502.com/scripts/granting-privileges</link>
		<comments>http://www.ora-06502.com/scripts/granting-privileges#comments</comments>
		<pubDate>Mon, 07 Jan 2008 08:18:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.ora-06502.com/?p=6</guid>
		<description><![CDATA[We can grant priviliges on tables and functions/procedures using GRANT. Let&#8217;s see a couple of example to better understand it.
We can grant privileges for common DML statements (select, insert, update and delete). We use sentences like this:
GRANT select, insert ON mytable TO myuser;
We can also grant privileges for some DDL statements. If we want to [...]]]></description>
			<content:encoded><![CDATA[<p>We can grant priviliges on tables and functions/procedures using GRANT. Let&#8217;s see a couple of example to better understand it.</p>
<p>We can grant privileges for common DML statements (select, insert, update and delete). We use sentences like this:</p>
<blockquote><p><em>GRANT select, insert ON mytable TO myuser;</em></p></blockquote>
<p>We can also grant privileges for some DDL statements. If we want to let an user modify the structure of a table, we use a sentence like this:</p>
<blockquote><p><em> GRANT alter ON mytable TO myuser; </em></p></blockquote>
<p>Another use of the GRANT sentence is to give permission to execute procedures and functions.</p>
<blockquote><p><em>GRANT execute ON myfunction TO myuser;</em></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-06502.com/scripts/granting-privileges/feed</wfw:commentRss>
		</item>
		<item>
		<title>ORA-06502 PL/SQL: numeric or value error</title>
		<link>http://www.ora-06502.com/scripts/ora-06502-plsql-numeric-or-value-error</link>
		<comments>http://www.ora-06502.com/scripts/ora-06502-plsql-numeric-or-value-error#comments</comments>
		<pubDate>Mon, 17 Dec 2007 11:21:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.ora-06502.com/?p=4</guid>
		<description><![CDATA[This error message is very tricky. Here, you can learn how to solve it.

The main cause that produces this message is that you are assigning a value NULL to a variable that does not admit it.
DECLARE
N1 number(2) NOT NULL :=20;
N2 number(2);
BEGIN
N1 := N2;
END;
Another possible cause is that you are assigning a number to a variable [...]]]></description>
			<content:encoded><![CDATA[<p>This error message is very tricky. Here, you can learn how to solve it.</p>
<ol>
<li>The main cause that produces this message is that you are assigning a value NULL to a variable that does not admit it.</li>
<p>DECLARE<br />
N1 number(2) NOT NULL :=20;<br />
N2 number(2);<br />
BEGIN<br />
N1 := N2;<br />
END;</p>
<li>Another possible cause is that you are assigning a number to a variable and its size is to small to hold that value.</li>
<p>DECLARE<br />
N NUMBER(2);<br />
BEGIN<br />
N:= 100;<br />
END;</p>
<li>Sometimes, you get that error message when you concatenate two strings and the result is assigned to a variable too small.</li>
<p>DECLARE<br />
C1 varchar2(10) ;<br />
C2 varchar2(7);<br />
BEGIN<br />
C1:=&#8217;This is an&#8217;;<br />
C2:=&#8217; error.&#8217;<br />
C1 :=C1||C2 ;<br />
END;</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ora-06502.com/scripts/ora-06502-plsql-numeric-or-value-error/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
