<?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-14412315</id><updated>2011-11-18T23:58:48.733+05:30</updated><title type='text'>Data Base Tips/ SQL Commands...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-14412315.post-112370800010628477</id><published>2005-08-11T02:36:00.000+05:30</published><updated>2005-08-11T02:36:40.110+05:30</updated><title type='text'>Easily change your Oracle password</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Arial;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt; &lt;div&gt;&lt;span style="font-size: 9pt; color: rgb(51, 51, 51);"&gt;&lt;br&gt; &lt;font size="2"&gt;&lt;span style="font-family: courier new,monospace;"&gt;From Oracle 8 on, you can use the command: &lt;/span&gt;&lt;br style="font-family: courier new,monospace;"&gt; &lt;br style="font-family: courier new,monospace;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: courier new,monospace;"&gt;SQL&amp;gt; password&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(51, 51, 51); font-family: courier new,monospace;"&gt;  &lt;br&gt;&lt;br&gt;in SQL*Plus to easily change your password. By using &lt;br&gt;&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: courier new,monospace;"&gt;SQL&amp;gt; password &amp;lt;username&amp;gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(51, 51, 51); font-family: courier new,monospace;"&gt;  &lt;br&gt;&lt;br&gt;you can change the password of another user. &lt;br&gt;This method has the advantage that the new password is not echoed on the screen.&lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;div style="font-family: courier new,monospace;"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 9pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&lt;br&gt; &lt;/font&gt; &lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112370800010628477?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112370800010628477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112370800010628477' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112370800010628477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112370800010628477'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/easily-change-your-oracle-password.html' title='Easily change your Oracle password'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112357797757206344</id><published>2005-08-09T14:29:00.000+05:30</published><updated>2005-08-09T14:29:37.586+05:30</updated><title type='text'>The VSIZE function</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt; &lt;p style="margin: 0in 0in 0pt; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(153, 51, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;To determine the exact number of bytes occupied of a table. The function 'VSIZE' reports the exact number of bytes allocated by Oracle for data. &lt;/span&gt;&lt;br style="color: rgb(0, 0, 0);"&gt;&lt;br style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;For example, to determine the size of a table called 'fuzzy_pink_slippers' with columns 'col_a', 'col_b', ...'col_n', execute the following SQL statement to find the exact size of the table: &lt;/span&gt;&lt;br&gt;&lt;br style="font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Courier; font-weight: bold;"&gt;SELECT SUM (VSIZE (col_a)) + SUM (VSIZE (col_b)) + ... + &lt;br&gt;SUM (VSIZE (col_n))  &lt;br&gt;FROM fuzzy_pink_slippers;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Courier;"&gt;&lt;/span&gt; &lt;br&gt; &lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112357797757206344?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112357797757206344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112357797757206344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112357797757206344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112357797757206344'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/vsize-function.html' title='The VSIZE function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112318849040909473</id><published>2005-08-05T02:18:00.000+05:30</published><updated>2005-08-05T02:18:10.413+05:30</updated><title type='text'>Performace / Set Timing On</title><content type='html'>&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;br&gt; We&amp;nbsp; can measure the performance of different queries by setting TIMING:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier; font-weight: bold;"&gt;Set Timing on&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Now, each time we run a query, we will see the time it took Oracle to solve it at the end. This is especially good when we are debating on which way is faster (e.g., a join or a sub query).&lt;/span&gt;&lt;/div&gt;&lt;span class="q"&gt; &lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112318849040909473?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112318849040909473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112318849040909473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112318849040909473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112318849040909473'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/performace-set-timing-on.html' title='Performace / Set Timing On'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112318841340105058</id><published>2005-08-05T02:16:00.000+05:30</published><updated>2005-08-05T02:16:53.710+05:30</updated><title type='text'>Commit / No Commit</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt; &lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;div&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;br&gt; Commit will always tell you commit complete But that does not necessarily mean you got what you wanted. Try typing commit; without doing anything, and you will see that you will get the same message. You need to know when oracle does a commit without your asking. For example, creating a table commits the previous information.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;The Following actions generate an implicit commit:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;1. Quit or exit&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;2. Create a Table or View (DDL)&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;3. Drop table, view, and grant&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;4. Revoke&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;5. Connect, Disconnect&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;6. Alter, Audit, noAudit.&lt;br&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;br&gt; We can conclude that the commands like update which just changes the contents are not commited and commands like alter, drop which manipulates the table structure are autocommited. It is from the perspective of the table manipulations.&lt;br&gt; &lt;br&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112318841340105058?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112318841340105058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112318841340105058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112318841340105058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112318841340105058'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/commit-no-commit.html' title='Commit / No Commit'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112299334485592527</id><published>2005-08-02T20:05:00.000+05:30</published><updated>2005-08-02T20:05:47.946+05:30</updated><title type='text'>Creating a Spool File</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt; &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;Male sure you save each session. This is especially useful at the beginning of your learning experience. Spool files help you analyze the mistakes you make and allow you to continue at a later time as opposed to start all over again. To Create a spool file, you can type: &lt;/span&gt;&lt;/div&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier"&gt;SQL&amp;gt; spool c:\My Documents\sessionName.lst&lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;The .lst(list) qualifier is nto required, but is highly recommended.&lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;When you complete your session, it is a good practice to close your spool file : &lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier"&gt;SQL&amp;gt; Spool off;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Courier"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112299334485592527?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112299334485592527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112299334485592527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112299334485592527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112299334485592527'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/creating-spool-file.html' title='Creating a Spool File'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112290580289219720</id><published>2005-08-01T19:46:00.000+05:30</published><updated>2005-08-01T19:46:42.910+05:30</updated><title type='text'>SQL Scripts</title><content type='html'>&lt;br&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;You can type each SQL Command at the SQL&amp;gt; prompt and end it with a semiconlon - ; This Works fine. You might however, choose to write your commands and execute them altogether, by running a script.  &lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&lt;strong&gt;To run a script, you should follow these steps:&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;1. Using the tect editor of your choice(e.g., Notepad, TexPad, WordPad), create a file called myCommands.sql. The .sql qualifier is not required, but is highly recomended.  &lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;2. Scripts can contain commnets. the convention for writing comments is: /* Your comments here, not sql Commands */. You should comment all you scripts. Imagine you want to figure out what you did 6 months down the road!!! you will be thankful you took the time to write comments. &lt;/span&gt;&lt;/p&gt; &lt;p style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;3. Run the script. For example: @C:\My Documents\scriptname.sql will exdcute the script called scriptname.sql located in the My Documents Directory on your C drive.&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333333"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112290580289219720?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112290580289219720/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112290580289219720' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112290580289219720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112290580289219720'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/08/sql-scripts.html' title='SQL Scripts'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112245216251732716</id><published>2005-07-27T13:46:00.000+05:30</published><updated>2005-07-27T13:46:02.536+05:30</updated><title type='text'>Uid function</title><content type='html'>&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&lt;/span&gt;&lt;div&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;In Oracle/PLSQL, the uid function returns the id number for a user's session (the user who is currently logged in).&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;The syntax for the uid function is:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;&lt;br&gt;select uid&amp;nbsp;&lt;br&gt;from dual;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;&lt;br&gt;For example:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;&lt;br&gt;select uid&amp;nbsp;&lt;br&gt;into parm_uid&lt;br&gt;from dual;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;br&gt;The variable called parm_uid will now contain the id number for the user's session.&amp;nbsp; The value could be 25, for example.&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112245216251732716?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112245216251732716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112245216251732716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112245216251732716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112245216251732716'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/uid-function.html' title='Uid function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112236692790721432</id><published>2005-07-26T14:05:00.000+05:30</published><updated>2005-07-26T14:05:27.920+05:30</updated><title type='text'>SQLERRM Function</title><content type='html'>The SQLERRM function returns the error message associated with the most recently raised error exception.&amp;nbsp;&amp;nbsp;This function should only be used within the Exception Handling section of your code: &lt;br&gt;&lt;br&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;EXCEPTION &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;&lt;br&gt; &lt;/span&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN exception_name1 THEN &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[statements]  &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN exception_name2 THEN &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt; &lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[statements] &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN exception_name_n THEN &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[statements] &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt; &lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHEN OTHERS THEN &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[statements]&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;END [procedure_name];  &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;You could use the SQLERRM function to raise an error as follows: &lt;br&gt;&lt;br&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;EXCEPTION&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt; &lt;br&gt; &lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp; WHEN OTHERS THEN&lt;/span&gt;&lt;br style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;raise_application_error(-2&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; 0001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);&lt;/span&gt;&lt;br style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;END; &lt;/span&gt;&lt;br&gt;&lt;br&gt;Or you could log the error to a table as follows: &lt;br&gt; &lt;br&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;EXCEPTION&lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp; WHEN OTHERS THEN&lt;/span&gt; &lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_code := SQLCODE;&lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;err_msg := substr(SQLERRM, 1, 200); &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;INSERT INTO audit_table (error_number, error_message) &lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;VALUES (err_code, err_msg);&lt;/span&gt;&lt;br style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-style: italic; color: rgb(51, 51, 255);"&gt; END; &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp; &lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112236692790721432?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112236692790721432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112236692790721432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112236692790721432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112236692790721432'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/sqlerrm-function.html' title='SQLERRM Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112231732670081476</id><published>2005-07-26T00:18:00.000+05:30</published><updated>2005-07-26T00:18:47.330+05:30</updated><title type='text'>ETL- Extract, Transform, and Load</title><content type='html'>&lt;span class="newsummary"&gt;&lt;b&gt;DEFINITION:&lt;/b&gt; &lt;br&gt; &lt;br&gt; &lt;b&gt;ETL&lt;/b&gt; stands for &lt;b&gt;extract, transform and load&lt;/b&gt;, the processes that enable companies to move data from multiple sources, reformat and cleanse it, and load it into another database, a data mart or a data warehouse for analysis, or on another operational system to support a business process. &lt;/span&gt; &lt;div style="text-align: left; margin-left: 80px;"&gt;&lt;span style="font-weight: bold;" class="newheadline"&gt;&lt;/span&gt;&lt;/div&gt;  &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;table bgcolor="black" cellpadding="1" cellspacing="0" width="400"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="black"&gt;&lt;img src="http://www.computerworld.com/computerworld/images/1pixclear.gif" width="5"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center"&gt;&lt;td&gt;&lt;table style="text-align: left; margin-left: auto; margin-right: auto;" cellpadding="8" cellspacing="0" width="100%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td rowspan="3" bgcolor="#fad67a" valign="top"&gt;&lt;img src="http://www.computerworld.com/computerworld/records/images/story/Data.gif" alt="Moving and Improving Data" height="277" width="400"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt; chk out this &lt;a href="http://www.computerworld.com/databasetopics/businessintelligence/datawarehouse/story/0,10801,89534,00.html"&gt;link&lt;/a&gt; to know more...&lt;br&gt; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112231732670081476?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112231732670081476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112231732670081476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112231732670081476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112231732670081476'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/etl-extract-transform-and-load.html' title='ETL- Extract, Transform, and Load'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112227994099655354</id><published>2005-07-25T13:55:00.000+05:30</published><updated>2005-07-25T13:55:41.046+05:30</updated><title type='text'>SQLCODE Function SQLCODE Function</title><content type='html'>&lt;span&gt;&lt;font color="#333333"&gt;The SQLCODE function returns the error number associated with the most recently raised error exception.&amp;nbsp; This function should only be used within the Exception Handling section of your code:&lt;/font&gt;&lt;/span&gt;&lt;div&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;EXCEPTION&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN exception_name1 THEN&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [statements]&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN exception_name2 THEN&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [statements]&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN exception_name_n THEN&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [statements]&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHEN OTHERS THEN&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [statements]&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;END [procedure_name];&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#333333"&gt;You could use the SQLCODE function to raise an error as follows:&lt;/font&gt;&lt;/p&gt; &lt;p style="margin: auto 0in;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;EXCEPTION&lt;br&gt;&amp;nbsp;&amp;nbsp; WHEN OTHERS THEN&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM); &lt;br&gt;END;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#333333"&gt;Or you could log the error to a table as follows:&lt;/font&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;EXCEPTION&lt;br&gt;&amp;nbsp;&amp;nbsp; WHEN OTHERS THEN&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code := SQLCODE;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_msg := substr(SQLERRM, 1, 200); &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT INTO audit_table (error_number, error_message)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES (err_code, err_msg);&lt;br&gt;END; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&lt;/span&gt; &lt;br&gt; &lt;/p&gt;&lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112227994099655354?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112227994099655354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112227994099655354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112227994099655354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112227994099655354'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/sqlcode-function-sqlcode-function.html' title='SQLCODE Function SQLCODE Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206277282630909</id><published>2005-07-23T01:36:00.000+05:30</published><updated>2005-07-23T01:36:12.826+05:30</updated><title type='text'>To_Date Function</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt; &lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;font color="#333333"&gt;In Oracle/PLSQL, the to_date function converts a string to a date.&lt;/font&gt;&lt;/span&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The syntax for the to_date function is:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;to_date (string1, [format_mask], [nls_language] )&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;string1 is the string that will be converted to a date. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;format_mask is optional.&amp;nbsp; This is the format that will be used to convert string1 to a date. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;nls_language is optional.&amp;nbsp; This is the nls language used to convert string1 to a date. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The following is a list of options for the format_mask parameter&amp;nbsp; These parameters can be used in many combinations.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 375pt;" bgcolor="white" border="1" cellpadding="0" cellspacing="0" width="500"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51); font-family: Arial;"&gt;Parameter&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51); font-family: Arial;"&gt;Explanation&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;YEAR&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Year, spelled out&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;YYYY&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;4-digit year&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;YYY&lt;br&gt;YY&lt;br&gt;Y&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Last 3, 2, or 1 digit(s) of year.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;IYY&lt;br&gt;IY&lt;br&gt;I&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Last 3, 2, or 1 digit(s) of ISO year.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;IYYY&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;4-digit year based on the ISO standard&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;RRRR&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Accepts a 2-digit year and returns a 4-digit year.&lt;br&gt;A value between 0-49 will return a 20xx year.&lt;br&gt;A value between 50-99 will return a 19xx year. &lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;Q&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Quarter of year (1, 2, 3, 4; JAN-MAR = 1).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;MM&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Month (01-12; JAN = 01).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;MON&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Abbreviated name of month.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;MONTH&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Name of month, padded with blanks to length of 9 characters.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;RM&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Roman numeral month (I-XII; JAN = I).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;WW&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;W&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;IW&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Week of year (1-52 or 1-53) based on the ISO standard.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;D&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Day of week (1-7).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;DAY&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Name of day.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;DD&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Day of month (1-31).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;DDD&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Day of year (1-366).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;DY&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Abbreviated name of day.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;J&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Julian day; the number of days since January 1, 4712 BC.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;HH&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Hour of day (1-12).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;HH12&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Hour of day (1-12).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;HH24&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Hour of day (0-23).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;MI&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Minute (0-59).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;SS&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Second (0-59).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;SSSSS&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Seconds past midnight (0-86399).&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;FF&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Fractional seconds.&amp;nbsp; Use a value from 1 to 9 after FF to indicate the number of digits in the fractional seconds.&amp;nbsp; For example, 'FF4'.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;AM, A.M., PM, or P.M.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Meridian indicator&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;AD or A.D&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;AD indicator&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;BC or B.C.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;BC indicator&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;TZD&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Daylight savings information.&amp;nbsp; For example, 'PST'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;TZH&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Time zone hour.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;TZM&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Time zone minute.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 69.75pt; background-color: transparent;" valign="top" width="93"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;TZR&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 292.5pt; background-color: transparent;" valign="top" width="390"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;Time zone region.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;For example:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 376.5pt;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="502"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 165pt; background-color: transparent;" width="220"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;to_date ('2003/07/09', 'yyyy/mm/dd');&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 208.5pt; background-color: transparent;" width="278"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;would return a date value of July 9, 2003.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 165pt; background-color: transparent;" width="220"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;to_date ('070903', 'MMDDYY');&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 208.5pt; background-color: transparent;" width="278"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;would return a date value of July 9, 2003.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 165pt; background-color: transparent;" width="220"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;to_date ('20020315', 'yyyymmdd');&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 208.5pt; background-color: transparent;" width="278"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: rgb(51, 51, 51);"&gt;would return a date value of Mar 15, 2002.&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/b&gt;&lt;/p&gt; &lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206277282630909?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206277282630909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206277282630909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206277282630909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206277282630909'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/todate-function.html' title='To_Date Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206268630912118</id><published>2005-07-23T01:34:00.000+05:30</published><updated>2005-07-23T01:34:46.313+05:30</updated><title type='text'>To_Char Function</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt; &lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 10pt; color: navy;"&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;font color="#333333"&gt;In Oracle/PLSQL, the to_char function converts a number or date to a string. &lt;/font&gt;&lt;/span&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The syntax for the to_char function is:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; text-indent: 0.5in; font-weight: bold;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;to_char (value, [format_mask], [nls_language] )&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; text-indent: 0.5in; font-weight: bold;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;value can either be a number or date that will be converted to a string. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;format_mask is optional.&amp;nbsp; This is the format that will be used to convert value to a string. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;nls_language is optional.&amp;nbsp; This is the nls language used to convert value to a string. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;Examples - Numbers&lt;br&gt; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The following are number examples for the to_char function.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 4.5in;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="432"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 183pt; background-color: transparent;" width="244"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (1210.73, '9999.9')&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 141pt; background-color: transparent;" width="188"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return '1210.7'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 183pt; background-color: transparent;" width="244"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (1210.73, '9,999.99')&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 141pt; background-color: transparent;" width="188"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return '1,210.73'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 183pt; background-color: transparent;" width="244"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (1210.73, '$9,999.00')&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 141pt; background-color: transparent;" width="188"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return '$1,210.73'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 183pt; background-color: transparent;" width="244"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (21, '000099')&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 141pt; background-color: transparent;" width="188"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font size="2"&gt;&lt;font color="#333333"&gt;would return '000021'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: maroon; font-family: Verdana;"&gt;Examples – Dates&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The following is a list of valid parameters when the to_char function is used to convert a date to a string.&amp;nbsp; These parameters can be used in many combinations.&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 375pt;" bgcolor="white" border="1" cellpadding="0" cellspacing="0" width="500"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;Parameter&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Explanation&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;YEAR&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Year, spelled out&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;YYYY&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;4-digit year&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;YYY&lt;br&gt;YY&lt;br&gt;Y&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Last 3, 2, or 1 digit(s) of year.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;IYY&lt;br&gt;IY&lt;br&gt;I&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Last 3, 2, or 1 digit(s) of ISO year.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;IYYY&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;4-digit year based on the ISO standard&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;Q&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Quarter of year (1, 2, 3, 4; JAN-MAR = 1).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;MM&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Month (01-12; JAN = 01).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;MON&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Abbreviated name of month.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;MONTH&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Name of month, padded with blanks to length of 9 characters.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;RM&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Roman numeral month (I-XII; JAN = I).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;WW&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;W&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;IW&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Week of year (1-52 or 1-53) based on the ISO standard.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;D&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Day of week (1-7).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;DAY&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Name of day.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;DD&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Day of month (1-31).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;DDD&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Day of year (1-366).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;DY&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Abbreviated name of day.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;J&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Julian day; the number of days since January 1, 4712 BC.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;HH&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Hour of day (1-12).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;HH12&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Hour of day (1-12).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;HH24&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Hour of day (0-23).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;MI&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Minute (0-59).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;SS&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Second (0-59).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;SSSSS&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;Seconds past midnight (0-86399).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 111pt; background-color: transparent;" valign="top" width="148"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;FF&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 264pt; background-color: transparent;" valign="top" width="352"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font size="2"&gt;&lt;font color="#333333"&gt;Fractional seconds.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;br&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The following are date examples for the to_char function.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 345pt;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="460"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'yyyy/mm/dd');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return '2003/07/09'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'Month DD, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'July 09, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMonth DD, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'July 9, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'MON DDth, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'JUL 09TH, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMON DDth, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'JUL 9TH, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMon ddth, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font size="2"&gt;&lt;font color="#333333"&gt;would return 'Jul 9th, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;You will notice that in some examples, the format_mask parameter begins with &amp;quot;FM&amp;quot;.&amp;nbsp; This means that zeros and blanks are suppressed.&amp;nbsp; This can be seen in the examples below.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 345pt;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="460"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMonth DD, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'July 9, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMON DDth, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font size="2"&gt;would return 'JUL 9TH, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 189.75pt; background-color: transparent;" width="253"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&lt;font size="2"&gt;to_char (sysdate, 'FMMon ddth, YYYY');&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 152.25pt; background-color: transparent;" width="203"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font size="2"&gt;&lt;font color="#333333"&gt;would return 'Jul 9th, 2003'&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;br&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;The zeros have been suppressed so that the day component shows as &amp;quot;9&amp;quot; as opposed to &amp;quot;09&amp;quot;.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206268630912118?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206268630912118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206268630912118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206268630912118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206268630912118'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/tochar-function.html' title='To_Char Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206257532126296</id><published>2005-07-23T01:32:00.000+05:30</published><updated>2005-07-23T01:32:55.326+05:30</updated><title type='text'>Trunc Function (with dates)</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-size: 12pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;font color="#333333"&gt;In Oracle/PLSQL, the trunc function returns a date truncated to a specific unit of measure.&lt;/font&gt;&lt;/span&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The syntax for the trunc function is:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span style="color: blue; font-family: Courier; font-weight: bold;"&gt;trunc ( date,&lt;span&gt;&amp;nbsp; &lt;/span&gt;[ format ] )&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;span style="font-weight: bold;"&gt;date&lt;/span&gt; is the date to truncate.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;span style="font-weight: bold;"&gt;Format&lt;/span&gt; is the unit of measure to apply for truncating.&lt;span&gt;&amp;nbsp; &lt;/span&gt;If the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;br&gt;&lt;span&gt;Below are the valid format parameters:&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;br&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 289.5pt;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="386"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%; text-align: center;" align="center"&gt;&lt;font color="#00407f"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Unit&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%; text-align: center;" align="center"&gt;&lt;b&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;&lt;font color="#00407f"&gt;Valid format parameters&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Year&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;ISO Year&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;IYYY, IY, I&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Quarter&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Q&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Month&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;MONTH, MON, MM, RM&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Week&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;WW&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;IW&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;IW&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;W&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;W&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Day&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;DDD, DD, J&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Start day of the week&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;DAY, DY, D&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Hour&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;HH, HH12, HH24&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 101.25pt; background-color: transparent;" valign="top" width="135"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;Minute&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 188.25pt; background-color: transparent;" valign="top" width="251"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;MI&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;font color="#407f00"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0); text-decoration: underline;"&gt;Example:&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt; &lt;table style="background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; width: 346.5pt;" bgcolor="white" border="0" cellpadding="0" cellspacing="0" width="462"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 237pt; background-color: transparent;" width="316"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;trunc (to_date ('22-AUG-03'), 'YEAR')&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 109.5pt; background-color: transparent;" width="146"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;would return '01-JAN-03'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 237pt; background-color: transparent;" width="316"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;trunc (to_date ('22-AUG-03'), 'Q')&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 109.5pt; background-color: transparent;" width="146"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;would return '01-JUL-03'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 237pt; background-color: transparent;" width="316"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;trunc (to_date ('22-AUG-03'), 'MONTH')&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 109.5pt; background-color: transparent;" width="146"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;would return '01-AUG-03'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 237pt; background-color: transparent;" width="316"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;trunc (to_date ('22-AUG-03'), 'DDD')&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 109.5pt; background-color: transparent;" width="146"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;would return '22-AUG-03'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 237pt; background-color: transparent;" width="316"&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Courier;"&gt;trunc (to_date ('22-AUG-03'), 'DAY')&lt;/span&gt;&lt;/p&gt;&lt;/td&gt; &lt;td style="border: medium none rgb(236, 233, 216); padding: 2.25pt; width: 109.5pt; background-color: transparent;" width="146"&gt; &lt;p style="margin: 0in 0in 0pt; line-height: 120%;"&gt;&lt;span style="font-size: 9pt; color: black; font-family: Arial;"&gt;would return '17-AUG-03'&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206257532126296?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206257532126296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206257532126296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206257532126296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206257532126296'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/trunc-function-with-dates.html' title='Trunc Function (with dates)'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206247306629966</id><published>2005-07-23T01:31:00.000+05:30</published><updated>2005-07-23T01:31:13.070+05:30</updated><title type='text'>DB Monitoring...!</title><content type='html'>A website useful in DB monitoring and tunning. &lt;a href="http://www.rocket99.com/oracle/oracle22.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;http://www.rocket99.com/oracle/oracle22.html&lt;/a&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206247306629966?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206247306629966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206247306629966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206247306629966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206247306629966'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/db-monitoring.html' title='DB Monitoring...!'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206241817134953</id><published>2005-07-23T01:30:00.000+05:30</published><updated>2005-07-23T01:30:18.170+05:30</updated><title type='text'>sys_context function</title><content type='html'>&lt;span class="gmail_quote"&gt;&lt;/span&gt; &lt;span&gt;&lt;font color="#333333"&gt;In Oracle/PLSQL, the sys_context function can be used to retrieve information about the Oracle environment.&lt;/font&gt;&lt;/span&gt;&lt;div&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The syntax for the sys_context function is:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; font-weight: bold;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;sys_context (namespace, parameter, [length])&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;Namespace is an Oracle namespace that has already been created.&amp;nbsp; If the namespace of 'USERENV' is used, attributes describing the current Oracle session can be returned. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;Parameter is a valid attribute that has been set using the DBMS_SESSION.set_context procedure. &lt;br&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;Length is optional.&amp;nbsp; It is the length of the return value in bytes.&amp;nbsp; If this parameter is omitted or if an invalid entry is provided, the sys_context function will default to 256 bytes. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-weight: normal; font-size: 10pt; color: blue; font-family: Courier;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;The valid parameters for the namespace called 'USERENV' are as follows: &lt;br&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;font color="#0000bf"&gt;Parameter&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Explanation&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;CLIENT_INFO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;User session information&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;CURRENT_SCHEMA&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Returns the default schema used in the current schema&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;CURRENT_SQL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Returns the SQL that triggered the audit event&amp;nbsp; 64&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;CURRENT_USER&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Name of the current user&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;DB_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Name of the database from the DB_NAME initialization parameter&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;EXTERNAL_NAME&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;External of the database user&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;HOST&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Name of the host machine from which the client has connected&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;INSTANCE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The identifier number of the current instance&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;IP_ADDRESS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;IP address of the machine from which the client has connected&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;NLS_CALENDAR&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The calendar of the current session&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;NLS_CURRENCY&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The currency of the current session&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;NLS_DATE_FORMAT &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The date format for the current session&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;NLS_DATE_LANGUAGE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The language used for dates&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;NLS_SORT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;BINARY or the linguistic sort basis&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;OS_USER &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The OS username for the user logged in&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span&gt;&lt;font color="#333333"&gt;For example:&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;sys_context ('USERENV', 'NLS_DATE_FORMAT')&lt;/span&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;would return 'RR-MM-DD' &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="color: blue; font-family: Courier;"&gt;sys_context ('USERENV', 'NLS_SORT')&lt;/span&gt;&lt;span&gt;&lt;font color="#333333"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;would return 'BINARY' &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span&gt;&lt;font color="#333333"&gt;&lt;/font&gt;&lt;/span&gt; &lt;br&gt; &lt;/p&gt;&lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206241817134953?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206241817134953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206241817134953' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206241817134953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206241817134953'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/syscontext-function.html' title='sys_context function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112206235244164774</id><published>2005-07-23T01:29:00.000+05:30</published><updated>2005-07-23T01:29:12.453+05:30</updated><title type='text'>Variance Function</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;/span&gt; In Oracle/PLSQL, the variance function returns the variance of a set of numbers. &lt;br&gt;&lt;br&gt;The syntax for the variance function is: &lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;variance ( expression )  &lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;expression&lt;/span&gt; is a numeric expression. &lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold; text-decoration: underline;"&gt;For example: &lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-style: italic;"&gt; select variance (char_length) &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;from all_tab_columns; &lt;/span&gt;&lt;br style="font-style: italic;"&gt; &lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112206235244164774?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112206235244164774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112206235244164774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206235244164774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112206235244164774'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/variance-function.html' title='Variance Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112131513055829556</id><published>2005-07-14T09:55:00.000+05:30</published><updated>2005-07-14T09:55:30.576+05:30</updated><title type='text'>Case Statements</title><content type='html'>In Oracle 9i, you can use the case statement within an SQL statement.&amp;nbsp;&amp;nbsp;It has the functionality of an IF-THEN-ELSE statement.&lt;br&gt; &lt;br&gt;&lt;br&gt;The syntax for the case statement is:&lt;br&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;CASE expression&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; WHEN condition_1 THEN result_1&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;WHEN condition_2 THEN result_2&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br style="font-weight: bold;"&gt; &lt;span style="font-weight: bold;"&gt;...&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;WHEN condition_n THEN result_n&lt;/span&gt;&lt;br style="font-weight: bold;"&gt;&lt;br style="font-weight: bold;"&gt; &lt;span style="font-weight: bold;"&gt;ELSE result END&lt;/span&gt;&lt;br&gt;&lt;br&gt; &lt;br&gt; &lt;span style="font-weight: bold;"&gt;expression&lt;/span&gt; is the value that you are comparing to the list of conditions. (ie: condition_1, condition_2, ... condition_n)&lt;br&gt;&lt;br&gt; &lt;span style="font-weight: bold;"&gt;condition_1&lt;/span&gt;  to &lt;span style="font-weight: bold;"&gt;condition_n&lt;/span&gt; must all be the same datatype.&amp;nbsp;&amp;nbsp;Conditions are evaluated in the order listed.&amp;nbsp;&amp;nbsp;Once a condition is found to be true, the&lt;br&gt;&lt;br&gt;case statement will &lt;span style="font-weight: bold;"&gt;return&lt;/span&gt; the result and &lt;span style="font-weight: bold;"&gt;not evaluate&lt;/span&gt; the conditions any further. &lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;result_1&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;result_n&lt;/span&gt; must all be the same datatype.&amp;nbsp;&amp;nbsp;This is the value returned once a condition is found to be true.&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold; text-decoration: underline;"&gt; Note:&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;If no condition is found to be true, then the case statement will return the value in the ELSE clause. If the ELSE clause is omitted and no condition is&lt;br&gt;&lt;br&gt;found to be true, then the case statement will return NULL.&amp;nbsp;&amp;nbsp;You can have up to 255 comparisons in a case statement.&amp;nbsp;&amp;nbsp;Each WHEN ... THEN clause&lt;br&gt;&lt;br&gt;is considered 2 comparisons.&lt;br&gt;&lt;br&gt; &lt;span style="font-weight: bold; text-decoration: underline;"&gt;For Example:&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;You could use the case statement in an SQL statement as follows: &lt;/span&gt;&lt;br&gt;&lt;br&gt; &lt;span style="font-style: italic;"&gt;SELECT TABLE_NAME,&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;CASE OWNER&lt;/span&gt;&lt;br style="font-style: italic;"&gt; &lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;WHEN 'SYS' THEN 'THE OWNER IS SYS'&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;WHEN 'SYSTEM' THEN 'THE OWNER IS SYSTEM' &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;ELSE 'THE OWNER IS ANOTHER VALUE' END&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; FROM ALL_TABLES;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;br&gt;&lt;span style="font-weight: bold;"&gt;The above case statement is equivalent to the following IF-THEN-ELSE statement:&lt;/span&gt;&lt;br&gt;&lt;br&gt; &lt;span style="font-style: italic;"&gt; IF owner = 'SYS' THEN&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result := 'The owner is SYS';&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;span style="font-style: italic;"&gt;ELSIF owner = 'SYSTEM' THEN&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := 'The owner is SYSTEM'';&lt;/span&gt;&lt;br style="font-style: italic;"&gt; &lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;ELSE&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := 'The owner is another value';&lt;/span&gt; &lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;END IF; &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br&gt; &lt;br&gt;The case statement will compare each owner value, one by one.&lt;br&gt;&lt;br&gt; One thing to note is that the ELSE clause within the case statement is optional.&amp;nbsp;&amp;nbsp;You could have omitted it.&amp;nbsp;&amp;nbsp;Let's take a look at the SQL statement&lt;br&gt;&lt;br&gt;above with the ELSE clause omitted.&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;Your SQL statement would look as follows:&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;span style="font-style: italic;"&gt;SELECT TABLE_NAME,&lt;/span&gt; &lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;CASE OWNER&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;WHEN 'SYS' THEN 'THE OWNER IS SYS' &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;WHEN 'SYSTEM' THEN 'THE OWNER IS SYSTEM' END&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; FROM ALL_TABLES;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; With the ELSE clause omitted, if no condition was found to be true, the case statement would return NULL.&lt;br&gt; &lt;br&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112131513055829556?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112131513055829556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112131513055829556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112131513055829556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112131513055829556'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/case-statements.html' title='Case Statements'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112125129315105262</id><published>2005-07-13T16:11:00.000+05:30</published><updated>2005-07-13T16:11:33.156+05:30</updated><title type='text'>DECODE Statement</title><content type='html'> In Oracle/PLSQL, the decode function has the functionality of an IF-THEN-ELSE statement. &lt;br&gt;&lt;br&gt;The syntax for the decode function is: &lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;decode ( expression , search , result [, search , result]... [, default] )  &lt;/span&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;expression&lt;/span&gt; is the value to compare.&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;search&lt;/span&gt; is the value that is compared against expression.&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt; result&lt;/span&gt; is the value returned, if expression is equal to search.&amp;nbsp;&amp;nbsp;&lt;br&gt; &lt;br&gt;&lt;span style="font-weight: bold;"&gt;default&lt;/span&gt; is optional.&amp;nbsp;&amp;nbsp;If no matches are found, the decode will return default.&amp;nbsp;&amp;nbsp;If default is omitted, then the decode statement will return null (if no matches are found).&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;For Example:&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br&gt;&lt;br&gt;You could use the decode function in an SQL statement as follows:&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;span style="font-style: italic;"&gt; SELECT supplier_name, &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; decode (supplier_id, 10000,&amp;nbsp;&amp;nbsp;'IBM',&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;10001,&amp;nbsp;&amp;nbsp;'Microsoft',&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="font-style: italic;"&gt;10002,&amp;nbsp;&amp;nbsp;'Hewlett Packard',&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Gateway') result&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;FROM suppliers;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;br&gt; The above decode statement is equivalent to the following IF-THEN-ELSE statement:&amp;nbsp;&amp;nbsp;&lt;br&gt; &lt;br&gt;&lt;span style="font-style: italic;"&gt;IF supplier_id = 10000 THEN &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result := 'IBM';&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;ELSIF supplier_id = 10001 THEN &lt;/span&gt;&lt;br style="font-style: italic;"&gt; &lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := 'Microsoft';&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;ELSIF supplier_id = 10002 THEN  &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := 'Hewlett Packard';&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; ELSE &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := 'Gateway';&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; END IF;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&lt;br&gt;The decode function will compare each supplier_id value, one by one.&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112125129315105262?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112125129315105262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112125129315105262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112125129315105262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112125129315105262'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/decode-statement.html' title='DECODE Statement'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112115141233412792</id><published>2005-07-12T12:26:00.000+05:30</published><updated>2005-07-12T12:26:52.336+05:30</updated><title type='text'>Conversion Function (CAST)</title><content type='html'>In Oracle/PLSQL, the cast function converts one datatype to another.&lt;br&gt;&lt;br&gt;The syntax for the cast function is:&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;cast ( { expr | ( subquery ) | MULTISET ( subquery ) } AS type_name ) &lt;/span&gt;&lt;br&gt;&lt;br&gt;For example: &lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;SELECT CAST ( '22-AUG-2003' AS VARCHAR2(30) ) FROM DUAL; &lt;/span&gt;&lt;br&gt;&lt;br&gt;This would convert the date (i.e.: 22-Aug-2003) into a varchar2(30) value. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112115141233412792?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112115141233412792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112115141233412792' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112115141233412792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112115141233412792'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/conversion-function-cast.html' title='Conversion Function (CAST)'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-14412315.post-112115119978265930</id><published>2005-07-12T12:23:00.000+05:30</published><updated>2005-07-12T12:23:19.786+05:30</updated><title type='text'>Coalesce Function</title><content type='html'> In Oracle/PLSQL, the coalesce function returns the first non-null expression in the list.&amp;nbsp;&amp;nbsp;If all expressions evaluate to null, then the coalesce function will return null.&lt;br&gt;&lt;br&gt; The syntax for the coalesce function is:&lt;br&gt;&lt;br style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;coalesce ( expr1, expr2, ... expr_n )&lt;/span&gt;&lt;br&gt;&lt;br&gt; For Example: &lt;br&gt;&lt;br&gt;You could use the coalesce function in an SQL statement as follows:&lt;br&gt;&lt;br&gt;&lt;span style="font-weight: bold;"&gt;SELECT COALESCE ( ADDRESS1, ADDRESS2, ADDRESS3 ) RESULT FROM SUPPLIERS;&lt;/span&gt;&lt;br&gt; &lt;br&gt; The above coalesce statement is equivalent to the following IF-THEN-ELSE statement:&lt;br&gt;&lt;br&gt; &lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;IF address1 is not null THEN&lt;/span&gt;&lt;br style="font-style: italic;"&gt; &lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result := address1;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;ELSIF address2 is not null THEN &lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := address2;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; ELSIF address3 is not null THEN&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := address3;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;span style="font-style: italic;"&gt;ELSE&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result := null;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br style="font-style: italic;"&gt; &lt;span style="font-style: italic;"&gt;END IF;&lt;/span&gt;&lt;br style="font-style: italic;"&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/14412315-112115119978265930?l=archudb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://archudb.blogspot.com/feeds/112115119978265930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=14412315&amp;postID=112115119978265930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112115119978265930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/14412315/posts/default/112115119978265930'/><link rel='alternate' type='text/html' href='http://archudb.blogspot.com/2005/07/coalesce-function.html' title='Coalesce Function'/><author><name>Archana Raghupathy</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
