<?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>Arejae.Com &#187; SQL/ETL</title>
	<atom:link href="http://www.arejae.com/blogv2/category/sqletl/feed" rel="self" type="application/rss+xml" />
	<link>http://www.arejae.com/blogv2</link>
	<description>me,myself,english and programming..</description>
	<lastBuildDate>Thu, 22 Jul 2010 07:19:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Javascript to generate Query String</title>
		<link>http://www.arejae.com/blogv2/javascript-to-generate-query-string.html</link>
		<comments>http://www.arejae.com/blogv2/javascript-to-generate-query-string.html#comments</comments>
		<pubDate>Thu, 22 Jul 2010 07:19:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blogv2/javascript-to-generate-query-string.html</guid>
		<description><![CDATA[For my future reference, I know that I will need this later on. &#160; function create_request_string(theForm) { var reqStr = ""; for(i=0; i &#60; theForm.elements.length; i++) { isFormObject = false; switch (theForm.elements[i].tagName) { case "INPUT": switch (theForm.elements[i].type) { case "text": case "hidden": reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value); isFormObject = true; break; case "checkbox": [...]]]></description>
			<content:encoded><![CDATA[<p>For my future reference, I know that I will need this later on.</p>
<p>&nbsp;</p>
<pre class="sql" name="code">
function create_request_string(theForm)
{
var reqStr = "";

for(i=0; i &lt; theForm.elements.length; i++)
{
isFormObject = false;

switch (theForm.elements[i].tagName)
{
case "INPUT":

switch (theForm.elements[i].type)
{
case "text":
case "hidden":
reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;

case "checkbox":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
}else{
reqStr += theForm.elements[i].name + "=";
}
isFormObject = true;
break;

case "radio":
if (theForm.elements[i].checked)
{
reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
isFormObject = true;
}
}
break;

case "TEXTAREA":

reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
isFormObject = true;
break;

case "SELECT":
var sel = theForm.elements[i];
reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
isFormObject = true;
break;
}

if ((isFormObject) &amp;&amp; ((i+1)!= theForm.elements.length))
{
reqStr += "&amp;";
}

}

return reqStr;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/javascript-to-generate-query-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: ORA-01033 ORACLE initialization or shutdown in progress</title>
		<link>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html</link>
		<comments>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html#comments</comments>
		<pubDate>Thu, 11 Mar 2010 04:07:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html</guid>
		<description><![CDATA[For some reason which I don&#8217;t know why, my oracle give me that kind of error. Googling give me for below solution. And here I post for my future reference, and also for you if you got this same problem . Run this command first in console. sqlplus /nolog And after that, use these commands [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason which I don&#8217;t know why, my oracle give me that kind of error.</p>
<p>Googling give me for below solution. And here I post for my future reference, and also for you if you got this same problem . <img src='http://www.arejae.com/blogv2/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Run this command first in console.</p>
<p><strong>sqlplus /nolog</strong></p>
<p>And after that, use these commands :</p>
<p>SQL&gt; connect / as sysdba<br />
Connected.<br />
SQL&gt; shutdown abort<br />
ORACLE instance shut down<br />
SQL&gt; startup nomount<br />
ORACLE instance started.<br />
SQL&gt; alter database mount;<br />
SQL&gt; alter database open;</p>
<p><span id="more-681"></span>
<p>If you got below error</p>
<p>ERROR at line 1:<br />
ORA-01113: file 14 needs media recovery<br />
ORA-01110: data file 14:<br />
&#8216;C:\APP\ADMINISTRATOR\ORADATA\EKPTGHQ1\DATAFILE\IDX02.DBF&#8217;</p>
<p>SQL&gt; alter database recover datafile <strong>14</strong> ;</p>
<p>repeat recover datafile step if you have a few corrupted data file.</p>
<p>SQL&gt; shutdown</p>
<p>SQL&gt; startup</p>
<p>That is. Till then&#8230;</p>
<p>Happy SQL-ing&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/error-ora-01033-oracle-initialization-or-shutdown-in-progress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop all triggers in Oracle</title>
		<link>http://www.arejae.com/blogv2/drop-all-triggers-in-oracle.html</link>
		<comments>http://www.arejae.com/blogv2/drop-all-triggers-in-oracle.html#comments</comments>
		<pubDate>Fri, 20 Mar 2009 11:34:47 +0000</pubDate>
		<dc:creator>arejae</dc:creator>
				<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blog/drop-all-triggers-in-oracle.html</guid>
		<description><![CDATA[If you need to drop all the triggers in oracle for a split second, here how you can do it. Below is the sample how to drop all triggers in myTesting schema with trigger name like &#8216;%_BI&#8217; begin for i in (select trigger_name,owner from dba_triggers where trigger_name like '%_BI%' and owner = 'myTesting' ) LOOP [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to drop all the triggers in oracle for a split second, here how you can do it. Below is the sample how to drop all triggers in myTesting schema with trigger name like &#8216;%_BI&#8217;</p>
<pre class="sql" name="code">
begin
for i in (select trigger_name,owner from dba_triggers where  trigger_name like '%_BI%' and owner = 'myTesting' ) LOOP
execute immediate 'DROP TRIGGER '||i.owner||'.'||i.trigger_name;
END LOOP;
END;
</pre>
<pre class="sql" name="code">
Make sure you know what you are doing.
</pre>
<pre class="sql" name="code">
Till then..
</pre>
<pre class="sql" name="code">
Happy coding...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/drop-all-triggers-in-oracle.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check for NULL Value in Oracle and MySQL</title>
		<link>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html</link>
		<comments>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 03:24:13 +0000</pubDate>
		<dc:creator>arejae</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL/ETL]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blog/check-for-null-value-in-oracle-and-mysql.html</guid>
		<description><![CDATA[If you are familiar with MS-SQL, you will know that you can use ISNULL function to convert NULL value to something else. In below case, it is an example how to convert NULL value to zero. ISNULL(myField,0) In Oracle, you can use NVL to get the same result. NVL(myField,0) Same thing for MySQL, you can [...]]]></description>
			<content:encoded><![CDATA[<p>If you are familiar with MS-SQL, you will know that you can use ISNULL function to convert NULL value to something else. In below case, it is an example how to convert NULL value to zero.</p>
<p><strong>ISNULL(myField,0)</strong></p>
<p>In Oracle, you can use NVL to get the same result.</p>
<p><strong>NVL(myField,0)</strong></p>
<p>Same thing for MySQL, you can use IFNULL to get the same result.</p>
<p><strong>IFNULL(myField,0)</strong></p>
<p>&nbsp;</p>
<p>Don&#8217;t under estimate with this function. I&#8217;m debugging my program for almost 1 hours just to notice that some values in my Oracle tables having NULL values and causing errors while inserting to MySQL tables.</p>
<p>That&#8217;s my quick update for today. Till then&#8230;Happy Coding. <img src='http://www.arejae.com/blogv2/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/check-for-null-value-in-oracle-and-mysql.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AutoIT &#8211; Connecting to Oracle.</title>
		<link>http://www.arejae.com/blogv2/autoit-connecting-to-oracle.html</link>
		<comments>http://www.arejae.com/blogv2/autoit-connecting-to-oracle.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 00:00:00 +0000</pubDate>
		<dc:creator>arejae</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL/ETL]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.arejae.com/blog/autoit-connecting-to-oracle.html</guid>
		<description><![CDATA[Previously I wrote about how to connect to SQL Server using AutoIt. Since that I&#8217;m using Oracle as my main database in my new workplace, I will show how to do the same thing for Oracle. $conn = ObjCreate( "ADODB.Connection" ) $DSN = "Driver={Microsoft ODBC for Oracle};Server=ORCL;Uid=myID;Pwd=myPwd;" $conn.Open($DSN) $rs = ObjCreate( "ADODB.RecordSet" ) $rs.Open( "select [...]]]></description>
			<content:encoded><![CDATA[<p>Previously I wrote about how to <a href="http://www.arejae.com/blog/autoit-connecting-to-sql-server.html">connect to SQL Server using AutoIt</a>. Since that I&#8217;m using Oracle as my main database in my new workplace, I will show how to do the same thing for Oracle.</p>
<pre class="vb" name="code">
$conn = ObjCreate( "ADODB.Connection" )
$DSN = "Driver={Microsoft ODBC for Oracle};Server=ORCL;Uid=myID;Pwd=myPwd;"
$conn.Open($DSN)
$rs = ObjCreate( "ADODB.RecordSet" )
$rs.Open( "select BANNER from v$version where banner like 'Oracle%'", $conn )
MsgBox(0, "AutoIT-SQL Result", "Value = " &amp; $rs.Fields( "BANNER" ).Value )
$conn.close
</pre>
<p>The codes will produce something like below.</p>
<p><img height="107" alt="autoit-oracle" src="http://myhlai.com/arejae.com/blog/wp-content/uploads/2009/02/autoit-oracle.jpg" width="413" /></p>
<p>&nbsp;</p>
<p>Till then..</p>
<p>Happy coding..!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arejae.com/blogv2/autoit-connecting-to-oracle.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
