<?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>BrockN.com</title>
	<atom:link href="http://brockn.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://brockn.com</link>
	<description>The Official Blog of Brock</description>
	<lastBuildDate>Thu, 15 Dec 2011 02:32:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to Create a Sequence in Oracle</title>
		<link>http://brockn.com/how-to-create-a-sequence-in-oracle/</link>
		<comments>http://brockn.com/how-to-create-a-sequence-in-oracle/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 02:32:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CACHE]]></category>
		<category><![CDATA[MAXVALUE]]></category>
		<category><![CDATA[MINVALUE]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=66</guid>
		<description><![CDATA[Here is the syntax to create a sequence.  This can be used to create primary keys or to generate a number sequence. The below sequence will start with 1 and increment by 1.  There is no MAXVALUE defined so the sequence&#8217;s max value will default to 999999999999999999999999999.  The CACHE is set to 50 so it [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the syntax to create a sequence.  This can be used to create primary keys or to generate a number sequence.</p>
<p>The below sequence will start with 1 and increment by 1.  There is no MAXVALUE defined so the sequence&#8217;s max value will default to 999999999999999999999999999.  The CACHE is set to 50 so it will cache up to 50 values to help with performance.</p>
<p>CREATE SEQUENCE SOME_SEQUENCE<br />
MINVALUE 1<br />
START WITH 1<br />
INCREMENT BY 1<br />
CACHE 50;</p>
<p>To use the above sequence, you can use the &lt;sequence name&gt;.nextval in a statement.</p>
<p>Example:<br />
insert into temp (some_number) values (some_sequence.nextval);</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-create-a-sequence-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a Function in Oracle with Examples</title>
		<link>http://brockn.com/how-to-create-a-function-in-oracle-with-examples/</link>
		<comments>http://brockn.com/how-to-create-a-function-in-oracle-with-examples/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 02:31:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BEGIN]]></category>
		<category><![CDATA[DECLARE]]></category>
		<category><![CDATA[LOOP]]></category>
		<category><![CDATA[RETURN]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=64</guid>
		<description><![CDATA[The following function will add a new column called SOME_NEW_COLUMN with a NUMBER datatype to all tables in the current schema.  This function does not take any parameters. CREATE OR REPLACE FUNCTION ADD_COLUMN_FUNCTION RETURN INTEGER IS temp_String varchar2(200); temp_Table_Name varchar2(30); CURSOR cursor_User_Tables IS SELECT TABLE_NAME FROM USER_TABLES; BEGIN FOR rec IN cursor_User_Tables LOOP temp_Table_Name := [...]]]></description>
			<content:encoded><![CDATA[<p>The following function will add a new column called SOME_NEW_COLUMN with a NUMBER datatype to all tables in the current schema.  This function does not take any parameters.</p>
<p>CREATE OR REPLACE FUNCTION ADD_COLUMN_FUNCTION<br />
RETURN INTEGER<br />
IS</p>
<p>temp_String varchar2(200);<br />
temp_Table_Name varchar2(30);</p>
<p>CURSOR cursor_User_Tables IS<br />
SELECT TABLE_NAME<br />
FROM USER_TABLES;</p>
<p>BEGIN</p>
<p>FOR rec IN cursor_User_Tables<br />
LOOP</p>
<p>temp_Table_Name := rec.TABLE_NAME;</p>
<p>temp_String := &#8216;ALTER TABLE &#8216; || temp_Table_Name || &#8216; ADD SOME_NEW_COLUMN NUMBER&#8217;;</p>
<p>EXECUTE IMMEDIATE temp_String;</p>
<p>END LOOP;</p>
<p>RETURN 1;</p>
<p>END;<br />
/</p>
<p>You can execute the above function by running the following.</p>
<p>DECLARE<br />
X NUMBER;<br />
BEGIN<br />
X := ADD_COLUMN_FUNCTION;<br />
END;<br />
/</p>
<p>If you wanted the function to add the column to a single table, your function would look like this.</p>
<p>CREATE OR REPLACE FUNCTION ADD_COLUMN_FUNCTION_2 (var_Table_Name VARCHAR2)<br />
RETURN INTEGER<br />
IS</p>
<p>temp_String varchar2(200);</p>
<p>BEGIN</p>
<p>temp_String := &#8216;ALTER TABLE &#8216; || var_Table_Name || &#8216; ADD SOME_NEW_COLUMN_2 NUMBER&#8217;;</p>
<p>EXECUTE IMMEDIATE temp_String;</p>
<p>RETURN 1;</p>
<p>END;<br />
/</p>
<p>You can execute the above function by running the following where TEMP2 is the table name we are adding the column to.</p>
<p>DECLARE<br />
X NUMBER;<br />
BEGIN<br />
X := ADD_COLUMN_FUNCTION_2(&#8216;TEMP2&#8242;);<br />
END;<br />
/</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-create-a-function-in-oracle-with-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a Stored Procedure in Oracle with Examples</title>
		<link>http://brockn.com/how-to-create-a-stored-procedure-in-oracle-with-examples/</link>
		<comments>http://brockn.com/how-to-create-a-stored-procedure-in-oracle-with-examples/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 02:30:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BEGIN]]></category>
		<category><![CDATA[CURSOR]]></category>
		<category><![CDATA[LOOP]]></category>
		<category><![CDATA[NUMBER]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=62</guid>
		<description><![CDATA[The following stored procedure will add a new column called SOME_NEW_COLUMN with a NUMBER datatype to all tables in the current schema.  This stored procedure does not take any parameters. CREATE OR REPLACE PROCEDURE ADD_COLUMN_STORED_PROCEDURE IS temp_String varchar2(200); temp_Table_Name varchar2(30); CURSOR cursor_User_Tables IS SELECT TABLE_NAME FROM USER_TABLES; BEGIN FOR rec IN cursor_User_Tables LOOP temp_Table_Name := [...]]]></description>
			<content:encoded><![CDATA[<p>The following stored procedure will add a new column called SOME_NEW_COLUMN with a NUMBER datatype to all tables in the current schema.  This stored procedure does not take any parameters.</p>
<p>CREATE OR REPLACE PROCEDURE ADD_COLUMN_STORED_PROCEDURE IS</p>
<p>temp_String varchar2(200);<br />
temp_Table_Name varchar2(30);</p>
<p>CURSOR cursor_User_Tables IS<br />
SELECT TABLE_NAME<br />
FROM USER_TABLES;</p>
<p>BEGIN</p>
<p>FOR rec IN cursor_User_Tables<br />
LOOP</p>
<p>temp_Table_Name := rec.TABLE_NAME;</p>
<p>temp_String := &#8216;ALTER TABLE &#8216; || temp_Table_Name || &#8216; ADD SOME_NEW_COLUMN NUMBER&#8217;;</p>
<p>EXECUTE IMMEDIATE temp_String;</p>
<p>END LOOP;</p>
<p>END;<br />
/</p>
<p>If you wanted the stored procedure to add the column to a single table, your stored procedure would look like this.</p>
<p>CREATE OR REPLACE PROCEDURE ADD_COLUMN_STORED_PROCEDURE_2 (var_Table_Name VARCHAR2) IS</p>
<p>temp_String varchar2(200);</p>
<p>BEGIN</p>
<p>temp_String := &#8216;ALTER TABLE &#8216; || var_Table_Name || &#8216; ADD SOME_NEW_COLUMN_2  NUMBER&#8217;;</p>
<p>EXECUTE IMMEDIATE temp_String;</p>
<p>END;<br />
/</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-create-a-stored-procedure-in-oracle-with-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issues with Sequence Generators when Upgrading from Informatica PowerCenter 8.1 to 8.6?</title>
		<link>http://brockn.com/issues-with-sequence-generators-when-upgrading-from-informatica-powercenter-8-1-to-8-6/</link>
		<comments>http://brockn.com/issues-with-sequence-generators-when-upgrading-from-informatica-powercenter-8-1-to-8-6/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 05:12:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Informatica]]></category>
		<category><![CDATA[SET]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=59</guid>
		<description><![CDATA[Here is a simple way to upgrade all sequence generator datatypes so that version 8.1 Informatica mappings will work with version 8.6. UPDATE OPB_WIDGET_FIELD SET wgt_prec = 19, wgt_datatype = -5 WHERE  field_name IN ( &#8216;CURRVAL&#8217;,'NEXTVAL&#8217;) AND wgt_datatype = 4;]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to upgrade all sequence generator datatypes so that version 8.1 Informatica mappings will work with version 8.6.</p>
<p>UPDATE OPB_WIDGET_FIELD<br />
SET wgt_prec = 19, wgt_datatype = -5<br />
WHERE  field_name IN ( &#8216;CURRVAL&#8217;,'NEXTVAL&#8217;)<br />
AND wgt_datatype = 4;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/issues-with-sequence-generators-when-upgrading-from-informatica-powercenter-8-1-to-8-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add a Column to a Table in Oracle</title>
		<link>http://brockn.com/how-to-add-a-column-to-a-table-in-oracle/</link>
		<comments>http://brockn.com/how-to-add-a-column-to-a-table-in-oracle/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 05:09:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=55</guid>
		<description><![CDATA[Here is the statement to add a column to a table. ALTER TABLE SAMPLE_TABLE ADD  ANOTHER_DATE DATE; Here is the statement to add multiple columns to a table. ALTER TABLE SAMPLE_TABLE ADD ( ANOTHER_STRING VARCHAR2(100 CHAR), ANOTHER_NUMBER NUMBER(32,12) ); &#160;]]></description>
			<content:encoded><![CDATA[<p>Here is the statement to add a column to a table.</p>
<p>ALTER TABLE SAMPLE_TABLE ADD  ANOTHER_DATE DATE;</p>
<p>Here is the statement to add multiple columns to a table.</p>
<p>ALTER TABLE SAMPLE_TABLE ADD (<br />
ANOTHER_STRING VARCHAR2(100 CHAR),<br />
ANOTHER_NUMBER NUMBER(32,12)<br />
);</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-add-a-column-to-a-table-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Analyze a Table or Index in Oracle Using the Analyze Statement</title>
		<link>http://brockn.com/how-to-analyze-a-table-or-index-in-oracle-using-the-analyze-sql/</link>
		<comments>http://brockn.com/how-to-analyze-a-table-or-index-in-oracle-using-the-analyze-sql/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 06:08:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PERCENT]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=51</guid>
		<description><![CDATA[Here are a few examples of how to analyze a table and index. ANALYZE TABLE SAMPLE_TABLE COMPUTE STATISTICS;  &#8211;completely computes statistics ANALYZE INDEX SAMPLE_TABLE_PK COMPUTE STATISTICS; &#8211;completely computes statistics ANALYZE TABLE SAMPLE_TABLE ESTIMATE STATISTICS SAMPLE 100 ROWS; &#8211;estimates statistics based on the set number of rows ANALYZE TABLE SAMPLE_TABLE ESTIMATE STATISTICS SAMPLE 15 PERCENT; &#8211;estimates statistics [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few examples of how to analyze a table and index.</p>
<p>ANALYZE TABLE SAMPLE_TABLE COMPUTE STATISTICS;  &#8211;completely computes statistics<br />
ANALYZE INDEX SAMPLE_TABLE_PK COMPUTE STATISTICS; &#8211;completely computes statistics</p>
<p>ANALYZE TABLE SAMPLE_TABLE ESTIMATE STATISTICS SAMPLE 100 ROWS; &#8211;estimates statistics based on the set number of rows<br />
ANALYZE TABLE SAMPLE_TABLE ESTIMATE STATISTICS SAMPLE 15 PERCENT; &#8211;estimates statistics based on the set percentage of rows</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-analyze-a-table-or-index-in-oracle-using-the-analyze-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Truncate a Table in Oracle</title>
		<link>http://brockn.com/how-to-truncate-a-table-in-oracle/</link>
		<comments>http://brockn.com/how-to-truncate-a-table-in-oracle/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 06:01:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=48</guid>
		<description><![CDATA[Here is an example of how to truncate a table in Oracle.  To do a truncate, you must be connected to the schema the table is in. TRUNCATE TABLE SAMPLE_TABLE;]]></description>
			<content:encoded><![CDATA[<p>Here is an example of how to truncate a table in Oracle.  To do a truncate, you must be connected to the schema the table is in.</p>
<p>TRUNCATE TABLE SAMPLE_TABLE;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-truncate-a-table-in-oracle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Delete Data from a Table in Oracle</title>
		<link>http://brockn.com/how-to-delete-data-from-a-table-in-oracle/</link>
		<comments>http://brockn.com/how-to-delete-data-from-a-table-in-oracle/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 05:56:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=44</guid>
		<description><![CDATA[Here is an example of how to delete data from a table.  To do a delete, you must do a commit for the delete to be permanent.  You can do a delete in any schema that has access to the necessary table.  DELETE FROM SAMPLE_TABLE; COMMIT; Here is an example of how to delete data from a [...]]]></description>
			<content:encoded><![CDATA[<p>Here is an example of how to delete data from a table.  To do a delete, you must do a commit for the delete to be permanent.  You can do a delete in any schema that has access to the necessary table. </p>
<p>DELETE FROM SAMPLE_TABLE;<br />
COMMIT;</p>
<p>Here is an example of how to delete data from a table by using a filter. </p>
<p>DELETE FROM SAMPLE_TABLE WHERE SOME_NUMBER = 20;<br />
COMMIT;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-delete-data-from-a-table-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add a Datafile in Oracle</title>
		<link>http://brockn.com/how-to-add-a-datafile-in-oracle/</link>
		<comments>http://brockn.com/how-to-add-a-datafile-in-oracle/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 05:44:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[GB]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=40</guid>
		<description><![CDATA[Here is an example of how to add a datafile in Oracle.  The datafile size is 2 GB.  You will need to replace the &#8216;/u01/oracle/&#8217; path with a valid directory. ALTER TABLESPACE &#8221;SAMPLEDATAFILE&#8221; ADD DATAFILE &#8216;/u01/oracle/some_folder.dbf&#8217; size 2048M; &#160;]]></description>
			<content:encoded><![CDATA[<p>Here is an example of how to add a datafile in Oracle.  The datafile size is 2 GB.  You will need to replace the &#8216;/u01/oracle/&#8217; path with a valid directory.</p>
<p>ALTER TABLESPACE &#8221;SAMPLEDATAFILE&#8221; ADD DATAFILE &#8216;/u01/oracle/some_folder.dbf&#8217; size 2048M;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-add-a-datafile-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a Copy of a Table in Oracle</title>
		<link>http://brockn.com/how-to-create-a-copy-of-a-table-in-oracle/</link>
		<comments>http://brockn.com/how-to-create-a-copy-of-a-table-in-oracle/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 05:35:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://brockn.com/?p=37</guid>
		<description><![CDATA[Here is how to create a backup of an existing table (with data). CREATE TABLE SAMPLE_TABLE_COPY AS SELECT * FROM SAMPLE_TABLE; Here is how to create a backup of an existing table (without data). CREATE TABLE SAMPLE_TABLE_COPY AS SELECT * FROM SAMPLE_TABLE WHERE ROWNUM &#60; 1;]]></description>
			<content:encoded><![CDATA[<p>Here is how to create a backup of an existing table (with data).</p>
<p>CREATE TABLE SAMPLE_TABLE_COPY AS SELECT * FROM SAMPLE_TABLE;</p>
<p>Here is how to create a backup of an existing table (without data).</p>
<p>CREATE TABLE SAMPLE_TABLE_COPY AS SELECT * FROM SAMPLE_TABLE WHERE ROWNUM &lt; 1;</p>
]]></content:encoded>
			<wfw:commentRss>http://brockn.com/how-to-create-a-copy-of-a-table-in-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

