<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2948126600672374905</id><updated>2012-02-02T08:24:45.520+08:00</updated><category term='JSP'/><category term='Oracle'/><category term='Linux'/><category term='.Net'/><title type='text'>vicker313 blog</title><subtitle type='html'>Oracle tutorial for all levels</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-6359377805787609684</id><published>2010-01-09T10:47:00.000+08:00</published><updated>2010-01-09T10:47:11.423+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Any Languages in Dot Net Framework</title><content type='html'>The beauty in Dot Net Framework is that, you can use whatever language you like to develop your application. For example, if you're a VB people, you can use VB.Net or you can use J# if you're a Java people (Even though the syntax is not exactly the same, but you can catch up faster). Below are some language that Dot Net Framework supports:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;C#&lt;/b&gt;: this should be the genuine language in Dot Net Framework&lt;/li&gt;&lt;li&gt;&lt;b&gt;VB.Net&lt;/b&gt;: influenced by Visual Basic&lt;/li&gt;&lt;li&gt;&lt;b&gt;J#&lt;/b&gt;: influenced by Java&lt;/li&gt;&lt;li&gt;&lt;b&gt;F#&lt;/b&gt;: influenced by Lambda Expression&lt;/li&gt;&lt;li&gt;&lt;b&gt;Boo&lt;/b&gt;: influenced by Python&lt;/li&gt;&lt;li&gt;&lt;b&gt;IronPython&lt;/b&gt;: influenced by Python also&lt;/li&gt;&lt;li&gt;&lt;b&gt;IronRuby&lt;/b&gt;: influenced by Ruby&lt;/li&gt;&lt;/ul&gt;Dot Net Framework can do this by using the &lt;b&gt;Common Language Runtime&lt;/b&gt; (CLR). Whatever language you compiled will convert into &lt;b&gt;Common Intermediate Language&lt;/b&gt; (CIL) and executed by CLR.&lt;br /&gt;&lt;br /&gt;If you have installed Dot Net Framework SDK, you can find a tools called &lt;b&gt;Microsoft Intermediate Language Disassembler&lt;/b&gt; (MSIL&amp;nbsp;Disassembler&amp;nbsp;). Using this tool allow you to read the CIL in all Dot Net compiled assemblies (either it is an executable file or library).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-6359377805787609684?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/6359377805787609684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=6359377805787609684' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6359377805787609684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6359377805787609684'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2010/01/any-languages-in-dot-net-framework.html' title='Any Languages in Dot Net Framework'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-8351562369306070301</id><published>2009-11-01T10:03:00.000+08:00</published><updated>2009-11-01T10:03:32.425+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Difference between Linux and Windows (and similarity)</title><content type='html'>Linux, Mac, Solaris, BSD and some other OS share the same origin, grandfather UNIX, which make them having similar command and file structure. While Windows stands as its owned, has its owned unique command and structure that different from the UNIX bloodline. However all the OS are actually serve the same purpose, just that in different methods:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;File System Type&lt;/b&gt;: this is the type of method on how to format the hard disk. Currently Windows cannot browse hard disk (or partition) of Linux file system, however newer Linux can browse (or even modify) Windows file system.&lt;br /&gt;&lt;/li&gt;&lt;ol type="i"&gt;&lt;li&gt;&lt;b&gt;Windows&lt;/b&gt;: FAT and NTFS&lt;/li&gt;&lt;li&gt;&lt;b&gt;Linux&lt;/b&gt;: EXT2, EXT3 and EXT4&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;b&gt;File Structure&lt;/b&gt;: this is another thing that make Windows user confuse on Linux. In Windows, the file structure is based on hard disk, and then each hard disk can have more than 1 partition. For example C:\ is the hard disk and D:\ may be the second partition of the hard disk. However Linux treats hard disk and partition separately, which the structure will base on partition like /, /home, /etc and others.&lt;/li&gt;&lt;ol type="i"&gt;&lt;li&gt;Linux /home is equivalent to Windows c:\document and settings&lt;/li&gt;&lt;li&gt;Linux /bin and /sbin is equivalent to Windows c:\windows\system32&lt;/li&gt;&lt;li&gt;Linux /opt is equivalent to Windows c:\program files&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Command: of course the commands between Linux and Windows are vary, but you can always find the equivalent command.&lt;/li&gt;&lt;ol type="i"&gt;&lt;li&gt;List files: ls and dir&lt;/li&gt;&lt;li&gt;Ping: ping (same for both OS)&lt;/li&gt;&lt;li&gt;Change directory: cd (same for both OS)&lt;/li&gt;&lt;li&gt;Make directory: mkdir (same for both OS)&lt;/li&gt;&lt;li&gt;Copy: cp and copy&lt;/li&gt;&lt;li&gt;Move: mv and move&lt;/li&gt;&lt;li&gt;Delete: rm and del&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-8351562369306070301?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/8351562369306070301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=8351562369306070301' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8351562369306070301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8351562369306070301'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/11/difference-between-linux-and-windows.html' title='Difference between Linux and Windows (and similarity)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-1750642136166392276</id><published>2009-09-26T11:03:00.000+08:00</published><updated>2009-09-26T11:03:31.593+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>Tomcat configuration file - web.xml</title><content type='html'>Tomcat configuration file (&lt;i&gt;web.xml&lt;/i&gt;) is using XML pattern, which the global configuration file is within &lt;i&gt;tomcat\conf&lt;/i&gt; directory, and individual configuration file is within &lt;i&gt;tomcat\wepapps\webdir\WEB-INF&lt;/i&gt; directory. User can always refer to the global configuration file as a sample to set the individual configuration file. The parent node of &lt;i&gt;web.xml&lt;/i&gt; is &lt;code&gt;&amp;lt;web-app&amp;gt;&lt;/code&gt; and below is the common nodes that can be used:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Description for the web application.&lt;br /&gt;&lt;code&gt;&amp;lt;description&amp;gt;&lt;br /&gt;Description for Web Application&lt;br /&gt;&amp;lt;/description&amp;gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Map the servlet to associate class and URL pattern.&lt;br /&gt;&lt;code&gt;&amp;lt;servlet&amp;gt;&lt;br /&gt;&amp;lt;servlet-name&amp;gt;servlet name&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;&amp;lt;servlet-class&amp;gt;class name&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;&amp;lt;/servlet&amp;gt;&lt;br /&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;&amp;lt;servlet-name&amp;gt;servlet name&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;&amp;lt;url-pattern&amp;gt;url pattern&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Map the taglib to associate TLD files.&lt;br /&gt;&lt;code&gt;&amp;lt;taglib&amp;gt;&lt;br /&gt;&amp;lt;taglib-uri&amp;gt;&lt;br /&gt;http://www.gnokproject.com/taglibs/taglib-v1.0&lt;br /&gt;&amp;lt;/taglib-uri&amp;gt;&lt;br /&gt;&amp;lt;taglib-location&amp;gt;&lt;br /&gt;/WEB-INF/jsp/taglib.tld&lt;br /&gt;&amp;lt;/taglib-location&amp;gt;&lt;br /&gt;&amp;lt;/taglib&amp;gt; &lt;/code&gt;&lt;/li&gt;&lt;li&gt;Map extension to associate mime type.&lt;br /&gt;&lt;code&gt;&amp;lt;mime-mapping&amp;gt;&lt;br /&gt;&amp;lt;extension&amp;gt;html&amp;lt;/extension&amp;gt;&lt;br /&gt;&amp;lt;mime-type&amp;gt;text/html&amp;lt;/mime-type&amp;gt;&lt;br /&gt;&amp;lt;/mime-mapping&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Session timeout.&lt;br /&gt;&lt;code&gt;&amp;lt;session-config&amp;gt;&lt;br /&gt;&amp;lt;session-timeout&amp;gt;30&amp;lt;/session-timeout&amp;gt;&lt;br /&gt;&amp;lt;/session-config&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;First file to be accessed.&lt;code&gt;&lt;br /&gt;&amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;&amp;lt;welcome-file&amp;gt;index.jsp&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;&amp;lt;welcome-file&amp;gt;index.html&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;&amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-1750642136166392276?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/1750642136166392276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=1750642136166392276' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1750642136166392276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1750642136166392276'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/09/tomcat-configuration-file-webxml.html' title='Tomcat configuration file - web.xml'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-6809446672267791891</id><published>2009-09-25T14:49:00.002+08:00</published><updated>2009-09-26T10:43:02.678+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>WEBAPPS directory structure</title><content type='html'>&lt;b&gt;WEPAPPS&lt;/b&gt; is the directory that keep all the JSP files and JAVA files, and the place where people will get into when they are accessing &lt;b&gt;Apache Tomcat&lt;/b&gt;. Inside &lt;b&gt;WEBAPPS&lt;/b&gt; directory, each sub directory represents a sub directory in the URL, for example a sub directory named &lt;i&gt;subdir &lt;/i&gt;represents &lt;i&gt;www.gnokproject.com/subdir&lt;/i&gt;. Except for one directory called &lt;i&gt;ROOT &lt;/i&gt;which represents the root directory &lt;i&gt;www.gnokproject.com&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Inside each sub directory will have a directory called &lt;i&gt;WEB-INF&lt;/i&gt; which contain:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;i&gt;classes &lt;/i&gt;directory: keep the JAVA source files which will be auto compiled by &lt;b&gt;Tomcat&lt;/b&gt; when&lt;b&gt;&amp;nbsp;&lt;/b&gt;the classes are needed.&lt;/li&gt;&lt;li&gt;&lt;i&gt;jsp &lt;/i&gt;directory: keep the TLD files or the tag library files.&lt;/li&gt;&lt;li&gt;&lt;i&gt;lib &lt;/i&gt;directory: keep the JAR files.&lt;/li&gt;&lt;li&gt;&lt;i&gt;web.xml&lt;/i&gt;: configuration files of that particular directory.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-6809446672267791891?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/6809446672267791891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=6809446672267791891' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6809446672267791891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6809446672267791891'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/09/webapp-directory-structure.html' title='WEBAPPS directory structure'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-4614806069781773364</id><published>2009-09-23T12:59:00.001+08:00</published><updated>2009-09-26T10:43:18.401+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>Apache Tomcat directory structure</title><content type='html'>Tomcat's directory structure:&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;bin&lt;/dt&gt;&lt;dd&gt;Keep all execution files, for example &lt;i&gt;startup.bat&lt;/i&gt; and &lt;i&gt;shutdown.bat&lt;/i&gt;.  &lt;/dd&gt;&lt;dt&gt;conf&lt;/dt&gt;&lt;dd&gt;Keep all the common configuration files, such as &lt;i&gt;server.xml&lt;/i&gt;.  &lt;/dd&gt;&lt;dt&gt;lib (in 6.0, or&amp;nbsp;common, server, shared in 5.5)&lt;/dt&gt;&lt;dd&gt;Keep all the common classes and jar files that will be shared by all JAVA and JSP files in &lt;i&gt;webapp&lt;/i&gt;. &lt;/dd&gt;&lt;dt&gt;logs&lt;/dt&gt;&lt;dd&gt;Keep all the log files. &lt;/dd&gt;&lt;dt&gt;webapps&lt;/dt&gt;&lt;dd&gt;Keep all the JSP files, where you normally spend most of the time here. &lt;/dd&gt;&lt;dt&gt;temp&lt;/dt&gt;&lt;dd&gt;Temporary directory. &lt;/dd&gt;&lt;dt&gt;work&lt;/dt&gt;&lt;dd&gt;Keep the caches compiled from JSP and JAVA files from &lt;i&gt;wepapp&lt;/i&gt;. &lt;/dd&gt; &lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-4614806069781773364?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/4614806069781773364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=4614806069781773364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4614806069781773364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4614806069781773364'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/09/apache-tomcat-directory-structure.html' title='Apache Tomcat directory structure'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-4794048625155662035</id><published>2009-09-23T12:19:00.003+08:00</published><updated>2010-04-28T19:19:18.267+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>Change Tomcat port from 8080 to 80</title><content type='html'>To change Apache Tomcat port from 8080 to 80 (so that developer or user doesn't need to type &lt;i&gt;:8080&lt;/i&gt; at the back of the URL):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Edit &lt;i&gt;TOMCAT_DIR\conf\server.xml.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Look for line similar to below (the keyword is &lt;i&gt;connector&lt;/i&gt; and &lt;i&gt;8080&lt;/i&gt;):&lt;br /&gt;&lt;code&gt;&amp;lt;connector connectiontimeout="20000" port="8080" protocol="HTTP/1.1" redirectport="8443"&amp;gt;&amp;lt;/connector&amp;gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Just change 8080 to 80 and restart Tomcat.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-4794048625155662035?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/4794048625155662035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=4794048625155662035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4794048625155662035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4794048625155662035'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/09/change-tomcat-port-from-8080-to-80.html' title='Change Tomcat port from 8080 to 80'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-8215048036091017459</id><published>2009-09-23T12:03:00.000+08:00</published><updated>2009-09-23T12:03:06.204+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>Setup Apache Tomcat to host JSP</title><content type='html'>JSP (Java Server Page) is Java based web programming language. Similar to ASP and ASPX (and different from PHP), JSP can be compiled into classes before used in the pages. To start coding in JSP, we need to setup Apache Tomcat first. Follow the steps below:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;b&gt;JDK &lt;/b&gt;(Java Development Kit) from &lt;a href="http://java.sun.com/"&gt;Java Website&lt;/a&gt;. Any version will do, but if you don't have any idea, just download and install the newest version.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download &lt;b&gt;Apache Tomcat&lt;/b&gt; from &lt;a href="http://tomcat.apache.org/"&gt;Apache Tomcat Website&lt;/a&gt;. Currently there are versions 4.1, 5.5 and 6.0. Either version will do, or just pick the newest version.&lt;/li&gt;&lt;li&gt;There are 2 types of &lt;b&gt;Tomcat &lt;/b&gt;installation file, zip and windows installer. Either type is fine, or just download the zip version. Extract the zip file to any directory.&lt;/li&gt;&lt;li&gt;Go to the &lt;b&gt;Tomcat &lt;/b&gt;directory that you extracted (or installed), go to &lt;b&gt;bin &lt;/b&gt;folder and edit the &lt;b&gt;startup.bat&lt;/b&gt; file.&lt;/li&gt;&lt;li&gt;Add the &lt;b&gt;JAVA_HOME &lt;/b&gt;environment variable at the beginning of the &lt;b&gt;startup.bat&lt;/b&gt; file (after &lt;code&gt;@echo off&lt;/code&gt;)&lt;code&gt;&lt;br /&gt;set java_home=C:\Program Files\Java\jdk1.6.0_16&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Then you may double click the &lt;b&gt;startup.bat&lt;/b&gt; to start &lt;b&gt;Tomcat&lt;/b&gt;. If a command terminal is shown without disappearing, it properly means OK.&lt;/li&gt;&lt;li&gt;To test it out, open a browser and go to localhost:8080. If something come out (not the error message of course), that means you have setup &lt;b&gt;Tomcat &lt;/b&gt;successfully.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-8215048036091017459?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/8215048036091017459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=8215048036091017459' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8215048036091017459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8215048036091017459'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/09/setup-apache-tomcat-to-host-jsp.html' title='Setup Apache Tomcat to host JSP'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-8856064402423659510</id><published>2009-08-26T08:00:00.001+08:00</published><updated>2009-08-26T09:05:26.601+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle Net Manager</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n2Fk3SKOEvM/SpM6oPLkhSI/AAAAAAAAARc/R13Pcty-FPU/s1600-h/untitled.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 301px;" src="http://2.bp.blogspot.com/_n2Fk3SKOEvM/SpM6oPLkhSI/AAAAAAAAARc/R13Pcty-FPU/s400/untitled.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5373703243327374626" /&gt;&lt;/a&gt;&lt;p&gt;Net Manager is an utility come together with Oracle DBMS. User can find it inside &lt;strong&gt;Network Administrator&lt;/strong&gt; at start menu or execute it by using command &lt;strong&gt;netmgr&lt;/strong&gt;. Net Manager serves for 2 main purposes:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Set TNS Name&lt;/strong&gt; at client PC. TNS name is the connection setting at client PC so that it is able to access database.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Go to the tree navigator, select Service Naming and click add (green plus button at left panel).&lt;/li&gt;&lt;li&gt;Set &lt;b&gt;Net Service Name&lt;/b&gt;, what ever name you want.&lt;/li&gt;&lt;li&gt;Set &lt;b&gt;Network Type&lt;/b&gt;, which normally TCP/IP.&lt;/li&gt;&lt;li&gt;Set &lt;b&gt;Host Name and Port Number&lt;/b&gt;. Host Name you can either use IP address or DNS Name (if you got a DNS server at your network). While the default port is 1521.&lt;/li&gt;&lt;li&gt;Set &lt;b&gt;Service Name and Connection Type&lt;/b&gt;. Service Name is the name of the database, while Connection Type we can left it as default.&lt;/li&gt;&lt;li&gt;Done.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Set Listener&lt;/strong&gt; at Server. Listener is a process to accept connection from client and pass the connection to the database.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Go to the tree navigator, select Listeners and click add (green plus button at left panel).&lt;/li&gt;&lt;li&gt;Set what ever name you want for the listener.&lt;/li&gt;&lt;li&gt;At the top of right panel, you can see a drop down box, which we need to set 2 things: &lt;b&gt;Listening Location&lt;/b&gt; and &lt;b&gt;D&lt;/b&gt;&lt;b&gt;atabase Services&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Listening Locations&lt;/b&gt;: add new a address, fill in &lt;b&gt;Protocol &lt;/b&gt;(TCP/IP), &lt;b&gt;Host &lt;/b&gt;(normally localhost will do where listener is resided together with the database) and &lt;b&gt;Port &lt;/b&gt;(default 1521).&lt;/li&gt;&lt;li&gt;&lt;b&gt;Database Services&lt;/b&gt;: add new database, set &lt;b&gt;Global Database Name and SID&lt;/b&gt; (both are the name of database) and &lt;b&gt;Oracle Home Directory&lt;/b&gt; (where you install oracle DBMS).&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-8856064402423659510?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/8856064402423659510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=8856064402423659510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8856064402423659510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8856064402423659510'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/08/oracle-net-manager.html' title='Oracle Net Manager'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_n2Fk3SKOEvM/SpM6oPLkhSI/AAAAAAAAARc/R13Pcty-FPU/s72-c/untitled.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-7742119155980139209</id><published>2009-08-09T13:40:00.000+08:00</published><updated>2009-08-09T13:50:32.611+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Physical and logical structure of database</title><content type='html'>In Oracle, there are 2 types of structure: physical and logical structure.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Physical Structure&lt;/span&gt;: it is simply the physical data files that you can see in a file manager. You can find most of them in the directory where your database is resided. Few types of file:&lt;ul&gt;&lt;li type="i"&gt;&lt;span style="font-weight: bold;"&gt;Data File&lt;/span&gt;: extension is DBF, where the data is stored.&lt;/li&gt;&lt;li type="i"&gt;&lt;span style="font-weight: bold;"&gt;Control File&lt;/span&gt;: extension is CTL, where the database current state is stored&lt;/li&gt;&lt;li type="i"&gt;&lt;span style="font-weight: bold;"&gt;Parameter File&lt;/span&gt;: extension is ORA, parameter file of all kind of database process include listener. Usually store in directory where you install your DBMS.&lt;/li&gt;&lt;li type="i"&gt;&lt;span style="font-weight: bold;"&gt;Redo Log&lt;/span&gt;: extension is RDO, store the changes of your database transaction before commit is issued.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Logical Structure&lt;/span&gt;: it only stay in memory, where physically store in physical file. It only appear when the database service is started, and only can be view by using certain database tools. Few types of logical structure:&lt;ol type="i"&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Tablespace&lt;/span&gt;: where the tables or data are stored. 1 tablespace can map to 1 or more data files.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Segment&lt;/span&gt;: Smaller unit in tablespace, which can further categorized into data segment, index segment, temporary segment and rollback segment.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Extend&lt;/span&gt;: Smaller unit in Segment.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Block&lt;/span&gt;: Smaller unit in Extend.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-7742119155980139209?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/7742119155980139209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=7742119155980139209' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/7742119155980139209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/7742119155980139209'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/08/physical-and-logical-structure-of.html' title='Physical and logical structure of database'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-9165746978293634248</id><published>2009-08-09T13:00:00.000+08:00</published><updated>2009-08-09T13:29:01.664+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>For Update Option in Select Statement</title><content type='html'>&lt;p&gt;You can lock a record by querying it, with this FOR UPDATE option in your select statement:&lt;/p&gt;&lt;code&gt;select * from dept where code = '10' for update;&lt;/code&gt;&lt;br /&gt;&lt;p&gt;When other users try to query the same record, it will return a resource busy error. It depends on whether you use FOR UPDATE NOWAIT or FOR UPDATE WAIT.&lt;/p&gt;&lt;code&gt;-- immediate return the error&lt;br /&gt;select * from dept&lt;br /&gt;where code = '10'&lt;br /&gt;for update nowait;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;-- try for 3 seconds before return the error&lt;br /&gt;select *&lt;br /&gt;from dept&lt;br /&gt;where code = '10'&lt;br /&gt;for update wait 3;&lt;/code&gt;&lt;br /&gt;&lt;p&gt;Using FOR UPDATE SKIP LOCKED option can return those records not locked, instead of returning an error message&lt;/p&gt;&lt;code&gt;select *&lt;br /&gt;from dept&lt;br /&gt;for update skip locked;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-9165746978293634248?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/9165746978293634248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=9165746978293634248' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/9165746978293634248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/9165746978293634248'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/08/for-update-option-in-select-statement.html' title='For Update Option in Select Statement'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-3525327652202687156</id><published>2009-08-03T09:40:00.003+08:00</published><updated>2009-08-03T09:47:21.299+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Update Cascade and Delete Cascade</title><content type='html'>When creating a table with a foreign key, we can add additional option for purpose of update and delete:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;create table emp&lt;br /&gt;(id number primary key,&lt;br /&gt;dept number,&lt;br /&gt;constraint fk foreign key (dept)&lt;br /&gt;references dept (id) &lt;b&gt;on update cascade&lt;/b&gt;)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;When you change the &lt;i&gt;id&lt;/i&gt; column in &lt;i&gt;dept&lt;/i&gt; table, the changes will be propagated to the child table, or in other words the &lt;i&gt;dept&lt;/i&gt; column in &lt;i&gt;emp&lt;/i&gt; will be changed to the new dept's id as well.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;code&gt;create table emp&lt;br /&gt;(id number primary key,&lt;br /&gt;dept number,&lt;br /&gt;constraint fk foreign key (dept)&lt;br /&gt;references dept (id) &lt;b&gt;on delete cascade&lt;/b&gt;)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;When you delete a record in &lt;i&gt;dept&lt;/i&gt; table, the record in &lt;i&gt;emp&lt;/i&gt; table that referring to the deleted record will be removed as well.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-3525327652202687156?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/3525327652202687156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=3525327652202687156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3525327652202687156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3525327652202687156'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/08/update-cascade-and-delete-cascade.html' title='Update Cascade and Delete Cascade'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-2470474331021637651</id><published>2009-07-11T12:00:00.000+08:00</published><updated>2009-07-11T12:11:44.570+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>What is export and import in Oracle?</title><content type='html'>Export and Import are two utilities in Oracle database used to extract data from database into a single file, and also extract data from that single file into a database. We normally call that file as dump file. It is widely used during backup and transfer data from one database to another.&lt;ol&gt;&lt;li&gt;Use command below to show out the parameters that can be used in Export:&lt;br /&gt;&lt;code&gt;exp help=y&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To export everything in database:&lt;br /&gt;&lt;code&gt;exp [username]/[password]@[database] full=y file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To export everything in one single schema:&lt;br /&gt;&lt;code&gt;exp [username]/[password]@[database] owner=[schema] file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To export particular tables in database:&lt;br /&gt;&lt;code&gt;exp [username]/[password]@[database] tables=([table],[table]) file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To show parameters that can be used in Import:&lt;br /&gt;&lt;code&gt;imp help=y&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To import everything in a dump file:&lt;br /&gt;&lt;code&gt;imp [username]/[password]@[database] full=y file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To import particular schema in a dump file:&lt;br /&gt;&lt;code&gt;imp [username]/[password]@[database] fromuser=[schema in dump file] touser=[schema in db] file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To import particular tables in dump file:&lt;br /&gt;&lt;code&gt;imp [username]/[password]@[database] tables=([table],[table]) file=[dump file] log=[log file]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To import table structure only, add the following parameter:&lt;br /&gt;&lt;code&gt;rows=n&lt;/code&gt;&lt;/li&gt;&lt;li&gt;To import table (or other objects) that already exist in database, add following parameter:&lt;br /&gt;&lt;code&gt;ignore=y&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Normally import the whole database cannot be done in one shot, need to import objects of different type one by one:&lt;br /&gt;&lt;code&gt;imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=y constraints=n indexes=n grants=n&lt;br /&gt;imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=y indexes=n grants=n&lt;br /&gt;imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=n indexes=y grants=n&lt;br /&gt;imp [username]/[password]@[database] full=y file=[dump file] log=[log file] ignore=y rows=n constraints=n indexes=n grants=y&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-2470474331021637651?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/2470474331021637651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=2470474331021637651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2470474331021637651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2470474331021637651'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/what-is-export-and-import-in-oracle.html' title='What is export and import in Oracle?'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-2688542168503225710</id><published>2009-07-09T14:00:00.001+08:00</published><updated>2009-07-09T14:27:02.377+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Cursor and for loop in PL/SQL</title><content type='html'>In PL/SQL, we can use method below to query data from database:&lt;br /&gt;&lt;code&gt;select [column] into [variable]&lt;br /&gt;from [table];&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;However method above can only retrieve one single row of data. To retrieve data more than 1 row, we can use &lt;i&gt;cursor&lt;/i&gt; instead. First we need to declare the cursor at the declaration section:&lt;br /&gt;&lt;code&gt;cursor [cursor name] is [select statement];&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;cursor c is select id, name&lt;br /&gt;from emp;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Then at the operation section, we can use a special &lt;i&gt;for loop&lt;/i&gt; to retrieve the data:&lt;br /&gt;&lt;code&gt;for [row variable] in [cursor name] loop&lt;br /&gt;    do something;&lt;br /&gt;end loop;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;for r in c loop&lt;br /&gt;    insert into temp values (r.id, r.name);&lt;br /&gt;end loop;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-2688542168503225710?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/2688542168503225710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=2688542168503225710' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2688542168503225710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2688542168503225710'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/cursor-and-for-loop-in-plsql.html' title='Cursor and for loop in PL/SQL'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-9151067983412140362</id><published>2009-07-04T09:00:00.001+08:00</published><updated>2009-07-05T11:43:12.541+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic PL/SQL: Part 3 (Alternate and Loop)</title><content type='html'>IF structure syntax:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;if [condition] then&lt;br /&gt;[do something];&lt;br /&gt;elsif [condition] then&lt;br /&gt;[do something];&lt;br /&gt;else&lt;br /&gt;[do something];&lt;br /&gt;end if;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;LOOP syntax:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;loop&lt;br /&gt;[do something];&lt;br /&gt;exit when (condition);&lt;br /&gt;end loop;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;WHILE LOOP syntax:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;while (condition) loop&lt;br /&gt;[do something];&lt;br /&gt;end loop;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;FOR LOOP syntax:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;for [counter] in [start] .. [end] loop&lt;br /&gt;[do something];&lt;br /&gt;end loop;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-9151067983412140362?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/9151067983412140362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=9151067983412140362' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/9151067983412140362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/9151067983412140362'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/basic-plsql-part-3-alternate-and-loop.html' title='Basic PL/SQL: Part 3 (Alternate and Loop)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-4365804197299859364</id><published>2009-07-04T08:30:00.000+08:00</published><updated>2009-07-04T08:43:33.381+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic PL/SQL: Part 2 (Function, Produre and Trigger)</title><content type='html'>Syntax to create Function:&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; font-size: 13px; "&gt;CREATE OR REPLACE FUNCTION [function name]([parameter] [IN|OUT] [data type])&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;code&gt;RETURN [data type]&lt;br /&gt;AS&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[declare];&lt;br /&gt;&lt;/code&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;BEGIN&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[do something];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;RETURN [something];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; "&gt;END;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; "&gt;/ &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Syntax to create Procedure:&lt;br /&gt;&lt;code&gt;CREATE OR REPLACE PROCEDURE [procedure name]([parameter] [IN|OUT] [data type]) AS&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[declaration];&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; font-size: 13px; "&gt;BEGIN&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: monospace, fantasy; font-size: 13px; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[do something];&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: monospace, -webkit-fantasy; font-size: 13px; "&gt;END;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: monospace, -webkit-fantasy; font-size: 13px; "&gt;/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Syntax to create Trigger:&lt;br /&gt;&lt;code&gt;CREATE OR REPLACE TRIGGER [trigger name]&lt;/code&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; [&lt;/span&gt;AFTER | BEFORE] [INSERT OR UPDATE OR DELETE] ON [table name]&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW&lt;br /&gt;BEGIN&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;IF INSERTING THEN&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[do something];&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END IF;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;IF UPDATING THEN&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[do something];&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END IF;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;IF DELETING THEN&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[do something];&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END IF;&lt;br /&gt;END;&lt;br /&gt;/&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style="font-size:16px;"&gt;&lt;span class="Apple-style-span"   style="font-family:monospace, fantasy;font-size:100%;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-4365804197299859364?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/4365804197299859364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=4365804197299859364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4365804197299859364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/4365804197299859364'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/basic-plsql-part-2-function-produre-and.html' title='Basic PL/SQL: Part 2 (Function, Produre and Trigger)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-5623116694324597488</id><published>2009-07-02T09:45:00.000+08:00</published><updated>2009-07-02T09:48:38.241+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic PL/SQL: Part 1 (Anonymous)</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;div&gt;SQL is only used to interact with database, and itself cannot be coded in procedural structure (which means no alternate or looping). To solve this weakness, Oracle provides another language called PL/SQL (Procedural Language/Structured Query Language). 4 situations that we can use PL/SQL:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Anonymous&lt;/b&gt;, it is written in script form and saved as file, not a database object and cannot pass in any parameters or return any value.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Procedure&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Function&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Trigger&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;Basic syntax to write an anonymous PL/SQL:&lt;/div&gt;&lt;br /&gt;&lt;code&gt;declare&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[variable name] [data type] := [default value];&lt;br /&gt;begin&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[action to be performed];&lt;br /&gt;exception&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;while others then&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[exception handler];&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;declare&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;v_name varchar(50) := '';&lt;br /&gt;begin&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;select name into v_name&lt;/code&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;from emp&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;where id = 1;&lt;br /&gt;exception&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;while others then&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;raise;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-5623116694324597488?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/5623116694324597488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=5623116694324597488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/5623116694324597488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/5623116694324597488'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/basic-plsql-part-1-anonymous.html' title='Basic PL/SQL: Part 1 (Anonymous)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-5200215761754437167</id><published>2009-07-01T16:30:00.001+08:00</published><updated>2009-07-03T17:06:45.330+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Functions in Oracle</title><content type='html'>&lt;div&gt;Oracle provides some predefined functions that can be used in SQL:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Date function:&lt;/div&gt;&lt;div&gt;&lt;b&gt;months_between(date1, date2)&lt;/b&gt;, return months between &lt;i&gt;date1 &lt;/i&gt;and &lt;i&gt;date2&lt;/i&gt;. For example months_between('1/jan/09', '2/feb/09') will return 1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;sysdate&lt;/b&gt; will return today's date.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;String function:&lt;/div&gt;&lt;div&gt;&lt;b&gt;lpad(str, l, chr)&lt;/b&gt;, left padding &lt;i&gt;str &lt;/i&gt;with &lt;i&gt;chr &lt;/i&gt;in length &lt;i&gt;l&lt;/i&gt;. For example lpad('1', 3, '0') will return '001'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;rpad(str, l, chr)&lt;/b&gt;, right padding &lt;i&gt;str &lt;/i&gt;with &lt;i&gt;chr&lt;/i&gt; in length &lt;i&gt;l&lt;/i&gt;. For example rpad('1', 3, '0') will return '100'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;length(str)&lt;/b&gt;, return the length of &lt;i&gt;str&lt;/i&gt;. For example length('1234') will return 4.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;substr(str, s, l)&lt;/b&gt;, return portion of &lt;i&gt;str&lt;/i&gt;, start from position &lt;i&gt;s&lt;/i&gt;, follow by length &lt;i&gt;l&lt;/i&gt;. For example substr('123456', 2, 2) will return 23.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Conversion function:&lt;/div&gt;&lt;div&gt;&lt;b&gt;to_date(str, f)&lt;/b&gt;, convert &lt;i&gt;str&lt;/i&gt; to date in the format of &lt;i&gt;f&lt;/i&gt;. For example to_date('1/7/2009', 'dd/mm/yyyy').&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;to_char(num)&lt;/b&gt;, convert &lt;i&gt;num&lt;/i&gt; to string.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;to_number(str)&lt;/b&gt;, convert &lt;i&gt;str&lt;/i&gt; to number.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Group function:&lt;/div&gt;&lt;div&gt;&lt;b&gt;count(c)&lt;/b&gt;, return number of row where c is the column name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;sum(c)&lt;/b&gt;, return the sum of value in column &lt;i&gt;c &lt;/i&gt;where c should be a numeric column.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;max(c)&lt;/b&gt;, return the maximum value in column &lt;i&gt;c&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;min(c)&lt;/b&gt;, return the minimum value in column &lt;i&gt;c&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Others:&lt;/div&gt;&lt;div&gt;&lt;b&gt;nvl(val, ret)&lt;/b&gt;, return value of &lt;i&gt;ret &lt;/i&gt;if &lt;i&gt;val&lt;/i&gt; is null.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;decode(val, cond1, ret1, cond2, ret2, ret3)&lt;/b&gt;, same as:&lt;/div&gt;&lt;code&gt;&lt;div&gt;if (val == cond1) return ret1&lt;/div&gt;&lt;div&gt;else if (val == cond2) return ret2&lt;/div&gt;&lt;div&gt;else return ret3&lt;/div&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-5200215761754437167?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/5200215761754437167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=5200215761754437167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/5200215761754437167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/5200215761754437167'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/functions-in-oracle.html' title='Functions in Oracle'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-6644449185126375985</id><published>2009-07-01T10:30:00.000+08:00</published><updated>2009-07-01T10:35:08.299+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Data Types in Oracle</title><content type='html'>Data types in Oracle:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;char(l)&lt;/b&gt;, is used to store fixed length string where &lt;i&gt;l&lt;/i&gt; is the maximum length of the string.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;varchar2(l)&lt;/b&gt;, is used to store variable length string where &lt;i&gt;l&lt;/i&gt; is the maxium length of the string. Different of varchar2 and char is that: no matter how long the string store in char, it will reserve space of length defined in char, while varchar2's length can be flexible.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;varchar(l)&lt;/b&gt;, is same as varchar2 but varchar2 have a higher string length capacity.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;number(p, s)&lt;/b&gt;, is used to store either integer or double, where p (precision) is the length of the number and s (scale) is the decimal of the number.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;date&lt;/b&gt;, is used to store date and time, where the default date time format is &lt;i&gt;dd/mon/yy hh24:mm:ss&lt;/i&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;blob &lt;/b&gt;is used to store binary object like image, document or audio file. lob is stand for Large Object.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;long &lt;/b&gt;is used to store string, which has longer capacity than varchar2.&lt;/li&gt;&lt;li&gt;&lt;b&gt;raw &lt;/b&gt;is used to store binary object like blob, and actually is obsolete.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-6644449185126375985?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/6644449185126375985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=6644449185126375985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6644449185126375985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/6644449185126375985'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/07/data-types-in-oracle.html' title='Data Types in Oracle'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-2490697365317788979</id><published>2009-07-01T09:35:00.000+08:00</published><updated>2009-07-01T09:37:31.398+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Alter (Part 7)</title><content type='html'>Alter statement is used to alter the structure of database objects, and like Create statement, different objects have different syntax. Below are example to alter a table:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Add column:&lt;code&gt;&lt;br /&gt;alter table [table name]&lt;br /&gt;add [column name] [data type]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Example:&lt;code&gt;&lt;br /&gt;alter table temp&lt;br /&gt;add test varchar(10);&lt;br /&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, fantasy;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Remove column:&lt;code&gt;&lt;br /&gt;alter table [table name]&lt;br /&gt;drop column [column name]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Example:&lt;code&gt;&lt;br /&gt;alter table temp&lt;br /&gt;drop column test;&lt;br /&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, fantasy;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Add constraint:&lt;code&gt;&lt;br /&gt;alter table [table name]&lt;br /&gt;add constraint [constraint name] [constraint type] [constraint details]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Example:&lt;code&gt;&lt;br /&gt;alter table temp&lt;br /&gt;add constraint temp_uk unique (name);&lt;br /&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, fantasy;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Remove constraint:&lt;code&gt;&lt;br /&gt;alter table [table name]&lt;br /&gt;drop constraint [constraint name]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Example:&lt;code&gt;&lt;br /&gt;alter table temp&lt;br /&gt;drop constraint temp_uk;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;To change password of a user, use syntax below:&lt;code&gt;&lt;br /&gt;alter user [user name]&lt;br /&gt;identified by [new password]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Example:&lt;code&gt;&lt;br /&gt;alter user james&lt;br /&gt;identified by new_password;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-2490697365317788979?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/2490697365317788979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=2490697365317788979' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2490697365317788979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2490697365317788979'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-alter-part-7.html' title='Basic SQL: Alter (Part 7)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-8389211071258220265</id><published>2009-06-30T13:30:00.002+08:00</published><updated>2009-07-03T17:07:41.304+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Create (Part 6)</title><content type='html'>Create statement is used to create database objects, and different objects have different syntax. Below are basic syntax for creating some common database objects:&lt;ol&gt;&lt;li&gt;Create Table:&lt;br /&gt;&lt;code&gt;create table [table name]&lt;br /&gt;(&lt;br /&gt;[column name] [data type] [not null],&lt;br /&gt;constraint [constraint name] [constraint type] [constraint detail]&lt;br /&gt;)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;create table emp&lt;br /&gt;(&lt;br /&gt;id number not null,&lt;br /&gt;name varchar(50),&lt;br /&gt;dept number,&lt;br /&gt;salary number(9,2) not null,&lt;br /&gt;constraint emp_pk primary key (id),&lt;br /&gt;constraint emp_fk foreign key (dept) references dept (id),&lt;br /&gt;constraint emp_uq unique (id),&lt;br /&gt;constraint emp_chk check (salary &gt;= 0)&lt;br /&gt;);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Tips to clone a table:&lt;br /&gt;&lt;code&gt;create table emp_clone as&lt;br /&gt;select * from emp;&lt;br /&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style="font-size:16px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, fantasy;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Create View:&lt;br /&gt;&lt;code&gt;create view [view name] as&lt;br /&gt;[select statement]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;create view emp_vu as&lt;br /&gt;select *&lt;br /&gt;from emp&lt;br /&gt;where dept = 'ACCOUNT';&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create User:&lt;br /&gt;&lt;code&gt;create user [user name]&lt;br /&gt;identified by [password]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;create user james&lt;br /&gt;identified by secret;&lt;span class="Apple-style-span"   style="font-family:Georgia, fantasy;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style="font-size:16px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, fantasy;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create Synonym:&lt;br /&gt;&lt;code&gt;create [public] synonym [alias] for [database object]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;create public synonym employee for emp;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-8389211071258220265?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/8389211071258220265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=8389211071258220265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8389211071258220265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/8389211071258220265'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-create-part-6.html' title='Basic SQL: Create (Part 6)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-1628893467319324247</id><published>2009-06-30T11:00:00.001+08:00</published><updated>2009-06-30T11:18:58.000+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Delete (Part 5)</title><content type='html'>Delete statement is used to remove existing data from table. Basic syntax is as below:&lt;div&gt;&lt;code&gt;delete from [table]&lt;br /&gt;where [conditions]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Example:&lt;br /&gt;&lt;code&gt;delete from emp&lt;br /&gt;where id = 1;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div&gt;Same as Update statement, if where conditions is not set, it will remove all the data in the table.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-1628893467319324247?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/1628893467319324247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=1628893467319324247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1628893467319324247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1628893467319324247'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-delete-part-5.html' title='Basic SQL: Delete (Part 5)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-2569400055753506458</id><published>2009-06-30T09:50:00.001+08:00</published><updated>2009-06-30T11:18:20.643+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Update (Part 4)</title><content type='html'>Update statement is used to modify existing records in table. Below is the basic syntax:&lt;br /&gt;&lt;code&gt;update [table]&lt;br /&gt;set [columns] = [value]&lt;br /&gt;where [conditions]&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For example:&lt;/div&gt;&lt;code&gt;update emp&lt;br /&gt;set name = 'James Bond',&lt;br /&gt;dept = 'ADMIN'&lt;br /&gt;where id = 1;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Aware that if we didn't put any &lt;b&gt;where condition&lt;/b&gt;, the statement will apply the changes to all the records.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-2569400055753506458?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/2569400055753506458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=2569400055753506458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2569400055753506458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2569400055753506458'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-update-part-4.html' title='Basic SQL: Update (Part 4)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-351706190860829341</id><published>2009-06-30T09:40:00.003+08:00</published><updated>2009-07-03T12:29:48.256+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Insert (Part 3)</title><content type='html'>Insert statement is used to add new records into table. Below is the basic syntax:&lt;div&gt;&lt;code&gt;insert into [table] ([columns])&lt;br /&gt;values ([values])&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example for Insert statement:&lt;/div&gt;&lt;code&gt;insert into emp (id, name, dept)&lt;br /&gt;values (1, 'James', 'ACCOUNT');&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;To insert a batch of records from another table, we can use method below:&lt;br /&gt;&lt;code&gt;insert into table&lt;br /&gt;[select statement]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;code&gt;insert into emp_account (id, name, dept)&lt;br /&gt;select id, name, dept&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;from emp&lt;br /&gt;where dept = 'ACCOUNT';&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-351706190860829341?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/351706190860829341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=351706190860829341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/351706190860829341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/351706190860829341'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-insert-part-3.html' title='Basic SQL: Insert (Part 3)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-3738484323535473318</id><published>2009-06-30T09:00:00.002+08:00</published><updated>2009-06-30T11:17:12.256+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL: Select (Part 2)</title><content type='html'>Select statement is used to query data from database. Basic syntax is like below:&lt;br /&gt;&lt;code&gt;select [columns as alias]&lt;br /&gt;from [tables as alias]&lt;br /&gt;where [conditions]&lt;br /&gt;group by [columns]&lt;br /&gt;having [group conditions]&lt;br /&gt;order by [columns]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Some example of select statement:&lt;br /&gt;&lt;code&gt;select id as ID, name as "Employee Name", dept as Department&lt;br /&gt;from emp as e&lt;br /&gt;where e.name like '%JAMES%&lt;br /&gt;order by e.id;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;select e.id as ID, e.name as "Employee Name", count(*) as Count&lt;br /&gt;from emp as e&lt;br /&gt;group by e.id, e.name&lt;br /&gt;having count(*) &gt; 10;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Some special select statements:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Inner join&lt;/span&gt;, where both tables must have the same data.&lt;br /&gt;&lt;code&gt;select e.id, e.name, e.dept, d.name&lt;br /&gt;from emp e, dept d&lt;br /&gt;where e.dept = d.id;&lt;/code&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;code&gt;select e.id, e.name, e.dept, d.name&lt;br /&gt;from emp e join dept d on e.dept = d.id;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Outer Join&lt;/span&gt;, where both tables might not have the same data.&lt;br /&gt;&lt;code&gt;select e.id, e.name, e.dept, d.name&lt;br /&gt;from emp e, dept d&lt;br /&gt;where e.dept = d.id(+);&lt;/code&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;code&gt;select e.id, e.name, e.dept, d.name&lt;br /&gt;from emp e left join dept d on e.dept = d.id;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Inner Query&lt;/span&gt;, a select statement within a select statement which technically is a temporary view.&lt;br /&gt;&lt;code&gt;select e.id, e.name, e.dept, d.name&lt;br /&gt;from emp e, (select * from dept where name like '%ACCOUNT%') d&lt;br /&gt;where e.dept = d.id;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Union&lt;/span&gt;&lt;span&gt;, mix two (or more) select statements' result together. Those duplicated records will only show 1 record and columns selected by all the statements must be the same.&lt;/span&gt;&lt;br /&gt;&lt;code&gt;select e.id&lt;br /&gt;from emp e&lt;br /&gt;union&lt;br /&gt;select e.id&lt;br /&gt;from emp1 e;&lt;br /&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Intersect&lt;/span&gt;&lt;span&gt;, show only records that exist in both (or more) select statements. Same as &lt;b&gt;Union&lt;/b&gt;, &lt;/span&gt;duplicated records will only show 1 record and columns selected by all the statements must be the same.&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;select e.id&lt;br /&gt;from emp e&lt;br /&gt;intersect&lt;br /&gt;select e.id&lt;br /&gt;from emp1 e;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Minus&lt;/span&gt;&lt;span&gt;, show only records in the first select statement that do not exist in the second statement.&lt;/span&gt;&lt;br /&gt;&lt;code&gt;select e.id&lt;br /&gt;from emp e&lt;br /&gt;minus&lt;br /&gt;select i.issueby&lt;br /&gt;from invoice i;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-3738484323535473318?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/3738484323535473318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=3738484323535473318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3738484323535473318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3738484323535473318'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-select-part-2.html' title='Basic SQL: Select (Part 2)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-7017109482144084229</id><published>2009-06-30T08:40:00.001+08:00</published><updated>2009-06-30T08:41:40.932+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Basic SQL (Part 1)</title><content type='html'>There are 3 types of SQL statement:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Data Manipulation Language (DML)&lt;/b&gt;, used to manipulate data in a table. 4 types of DML:&lt;ol type="i"&gt;&lt;li&gt;&lt;b&gt;Select&lt;/b&gt;, used to query data.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Insert&lt;/b&gt;, used to add new data.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Update&lt;/b&gt;, used to modify existing data.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Delete&lt;/b&gt;, used to remove data.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Data Definition Language (DDL)&lt;/b&gt;, used to manipulate structure of the database objects, which include table, view and others. 3 types of DDL:&lt;ol type="i"&gt;&lt;li&gt;&lt;b&gt;Create&lt;/b&gt;, used to add new database object.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Alter&lt;/b&gt;, used to modify existing database object structure, for example add column to a table.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Drop&lt;/b&gt;, used to remove database object.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Transaction Control Language (TCL)&lt;/b&gt;, used to control the transaction. When user issues the first SQL statement, a transaction will be started and user can decide to end the transaction with either &lt;b&gt;Commit&lt;/b&gt; or &lt;b&gt;Rollback&lt;/b&gt;.&lt;ol type="i"&gt;&lt;li&gt;&lt;b&gt;Commit&lt;/b&gt;, used to save changes made by user.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Rollback&lt;/b&gt;, used to undo all the changes made by user.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Savepoint&lt;/b&gt;, used to make checkpoint for commit or rollback operation.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-7017109482144084229?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/7017109482144084229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=7017109482144084229' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/7017109482144084229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/7017109482144084229'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/basic-sql-part-1.html' title='Basic SQL (Part 1)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-3335164294312580283</id><published>2009-06-29T15:30:00.001+08:00</published><updated>2009-06-29T15:43:23.683+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Objects in database (Part 2)</title><content type='html'>Continue on objects in database:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Constraint &lt;/span&gt;is rule set in table's columns, where data to be modified must follow. Example of constraint including:&lt;/li&gt;&lt;ol type="i"&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Primary Key&lt;/span&gt;, where the column(s) is the identifier of records in the table, must not be null (in Oracle, where there is relational database which allow primary key to be null) and must be unique.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Unique&lt;/span&gt;, where data in this column must be unique or no duplicate, but can be null.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Not null&lt;/span&gt;, where this column must not be null (null and empty or zero is not the same).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Foreign Key&lt;/span&gt;, where data in this column must exist in another table's Primary key.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Check&lt;/span&gt;, normally is the user defined constraint, for example this column can only have integer more than 0.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Index &lt;/span&gt;is table reference which can make the search of record faster. Index is created based on column(s), and create a primary key will always generate an index based on the key.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Function&lt;/span&gt;&lt;span&gt; is a short hand of PL/SQL which can &lt;/span&gt;return a value. It can either be used in PL/SQL or inside a SQL statement.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Procedure &lt;/span&gt;is also short hand of PL/SQL, which do not return any value. It cannot be used in SQL statement.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Package&lt;/span&gt; is collection of functions and procedures. It has 2 parts:&lt;/li&gt;&lt;ol type="i"&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Package specification&lt;/span&gt;, where defined which function or procedure can be used by user, or open to public. The body of function and procedure will not be coded in here.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Package body&lt;/span&gt;, where all the all the body of function and procedure is coded.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Trigger&lt;/span&gt;&lt;span&gt; is event handler&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;of table. For example, we can create a trigger to do something when data is inserted, updated or deleted in a table.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Sequence&lt;/span&gt;&lt;span&gt; is &lt;/span&gt;code generator for records, and it can only generate integer.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-3335164294312580283?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/3335164294312580283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=3335164294312580283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3335164294312580283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3335164294312580283'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/objects-in-database-part-2.html' title='Objects in database (Part 2)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-2810870704900286713</id><published>2009-06-29T15:05:00.000+08:00</published><updated>2009-06-29T15:08:32.693+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Objects in database (Part 1)</title><content type='html'>Objects inside a relational database:&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;User &lt;/b&gt;is the login used to access database. User itself cannot do anything, not even can access to database. It needs to be granted with neccessary &lt;span style="font-weight: bold;"&gt;privileges &lt;/span&gt;in order to access database and perform any operations, for example we need to grant &lt;b&gt;create session&lt;/b&gt; privilege to users in order for them to access database and &lt;b&gt;create table&lt;/b&gt; privilege for them to create table.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Role &lt;/b&gt;is simply a collection of privileges that predefined in the database. For example, if we grant &lt;b&gt;dba &lt;/b&gt;role (Database Administrator) to a user, the user can do anything within the rights defined in role dba. We can even create customized role like &lt;span style="font-weight: bold;"&gt;clerk&lt;/span&gt; and grant it to user, so that the user can (and only) access clerk related data.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Schema &lt;/b&gt;can be defined as a group with the database objects inside, and in Oracle it is simply the user who created the database objects. For example when user &lt;b&gt;james &lt;/b&gt;create a table &lt;b&gt;invoice&lt;/b&gt;, this &lt;b&gt;invoice &lt;/b&gt;table will be under &lt;b&gt;james&lt;/b&gt; schema.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Session &lt;/b&gt;is the connection when a user logs into the database.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Table &lt;/b&gt;is place where actual data is kept, which formed by column and row. Column is the structure of the table, while row is the record of the table.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Synonym &lt;/b&gt;is alias of table (and some other database objects).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;View &lt;/span&gt;is a short hand for SQL select statement, which can present the table in a different format. From user's point of view, view and table will not have different, except that user cannot modify data in a view.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-2810870704900286713?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/2810870704900286713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=2810870704900286713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2810870704900286713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/2810870704900286713'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/objects-in-database-part-1.html' title='Objects in database (Part 1)'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-1350607627873288661</id><published>2009-06-29T08:00:00.000+08:00</published><updated>2009-06-29T15:09:08.314+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>How to create new database?</title><content type='html'>Steps to create new database:&lt;ol&gt;&lt;li&gt;Run &lt;b&gt;Database Configuration Assistant&lt;/b&gt; (&lt;b&gt;DBCA&lt;/b&gt;), either from Start Menu or by command prompt issue "dbca" command.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n2Fk3SKOEvM/SkgmM35Y-9I/AAAAAAAAALY/xJKqcwau4QI/s1600-h/1.JPG" style="text-decoration: none;"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://2.bp.blogspot.com/_n2Fk3SKOEvM/SkgmM35Y-9I/AAAAAAAAALY/xJKqcwau4QI/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570159734782930" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select &lt;b&gt;Create a Database&lt;/b&gt; option and click &lt;b&gt;Next&lt;/b&gt; button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n2Fk3SKOEvM/SkgmM9-_A1I/AAAAAAAAALg/FjbL48ECpYQ/s1600-h/2.JPG" style="text-decoration: none;"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://1.bp.blogspot.com/_n2Fk3SKOEvM/SkgmM9-_A1I/AAAAAAAAALg/FjbL48ECpYQ/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570161368859474" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select &lt;b&gt;General Purpose&lt;/b&gt; and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNOO-QqI/AAAAAAAAALo/GfPBrymUljw/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://1.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNOO-QqI/AAAAAAAAALo/GfPBrymUljw/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570165730886306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Global Database Name&lt;/b&gt; and &lt;b&gt;SID &lt;/b&gt;are simply refer to your database name. Key in your database name and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNRdn-WI/AAAAAAAAALw/HE9Fq6yLJkE/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNRdn-WI/AAAAAAAAALw/HE9Fq6yLJkE/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570166597646690" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Enterprise Manager&lt;/b&gt; is Oracle default management tools for database and it is in a separate installation. Untick &lt;b&gt;Configure the Database with Enterprise Manager&lt;/b&gt; and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNqS2mcI/AAAAAAAAAL4/WXPYjM4j73k/s1600-h/5_1.JPG" style="text-decoration: none;"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgmNqS2mcI/AAAAAAAAAL4/WXPYjM4j73k/s400/5_1.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570173263354306" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Key in password for system user and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7_9wGHI/AAAAAAAAAMg/8zQ7R6Eda3E/s1600-h/6.JPG" style="text-decoration: none;"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7_9wGHI/AAAAAAAAAMg/8zQ7R6Eda3E/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570969354410098" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select &lt;b&gt;File System&lt;/b&gt; in order to have the option to select where to create the database, then continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n2Fk3SKOEvM/Skgm78aiXwI/AAAAAAAAAMY/QKeizsSSlEc/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://4.bp.blogspot.com/_n2Fk3SKOEvM/Skgm78aiXwI/AAAAAAAAAMY/QKeizsSSlEc/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570968401403650" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Select &lt;b&gt;Use Common Location for All Database Files&lt;/b&gt; and key in the location where the database to be created, then continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7mm6VLI/AAAAAAAAAMQ/SW2YmDSTwPg/s1600-h/8.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://3.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7mm6VLI/AAAAAAAAAMQ/SW2YmDSTwPg/s400/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570962547725490" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Untick &lt;b&gt;Specify Flash Recovery Area&lt;/b&gt; and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7c9yQtI/AAAAAAAAAMI/456Gve5dMWo/s1600-h/9_1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7c9yQtI/AAAAAAAAAMI/456Gve5dMWo/s400/9_1.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570959959311058" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Just continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7LGLNiI/AAAAAAAAAMA/w9I1Xx1MhI4/s1600-h/10.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://2.bp.blogspot.com/_n2Fk3SKOEvM/Skgm7LGLNiI/AAAAAAAAAMA/w9I1Xx1MhI4/s400/10.JPG" alt="" id="BLOGGER_PHOTO_ID_5352570955162662434" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Leave as default and continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgnRIEAjuI/AAAAAAAAAM4/uURL-X0D_Wg/s1600-h/11.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://3.bp.blogspot.com/_n2Fk3SKOEvM/SkgnRIEAjuI/AAAAAAAAAM4/uURL-X0D_Wg/s400/11.JPG" alt="" id="BLOGGER_PHOTO_ID_5352571332305391330" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Continue.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n2Fk3SKOEvM/SkgnRMCJtfI/AAAAAAAAAMw/fvrkNbQKKmU/s1600-h/12.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://4.bp.blogspot.com/_n2Fk3SKOEvM/SkgnRMCJtfI/AAAAAAAAAMw/fvrkNbQKKmU/s400/12.JPG" alt="" id="BLOGGER_PHOTO_ID_5352571333371344370" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Finally click &lt;b&gt;Finish &lt;/b&gt;button to create database.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n2Fk3SKOEvM/SkgnQ9SqL4I/AAAAAAAAAMo/fIkpfiCh8sw/s1600-h/13.JPG" style="text-decoration: none;"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 350px; height: 312px;" src="http://4.bp.blogspot.com/_n2Fk3SKOEvM/SkgnQ9SqL4I/AAAAAAAAAMo/fIkpfiCh8sw/s400/13.JPG" alt="" id="BLOGGER_PHOTO_ID_5352571329414049666" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-1350607627873288661?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/1350607627873288661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=1350607627873288661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1350607627873288661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/1350607627873288661'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/how-to-create-new-database.html' title='How to create new database?'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_n2Fk3SKOEvM/SkgmM35Y-9I/AAAAAAAAALY/xJKqcwau4QI/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2948126600672374905.post-3934721607787783904</id><published>2009-06-28T12:00:00.001+08:00</published><updated>2009-07-03T07:53:32.111+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>What is relational database?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n2Fk3SKOEvM/Sk1IQU9EoYI/AAAAAAAAANI/M-yaOsaxpY8/s1600-h/oracle.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 309px; height: 400px;" src="http://1.bp.blogspot.com/_n2Fk3SKOEvM/Sk1IQU9EoYI/AAAAAAAAANI/M-yaOsaxpY8/s400/oracle.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5354014977353359746" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;Oracle RDBMS&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;Database is a place where you store your data, like text file, spreadsheet, and further more relational database.&lt;br /&gt;&lt;br /&gt;What make relational database different from the others is that, it uses logical tables to store data, and users need to interact with relational database using SQL (Structured Query Language).&lt;br /&gt;&lt;br /&gt;For example if you create a program that store data in a text file, you need to play around with the file format or structure, then direct read from and write into the text file. While if you're using relational database, you need to deal with tables and issue SQL statement to do anything.&lt;br /&gt;&lt;br /&gt;Another difference between relational database with others is that, it needs a DBMS (Database Management System) in order to work. All the SQL statement you issued need to go through the middle man DBMS.&lt;br /&gt;&lt;br /&gt;That's where server come into the picture. Normally people will install DBMS and database (aware that it is 2 different entities, since you can install DBMS without any database) into a server and let users to access through client tools, website or customized programs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2948126600672374905-3934721607787783904?l=vicker313.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vicker313.blogspot.com/feeds/3934721607787783904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2948126600672374905&amp;postID=3934721607787783904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3934721607787783904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2948126600672374905/posts/default/3934721607787783904'/><link rel='alternate' type='text/html' href='http://vicker313.blogspot.com/2009/06/what-is-relational-database.html' title='What is relational database?'/><author><name>Javy Kong</name><uri>https://profiles.google.com/105169536912290467497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-U-cTpEW4KsI/AAAAAAAAAAI/AAAAAAAAAAA/xSBzXiNHkFI/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n2Fk3SKOEvM/Sk1IQU9EoYI/AAAAAAAAANI/M-yaOsaxpY8/s72-c/oracle.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
