<?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:blogger='http://schemas.google.com/blogger/2008' 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-7058542</id><updated>2024-09-20T13:36:32.588+08:00</updated><title type='text'>Daily Oracle</title><subtitle type='html'>short Oracle take-away tips that you can put to use in under an hour.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default?alt=atom&amp;start-index=26&amp;max-results=25'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7058542.post-6885754858739908584</id><published>2021-11-22T17:11:00.005+08:00</published><updated>2021-11-22T17:14:01.897+08:00</updated><title type='text'></title><content type='html'>&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 12.48px;&quot;&gt;test upload video&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 12.48px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;span style=&quot;font-size: 12.48px;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dyxDzVq1_gLChGGVwrQ2oroV8dLx0dpOC39fpLkXjgYGMo_naWtWyy5lLVTB6wDwwJdLeJYltMo93o&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/6885754858739908584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/6885754858739908584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/6885754858739908584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/6885754858739908584'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2021/11/blog-post.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-4247574810974913424</id><published>2008-06-14T13:49:00.001+08:00</published><updated>2008-06-14T13:49:52.303+08:00</updated><title type='text'>Ensuring that a sql query returns all or nothing</title><content type='html'>&lt;p&gt;I have a little project which automatically returns the result from a sql query to an Excel worksheet.&lt;/p&gt; &lt;p&gt;I run this job recently and the user complained that the Excel output was unusual.&lt;/p&gt; &lt;p&gt;I did some investigation and found that the query did not run to completion. It bombed out midway because there was a division by zero error.&lt;/p&gt; &lt;p&gt;Because the job was automatic and it was run in Excel, I did not see the error message.&lt;/p&gt; &lt;p&gt;That got me thinking - if the output was empty, I would realize immediately that the something was wrong. When it returned an impartial set, only a user who analyzed can tell whether it was wrong or not.&lt;/p&gt; &lt;p&gt;So,&lt;em&gt;&amp;nbsp;&lt;/em&gt;I wanted the query to return all or nothing.&lt;/p&gt; &lt;p&gt;And that is quite easily done, just add an order by clause at the end of the query.&lt;/p&gt; &lt;p&gt;The order by clause will retrieve all the rows and then sort them. If it could not retrieve all the rows because some of the rows has, for example, a division by zero error, nothing will return. The query will then return all or nothing at all.&lt;/p&gt; &lt;div class=&quot;wlWriterSmartContent&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9a329b54-14c1-4dac-92c7-9139c0fbfdb4&quot; style=&quot;padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px&quot;&gt;Technorati tags: &lt;a href=&quot;http://technorati.com/tags/sql&quot; rel=&quot;tag&quot;&gt;sql&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tags/tip&quot; rel=&quot;tag&quot;&gt;tip&lt;/a&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/4247574810974913424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/4247574810974913424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/4247574810974913424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/4247574810974913424'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2008/06/ensuring-that-sql-query-returns-all-or.html' title='Ensuring that a sql query returns all or nothing'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-1380538411004168816</id><published>2007-05-23T14:32:00.001+08:00</published><updated>2007-05-23T14:32:17.632+08:00</updated><title type='text'>Using ifile to centralise tnsnames.ora entries for multiple oracle homes</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2354114929479&quot;&gt;Tom Kyte&lt;/a&gt;&amp;nbsp;has a great tip for centralising tns entries in one tnsnames.ora for multiple oracle homes.&lt;/p&gt; &lt;p&gt;The summary - maintain all tns entries in 1 tnsnames.ora.&lt;/p&gt; &lt;p&gt;Let&#39;s say this file is at:&lt;/p&gt; &lt;p&gt;c:/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora&lt;/p&gt; &lt;p&gt;In all the other tnsnames.ora, delete every thing else and type in this:&lt;/p&gt; &lt;p&gt;ifile=c:/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora&lt;/p&gt; &lt;p&gt;Take note that the ifile parameter is not documented, according to Tom.&lt;/p&gt; &lt;p&gt;The other option is to set the TNS_ADMIN environment variable but this can cause a lot of&amp;nbsp; confusion.&lt;/p&gt; &lt;p&gt;Imagine a situation that you did not know the TNS_ADMIN variable is set, you will be looking at all the tnsnames.ora file in all the oracle homes and wondering why all the homes use one tnsnames.ora.&lt;/p&gt; &lt;p&gt;The ifile option makes this explicit in the place where everyone will usually look.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/1380538411004168816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/1380538411004168816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/1380538411004168816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/1380538411004168816'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2007/05/using-ifile-to-centralise-tnsnamesora.html' title='Using ifile to centralise tnsnames.ora entries for multiple oracle homes'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-5375776840199377045</id><published>2007-05-02T08:53:00.001+08:00</published><updated>2007-05-02T08:53:28.967+08:00</updated><title type='text'>MySql may soon have Oracle&amp;#39;s external table</title><content type='html'>&lt;p&gt;It is called &lt;a href=&quot;http://code.google.com/p/mysql-filesystem-engine/&quot;&gt;mysql-filesystem-engine&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/5375776840199377045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/5375776840199377045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/5375776840199377045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/5375776840199377045'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2007/05/mysql-may-soon-have-oracle-external.html' title='MySql may soon have Oracle&amp;#39;s external table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-116036489260215626</id><published>2006-10-09T11:34:00.000+08:00</published><updated>2006-10-09T11:34:52.653+08:00</updated><title type='text'>from sqlldr (sql loader) to external table</title><content type='html'>&lt;p&gt;Prior to Oracle 9i, to&amp;nbsp;import data from a text file, you will have to run sqlldr (sql loader) to load the data into a table.&lt;/p&gt; &lt;p&gt;Starting from Oracel 9i, you can use external table to read text file data from within sqlplus and you can use the sqlloader control file to help you.&lt;/p&gt; &lt;p&gt;Just run something like this:&lt;/p&gt; &lt;p&gt;sqlldr scott/tiger control=mycontrol.ctl EXTERNAL_TABLE=GENERATE_ONLY.&lt;/p&gt; &lt;p&gt;This will create a log file with :&lt;/p&gt; &lt;p&gt;1. CREATE DIRECTORY statement&lt;/p&gt; &lt;p&gt;2. CREATE EXTERNAL TABLE statement&lt;/p&gt; &lt;p&gt;3. sample INSERT statement&lt;/p&gt; &lt;p&gt;4. sample DROP TABLE statement&lt;/p&gt; &lt;p&gt;It&#39;s a quick way to move from sql loader to external table.&lt;/p&gt; &lt;p&gt;External tables have these benefits:&lt;/p&gt; &lt;p&gt;1.&amp;nbsp;you do not have to import the data into a table to read it. You can just read from the text file as if it were a table&lt;/p&gt; &lt;p&gt;2. since external table can be used with SELECT, you can write a load program with either SQL or PL/SQL. Prior to Oracle 9i, it was often asked whether it was possible to invoke sql loader from within PL/SQL. With external table, you do not have to.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/116036489260215626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/116036489260215626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/116036489260215626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/116036489260215626'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2006/10/from-sqlldr-sql-loader-to-external.html' title='from sqlldr (sql loader) to external table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-115253006230617189</id><published>2006-07-10T19:10:00.000+08:00</published><updated>2006-07-10T19:14:22.350+08:00</updated><title type='text'>find gap in sequence with analytical function</title><content type='html'>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;blockquote cite=&quot;http://techrepublic.com.com/5110-9592-6088140.html&quot;&gt;SQL&amp;gt; WITH aquery AS  &lt;br/&gt; 2     (SELECT measurement_id after_gap,  &lt;br/&gt; 3      LAG(measurement_id,1,0) OVER (ORDER BY measurement_id) before_gap  &lt;br/&gt; 4      FROM sensor_data)  &lt;br/&gt; 5  SELECT  &lt;br/&gt; 6      before_gap, after_gap  &lt;br/&gt; 7  FROM  &lt;br/&gt; 8      aquery  &lt;br/&gt; 9  WHERE &lt;br/&gt; 10      before_gap != 0 &lt;br/&gt; 11  AND &lt;br/&gt; 12      after_gap - before_gap &amp;gt; 1 &lt;br/&gt; 13  ORDER BY &lt;br/&gt; 14      before_gap;&lt;br/&gt; BEFORE_GAP  AFTER_GAP                                                           &lt;br/&gt; ---------- ----------                                                                   &lt;br/&gt; 2          4                                                                   &lt;br/&gt; 5          7         &lt;/blockquote&gt;&lt;p class=&quot;citation&quot;&gt;&lt;cite cite=&quot;http://techrepublic.com.com/5110-9592-6088140.html&quot;&gt;&lt;a href=&quot;http://techrepublic.com.com/5110-9592-6088140.html&quot;&gt;http://techrepublic.com.com/5110-9592-6088140.html&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;  &lt;p/&gt;&lt;p/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/115253006230617189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/115253006230617189' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/115253006230617189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/115253006230617189'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2006/07/find-gap-in-sequence-with-analytical.html' title='find gap in sequence with analytical function'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-115069302367704170</id><published>2006-06-19T12:53:00.000+08:00</published><updated>2006-06-19T13:42:19.253+08:00</updated><title type='text'>script to delete duplicates in a table</title><content type='html'>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;blockquote cite=&quot;Untitled&quot;&gt;DELETE FROM emp&lt;br /&gt;WHERE ROWID IN  &lt;br /&gt;  (SELECT ROWID  &lt;br /&gt;  FROM (SELECT ROWID,  &lt;br /&gt;  ROW_NUMBER() OVER (PARTITION BY empno ORDER BY EMPNO) rn  &lt;br /&gt;  FROM emp2)  &lt;br /&gt;  WHERE rn &amp;gt; 1);&lt;/blockquote&gt;&lt;p class=&quot;citation&quot;&gt;&lt;cite cite=&quot;http://techrepublic.com.com/5110-9592-6080093.html&quot;&gt;&lt;a href=&quot;http://techrepublic.com.com/5110-9592-6080093.html&quot;&gt;source:techrepublic&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;  &lt;p&gt;This is another script to delete duplicates in a table, using analytical functions.&lt;/p&gt;  &lt;p&gt;The table is emp and the criteria for whether the row is duplicate is the empno.&lt;/p&gt;  &lt;p&gt;If your version of Oracle does not have analytical functions, you can use this instead&lt;/p&gt;  &lt;blockquote cite=&quot;Untitled&quot;&gt;DELETE FROM emp e1&lt;br /&gt; WHERE ROWID !=&lt;br /&gt;   (SELECT min(rowid)&lt;br /&gt;   FROM emp e2&lt;br /&gt;  where e2.empno = e1.empno);&lt;/blockquote&gt;&lt;cite cite=&quot;http://techrepublic.com.com/5110-9592-6080093.html&quot;&gt;From the tests I ran, the second script is faster.&lt;br /&gt;&lt;/cite&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;font-size: 10px; text-align: right;&quot;&gt;technorati tags:&lt;a href=&quot;http://technorati.com/tag/oracle&quot; rel=&quot;tag&quot;&gt;oracle&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/sql&quot; rel=&quot;tag&quot;&gt;sql&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: right; font-size: 8px;&quot;&gt;Blogged with &lt;a href=&quot;http://www.flock.com&quot; target=&quot;_new&quot; title=&quot;Flock&quot;&gt;Flock&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/115069302367704170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/115069302367704170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/115069302367704170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/115069302367704170'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2006/06/script-to-delete-duplicates-in-table.html' title='script to delete duplicates in a table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-114352648690768667</id><published>2006-03-28T14:14:00.000+08:00</published><updated>2006-03-28T14:14:46.936+08:00</updated><title type='text'>using function and constant in sql loader</title><content type='html'>&lt;p&gt;After a long break from Oracle work, I recently had to load some data from Excel into an Oracle database.&lt;br /&gt;&lt;br /&gt;I googled for a ready made solution but the &lt;a href=&quot;http://asktom.oracle.com&quot;&gt;Oracle expert&lt;/a&gt; says the easiest is to convert the Excel file into a csv and use sql loader to load the file.&lt;br /&gt;&lt;br /&gt;In my solution, I wanted to be able to load data files that :&lt;br /&gt;1. contain &#39;,&#39;&lt;br /&gt;2. contain date columns in this format &#39;31-12-06&#39; (31st Dec 06)&lt;br /&gt;&lt;br /&gt;To fulfil 1., my control file cannot use the standard &lt;em&gt;fields terminated by &#39;,&#39; &lt;/em&gt;quoted in most examples.&lt;br /&gt;Instead my fields will be terminated by tab.&lt;br /&gt;There were no examples on the internet that I could find.&lt;br /&gt;I experimented with &#39;\t&#39; and it worked.&lt;br /&gt;&lt;br /&gt;Secondly, I wanted sql loader to convert &#39;31-12-06&#39; to 31 Dec 06 before loading, otherwise I get the invalid date error.&lt;br /&gt;I needed to use a function to process the field first.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;GL_DATE &amp;quot;to_date(:gl_date, &#39;dd-mm-yy&#39;)&amp;quot;&lt;/em&gt; - worked&lt;br /&gt;&lt;br /&gt;Thirdly, I populated a column with a constant value (C)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;STATEMENT_BASIS constant &#39;C&#39;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My eventual control file  is like this:&lt;br /&gt;&lt;br /&gt;load data&lt;br /&gt;infile &#39;C:/1/sql/t.txt&#39;&lt;br /&gt;into table MY_TABLE&lt;br /&gt;append&lt;br /&gt;&lt;strong&gt;fields terminated by &#39;\t&#39;&lt;/strong&gt;&lt;br /&gt;trailing nullcols&lt;br /&gt;(CSL_UID,&lt;br /&gt;COMPANY,&lt;br /&gt;RC_UID,&lt;br /&gt;REPORT_CENTER_NAME,&lt;br /&gt;BILL_CODE,&lt;br /&gt;GROSS_WORKING_INTEREST,&lt;br /&gt;PARTY_UID,&lt;br /&gt;PARTY_NAME,&lt;br /&gt;AMOUNT,&lt;br /&gt;&lt;strong&gt;GL_DATE &amp;quot;to_date(:gl_date, &#39;dd-mm-yy&#39;)&amp;quot;,&lt;/strong&gt;&lt;br /&gt;MAJOR_ACCOUNT,&lt;br /&gt;LINK_INFO,&lt;br /&gt;&lt;strong&gt;STATEMENT_BASIS constant &#39;C&#39;)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SQL Loader is a very useful and powerful tool.&lt;/p&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/114352648690768667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/114352648690768667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/114352648690768667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/114352648690768667'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2006/03/using-function-and-constant-in-sql.html' title='using function and constant in sql loader'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-111571512880045551</id><published>2005-05-10T16:52:00.000+08:00</published><updated>2005-05-10T16:52:08.806+08:00</updated><title type='text'></title><content type='html'>N dates on the go from DUAL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select * from (select TO_DATE ( &#39;1-feb-04&#39;) + level from dual connect by level &lt; 100)</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/111571512880045551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/111571512880045551' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111571512880045551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111571512880045551'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2005/05/n-dates-on-go-from-dual-select-from.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-111571498720771654</id><published>2005-05-10T16:49:00.000+08:00</published><updated>2005-05-10T16:49:47.250+08:00</updated><title type='text'></title><content type='html'>N numbers on the go from DUAL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select * from (select level from dual connect by level &lt; N)</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/111571498720771654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/111571498720771654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111571498720771654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111571498720771654'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2005/05/n-numbers-on-go-from-dual-select-from.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-111292740813584192</id><published>2005-04-08T10:30:00.001+08:00</published><updated>2005-04-08T10:30:08.136+08:00</updated><title type='text'></title><content type='html'>Best of both search engines&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://yagoohoogle.com/&quot;&gt;Google + Yahoo&lt;/a&gt; in one search !!&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/111292740813584192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/111292740813584192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111292740813584192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111292740813584192'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2005/04/best-of-both-search-engines-google_08.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-111292740105743169</id><published>2005-04-08T10:30:00.000+08:00</published><updated>2005-04-08T10:30:01.056+08:00</updated><title type='text'></title><content type='html'>Best of both search engines&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://yagoohoogle.com/&quot;&gt;Google + Yahoo&lt;/a&gt; in one search !!&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/111292740105743169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/111292740105743169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111292740105743169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/111292740105743169'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2005/04/best-of-both-search-engines-google.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-110921331388889129</id><published>2005-02-24T10:48:00.000+08:00</published><updated>2005-02-24T10:48:33.890+08:00</updated><title type='text'></title><content type='html'>&lt;b&gt;Export or import with Oracle Data Pump &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;In Oracle 10g, exp and imp have been redesigned as the Oracle Data Pump (although Oracle still ships and fully supports exp and imp). If you&#39;re used to exporting exp and imp, the Data Pump command-line programs have a syntax that will look very familiar. &lt;br /&gt;&lt;br /&gt;Data Pump runs as a job inside the database, rather than as a stand-alone client application. This means that jobs are somewhat independent of the process that started the export or import. One machine (say a scheduled job) could start the export, while another machine (such as a DBA&#39;s laptop) can check the status of the job. Since the job is inside the database, if you want to export to a file, the first thing that you must do is create a database DIRECTORY object for the output directory, and grant access to users who will be doing exports and imports: &lt;br /&gt;&lt;br /&gt;create or replace directory dumpdir as &#39;c:\&#39;;&lt;br /&gt;grant read,write on directory dumpdir to scott; &lt;br /&gt;&lt;br /&gt;Once the directory is granted, you can export a user&#39;s object with command arguments that are very similar to exp and imp: &lt;br /&gt;&lt;br /&gt;expdp scott/tiger directory=dumpdir dumpfile=scott.dmp &lt;br /&gt;&lt;br /&gt;While the export job is running, you can press [Ctrl]C (or the equivalent on your client) to &quot;detach&quot; from the export job. The messages will stop coming to your client, but it&#39;s still running inside the database. Your client will be placed in an interactive mode (with Export&gt; prompt). To see which jobs are running, type status. If you run expdp attach=&lt;jobname&gt;, you can attach to a running job. &lt;br /&gt;&lt;br /&gt;Data Pump doesn&#39;t necessarily have to write to files. Now there are options to allow you to export database objects directly into a remote database over SQL*Net. You simple specify the remote option with the connect string of the remote database. This is something like a one-time database replication job. &lt;br /&gt;&lt;br /&gt;Data Pump is much faster than the old exp and imp client commands. One new feature that really helps make it faster is the &quot;parallel&quot; option. With this option, the Data Pump will pump data in four different threads. For example, I ran the following job, pressed [Ctrl]C, and queried the status of the background jobs: &lt;br /&gt;&lt;br /&gt;expdp scott/tiger directory=dumpdir dumpfile=scott2.dmp parallel=4&lt;br /&gt;job_name=scott2&lt;br /&gt;&lt;br /&gt;Export: Release 10.1.0.2.0 - Production on Friday, 31 December, 2004 14:54&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -&lt;br /&gt; Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;FLASHBACK automatically enabled to preserve database integrity.&lt;br /&gt;Starting &quot;SCOTT&quot;.&quot;SCOTT2&quot;:  scott/******** directory=dumpdir&lt;br /&gt;dumpfile=scott2.dmp parallel=4 job_name=scott2&lt;br /&gt;Estimate in progress using BLOCKS method...&lt;br /&gt;&lt;br /&gt;Export&gt; status&lt;br /&gt;&lt;br /&gt;Job: SCOTT2&lt;br /&gt;&amp;nbsp;&amp;nbsp;Operation: EXPORT&lt;br /&gt;&amp;nbsp;&amp;nbsp;Mode: SCHEMA&lt;br /&gt;&amp;nbsp;&amp;nbsp;State: EXECUTING&lt;br /&gt;&amp;nbsp;&amp;nbsp;Bytes Processed: 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;Current Parallelism: 4&lt;br /&gt;&amp;nbsp;&amp;nbsp;Job Error Count: 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;Dump File: C:\SCOTT2.DMP&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;bytes written: 4,096&lt;br /&gt;&lt;br /&gt;Worker 1 Status:&lt;br /&gt;&amp;nbsp;&amp;nbsp;State: EXECUTING&lt;br /&gt;&lt;br /&gt;Worker 2 Status:&lt;br /&gt;&amp;nbsp;&amp;nbsp;State: WORK WAITING&lt;br /&gt;&lt;br /&gt;Worker 3 Status:&lt;br /&gt;&amp;nbsp;&amp;nbsp;State: WORK WAITING&lt;br /&gt;&lt;br /&gt;Worker 4 Status:&lt;br /&gt;&amp;nbsp;&amp;nbsp;State: WORK WAITING &lt;br /&gt;&lt;br /&gt;Not only is the Data Pump running inside the database, but also, most of the command-line features are exposed from inside the database through a PL/SQL api, DBMS_DATAPUMP. For example, you can start the export job from a PL/SQL package with the following PL/SQL code: &lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;handle  number;&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;handle := dbms_datapump.open(&#39;EXPORT&#39;,&#39;SCHEMA&#39;);&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;dbms_datapump.add_file(handle,&#39;SCOTT3.DMP&#39;,&#39;DUMPDIR&#39;);&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;dbms_datapump.metadata_filter(handle,&#39;SCHEMA_EXPR&#39;,&#39;= &#39;&#39;SCOTT&#39;&#39;&#39;);&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;dbms_datapump.set_parallel(handle,4);&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;dbms_datapump.start_job(handle);&lt;br /&gt;&amp;nbsp;&amp;&amp;nbsp;&amp;&amp;nbsp;&amp;nbsp;dbms_datapump.detach(handle);&lt;br /&gt;end;&lt;br /&gt;/ &lt;br /&gt;&lt;br /&gt;Check out Data Pump to learn about many of its other great new features. For instance, Data Pump contains features with the ability to rename datafiles, move objects to different tablespaces, or select schema objects or schemas using wildcard patterns or expressions. The Data Pump can also act as an interface to external tables (i.e., a table can be linked to data stored in a data pump export file like the Oracle Loader interface available since Oracle 9i). &lt;br /&gt;&lt;br /&gt;Scott Stephens worked for Oracle for more than 13 years in technical support, e-commerce, marketing, and software development. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/110921331388889129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/110921331388889129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110921331388889129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110921331388889129'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2005/02/export-or-import-with-oracle-data-pump.html' title=''/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-110324891775575516</id><published>2004-12-17T10:01:00.000+08:00</published><updated>2004-12-17T10:01:57.756+08:00</updated><title type='text'>Desktop Search Engines - my favourite</title><content type='html'>I have long been interested in Desktop Search products.&lt;br /&gt;It&#39;s great for finding stuff on my PC without doing the Explorer find which can take a very long time.&lt;br /&gt;&lt;br /&gt;These are the Desktop Search products I have tried and my take on them:&lt;br /&gt;&lt;br /&gt;1. &lt;a href=&quot;http://www.copernic.com/en/products/desktop-search/&quot; target=&quot;_blank&quot;&gt;Copernic Desktop&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;My favourite desktop search because it can index any type of text file. I have text files  with .java, .sql, .jnl extensions and I can set up Copernic to index these files too&lt;br /&gt;2. &lt;a href=&quot;http://beta.toolbar.msn.com/&quot; target=&quot;_blank&quot;&gt;msn toolbar suite&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;indexes only common files like microsoft excel, word, text files.&lt;br /&gt;3. &lt;a href=&quot;http://desktop.google.com/about.html&quot; target=&quot;_blank&quot;&gt;Google Desktop&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;familiar interface but indexes only common files but &lt;b&gt;not pdf&lt;/b&gt;&lt;br /&gt;4. &lt;a href=&quot;http://www.blinkx.com/&quot; target=&quot;_blank&quot;&gt;blinkx&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;not stable, occasionally crashes on windows xp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/110324891775575516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/110324891775575516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110324891775575516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110324891775575516'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/12/desktop-search-engines-my-favourite.html' title='Desktop Search Engines - my favourite'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-110264840320958329</id><published>2004-12-10T11:13:00.000+08:00</published><updated>2004-12-10T11:13:23.210+08:00</updated><title type='text'>10g explain plan output</title><content type='html'>found a new explain plan statement.&lt;br /&gt;&lt;br /&gt;in addition to normal expected explain plan output like operation, access plan, cost and rows returned, &lt;br /&gt;it also includes predicate information like: &lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;---------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;   2 - access(&quot;D&quot;.&quot;OPERATOR_ID&quot;=&quot;V&quot;.&quot;FRANCHISE_ID&quot; AND &quot;D&quot;.&quot;BILLING_NETWORK_OPERATOR_ID&quot;=&quot;V&quot;.&quot;NOP_ID&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       filter(&quot;D&quot;.&quot;YEAR_MONTH_START_DATE&quot;&gt;=TRUNC(&quot;V&quot;.&quot;START_DATE&quot;) AND&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              &quot;D&quot;.&quot;YEAR_MONTH_START_DATE&quot;&lt;=TRUNC(NVL(&quot;V&quot;.&quot;END_DATE&quot;,&quot;D&quot;.&quot;YEAR_MONTH_END_DATE&quot;)) AND&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              NVL(&quot;D&quot;.&quot;OP_VARIANCE_PERCENT&quot;,&quot;D&quot;.&quot;BOP_VARIANCE_PERCENT&quot;)&gt;=CASE  WHEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              (&quot;V&quot;.&quot;PREVIOUS_PERCENT&quot;=&quot;V&quot;.&quot;PERCENTAGE&quot;) THEN 0 WHEN (&quot;V&quot;.&quot;PREVIOUS_PERCENT&quot;&lt;&quot;V&quot;.&quot;PERCENTAGE&quot;) THEN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              &quot;V&quot;.&quot;PREVIOUS_PERCENT&quot;+0.0000001 END  AND &quot;V&quot;.&quot;PERCENTAGE&quot;&gt;=NVL(&quot;D&quot;.&quot;OP_VARIANCE_PERCENT&quot;,&quot;D&quot;.&quot;BOP_VARIAN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;              CE_PERCENT&quot;))&lt;br /&gt;&lt;br /&gt;The predicate information explains why a certain operation was taken at the step.&lt;br /&gt;&lt;br /&gt;The script is simple:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT plan_table_output&lt;br /&gt;FROM table(dbms_xplan.display(&#39;plan_table&#39;, null,&#39;SERIAL&#39;));&lt;br /&gt;&lt;/b&gt;-- parameters:&lt;br /&gt;-- 1. plan TABLE name&lt;br /&gt;-- 2. statement id  -- Null will fetch the last explain plan&lt;br /&gt;-- 3. level OF detail eg BASIC, SERIAL, TYPICAL, ALL&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/110264840320958329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/110264840320958329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110264840320958329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/110264840320958329'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/12/10g-explain-plan-output.html' title='10g explain plan output'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109987940090964272</id><published>2004-11-08T10:03:00.000+08:00</published><updated>2004-11-08T10:03:20.910+08:00</updated><title type='text'>Scalar Subquery to avoid outer join</title><content type='html'>An outer join is used when there are some rows in 1 table (say &lt;b&gt;t&lt;/b&gt;) that are not matched in another table (say &lt;b&gt;t_c1&lt;/b&gt;) but you still want to return rows from table &lt;b&gt;t&lt;/b&gt;.&lt;br /&gt;An outer join prevents the optimizer from using  the most optimal execution path and thus impacts performance negatively.&lt;br /&gt;&lt;br /&gt;With scalar subquery (highlighted in bold below), we can avoid outer joins like this:&lt;br /&gt;&lt;br /&gt;select t.some_column ,&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(select t_c1.some_column,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       t_c1.some_other_column&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    from t_c1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;        on some_column = t_c1.some_column)&lt;/b&gt;&lt;br /&gt;from t&lt;br /&gt;&lt;br /&gt;The above returns rows even when t.some_column does not match t_c1.some_column achieving an &lt;b&gt;optional join&lt;/b&gt; just like &lt;b&gt;outer join&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Read more about &lt;a href=&quot;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:22868017492361&quot; target=&quot;_blank&quot;&gt;Scalar subquery and outer join&lt;/a&gt; here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109987940090964272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109987940090964272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109987940090964272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109987940090964272'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/11/scalar-subquery-to-avoid-outer-join.html' title='Scalar Subquery to avoid outer join'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109936256603756320</id><published>2004-11-02T10:29:00.000+08:00</published><updated>2004-11-02T10:29:26.036+08:00</updated><title type='text'>Mindmapping tool</title><content type='html'>A digression from this blog&#39;s theme.&lt;br /&gt;&lt;br /&gt;I discovered &lt;a href=&quot;http://freemind.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;Freemind&lt;/a&gt; yesterday.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://freemind.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;Freemind&lt;/a&gt; is a tool for creating mind-maps on your PC.&lt;br /&gt;&lt;a href=&quot;http://www.mind-map.com/&quot; target=&quot;_blank&quot;&gt;Mind-mapping&lt;/a&gt; is an alternative technique pioneered by Tony Buzan for putting thoughts on paper.&lt;br /&gt;&lt;br /&gt;I used mind-mapping in my university days and I did not do too badly using this then unconventional technique to study.&lt;br /&gt;&lt;br /&gt;I am excited to use it for my work now.&lt;br /&gt;Finding a tool to use it on my PC is great.</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109936256603756320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109936256603756320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109936256603756320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109936256603756320'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/11/mindmapping-tool.html' title='Mindmapping tool'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109823975163860782</id><published>2004-10-20T10:35:00.000+08:00</published><updated>2004-10-20T10:55:06.910+08:00</updated><title type='text'>Explode range of dates</title><content type='html'>Requires Oracle 9i and above&lt;br /&gt;&lt;br /&gt;create or replace type dates_t as table of DATE;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create or replace function date_range_from_cursor ( p_cursor in sys_refcursor )&lt;br /&gt;return dates_t&lt;br /&gt;pipelined&lt;br /&gt;as&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_b    DATE;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;l_e DATE;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v_date DATE := NULL;&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;loop&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fetch p_cursor into l_b, l_e;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;exit when p_cursor%notfound;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;v_date := l_b;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHILE v_date &lt;= l_e&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LOOP&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;br /&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;pipe row(v_date);&lt;br /&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;v_date := v_date + 1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END LOOP;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end loop;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;close p_cursor;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select *&lt;br /&gt;from table&lt;br /&gt;&amp;nbsp;&amp;nbsp;(date_range_from_cursor(cursor(select sysdate, SYSDATE + 10 from dual&lt;br /&gt;&amp;nbsp;&amp;nbsp;UNION&lt;br /&gt;&amp;nbsp;&amp;nbsp;SELECT SYSDATE + 13, SYSDATE + 20 FROM dual)))&lt;br /&gt;/&lt;br /&gt;COLUMN_VA&lt;br /&gt;---------&lt;br /&gt;20-OCT-04&lt;br /&gt;21-OCT-04&lt;br /&gt;22-OCT-04&lt;br /&gt;23-OCT-04&lt;br /&gt;24-OCT-04&lt;br /&gt;25-OCT-04&lt;br /&gt;26-OCT-04&lt;br /&gt;27-OCT-04&lt;br /&gt;28-OCT-04&lt;br /&gt;29-OCT-04&lt;br /&gt;30-OCT-04&lt;br /&gt;02-NOV-04&lt;br /&gt;03-NOV-04&lt;br /&gt;04-NOV-04&lt;br /&gt;05-NOV-04&lt;br /&gt;06-NOV-04&lt;br /&gt;07-NOV-04&lt;br /&gt;08-NOV-04&lt;br /&gt;09-NOV-04</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109823975163860782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109823975163860782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109823975163860782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109823975163860782'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/10/explode-range-of-numbers.html' title='Explode range of dates'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109478238897777013</id><published>2004-09-10T10:13:00.000+08:00</published><updated>2004-09-10T10:13:08.976+08:00</updated><title type='text'>dbms_profiler for code coverage</title><content type='html'>Prerequisite: &lt;br /&gt;1. dbms_profiler is installed &lt;br /&gt;2. current user has execute privilege on dbms_profiler&lt;br /&gt;    select, insert, update, delete privileges on&lt;br /&gt;        plsql_profiler_data&lt;br /&gt;        plsql_profiler_units&lt;br /&gt;        plsql_profiler_runs&lt;br /&gt;3. synonyms (private or public (preferred) created&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;1. exec dbms_profiler.start_profiler(run_comment IN VARCHAR2 := SYSDATE,&lt;br /&gt;                            run_comment1 IN VARCHAR2 := &#39;&#39;,&lt;br /&gt;                            run_number  OUT BINARY_INTEGER);&lt;br /&gt;    &lt;br /&gt;2. run the application&lt;br /&gt;&lt;br /&gt;3. exec dbms_profiler.stop_profiler&lt;br /&gt;&lt;br /&gt;Run this script to get code coverage:&lt;br /&gt;Note: set value for :owner&lt;br /&gt;                           :runid  (this is the out variable in Step 1)&lt;br /&gt;&lt;br /&gt;SELECT EXEC.unit_name, -- code coverage by package&lt;br /&gt;  ROUND (EXEC.cnt/total.cnt * 100, 1) &quot;Code% coverage&quot;   &lt;br /&gt;FROM  (SELECT u.unit_name, &lt;br /&gt;                COUNT(1) cnt &lt;br /&gt;             FROM plsql_profiler_data d, plsql_profiler_units u &lt;br /&gt;             WHERE d.runid = :runid &lt;br /&gt;                  AND u.runid = d.runid &lt;br /&gt;                  AND u.unit_number = d.unit_number &lt;br /&gt;                  AND u.unit_owner = UPPER(:owner) &lt;br /&gt;              GROUP BY u.unit_name) total, &lt;br /&gt;              (SELECT u.unit_name, &lt;br /&gt;                     COUNT(1) cnt &lt;br /&gt;                FROM plsql_profiler_data d, plsql_profiler_units u &lt;br /&gt;                WHERE d.runid = :runid &lt;br /&gt;                     AND u.runid = d.runid &lt;br /&gt;                     AND u.unit_number = d.unit_number &lt;br /&gt;                     AND u.unit_owner = UPPER(:owner) &lt;br /&gt;                     AND d.total_occur &gt; 0 &lt;br /&gt;                GROUP BY u.unit_name) EXEC &lt;br /&gt;WHERE EXEC.unit_name = total.unit_name&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109478238897777013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109478238897777013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109478238897777013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109478238897777013'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/dbmsprofiler-for-code-coverage.html' title='dbms_profiler for code coverage'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109472973728559297</id><published>2004-09-09T19:35:00.000+08:00</published><updated>2004-09-09T19:35:37.286+08:00</updated><title type='text'>ADF UIX Component Guide</title><content type='html'>Get &lt;a href=&quot;http://www.orablogs.com/jjacobi/archives/000483.html&quot; target=&quot;_blank&quot;&gt;ADF UIX Component Guide&lt;/a&gt; if required.</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109472973728559297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109472973728559297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109472973728559297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109472973728559297'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/adf-uix-component-guide.html' title='ADF UIX Component Guide'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109471035811691706</id><published>2004-09-09T14:12:00.000+08:00</published><updated>2004-09-09T14:12:38.116+08:00</updated><title type='text'>text in all_source ends with chr(10)</title><content type='html'>Did you know that all_source.text ends with chr(10) ?&lt;br /&gt;&lt;br /&gt;if you want to search for /*single line comment*/ in all_source,&lt;br /&gt;this will not work:&lt;br /&gt;&lt;br /&gt;select *&lt;br /&gt;from all_source&lt;br /&gt;where ltrim(text) like &#39;/*%*/&#39;&lt;br /&gt;&lt;br /&gt;this will work&lt;br /&gt;&lt;br /&gt;select *&lt;br /&gt;from all_source&lt;br /&gt;where ltrim(text) like &#39;/*%*/&#39; || chr(10)&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109471035811691706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109471035811691706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109471035811691706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109471035811691706'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/text-in-allsource-ends-with-chr10.html' title='text in all_source ends with chr(10)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109469919571026741</id><published>2004-09-09T11:06:00.000+08:00</published><updated>2004-09-09T11:07:27.786+08:00</updated><title type='text'>Adopting an MVC approach to Oracle Development</title><content type='html'>MVC is very popular in Java for separating the model from the view from the controller.&lt;br /&gt;Its advantage is that it segments an application to distinct components - Model, View, Component.&lt;br /&gt;&lt;br /&gt;We can adopt this segmented approach for pl/sql development.&lt;br /&gt;&lt;br /&gt;Let&#39;s take an example that we want to build an application that will compare 2 tables for differences and populate a table for the differences.&lt;br /&gt;&lt;br /&gt;Let&#39;s say the tables have these common columns&lt;br /&gt;k1, k2, a1, a2&lt;br /&gt;&lt;br /&gt;Step 1 - The V&lt;br /&gt;&lt;br /&gt;Build a view based on a select statement that will identify the difference.&lt;br /&gt;&lt;br /&gt;In our example the sql might look like this:&lt;br /&gt;&lt;br /&gt;select k1, k2, a1, a2&lt;br /&gt;from table1&lt;br /&gt;minus&lt;br /&gt;select k1, k2, a1, a2&lt;br /&gt;from table2&lt;br /&gt;&lt;br /&gt;We build a view for the above sql statement.&lt;br /&gt;Let&#39;s call the view difference_v.&lt;br /&gt;The view is also encapsulating our business rule for what differences are.&lt;br /&gt;&lt;br /&gt;Step 2 - the business work&lt;br /&gt;&lt;br /&gt;A package that uses the view&lt;br /&gt;with pseudo logic like this:&lt;br /&gt;&lt;br /&gt;  for each row in difference_v&lt;br /&gt;    insert row info into difference_table&lt;br /&gt;  next&lt;br /&gt;&lt;br /&gt;What have we achieved so far?&lt;br /&gt;We have :&lt;br /&gt;1. segmented the difference business rule in the difference_v&lt;br /&gt;    if the business rule changes, we just change the view creation select statement&lt;br /&gt;&lt;br /&gt;2. segmented the &#39;what to do with difference&#39; in the package in Step 2&lt;br /&gt;&lt;br /&gt;Using this segmented approach, we can start with step 1 with certain assumptions which can be revised later and move on to Step 2.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109469919571026741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109469919571026741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109469919571026741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109469919571026741'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/adopting-mvc-approach-to-oracle.html' title='Adopting an MVC approach to Oracle Development'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109469651438586752</id><published>2004-09-09T10:20:00.000+08:00</published><updated>2004-09-09T10:21:54.386+08:00</updated><title type='text'>dbms_profiler</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/9i/DBMS_PROFILER.php&quot; target=&quot;_blank&quot;&gt;How to use dbms_profiler&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;use dbms_profiler to :&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;1. search out performance bottlenecks&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;2. analyse code coverage&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109469651438586752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109469651438586752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109469651438586752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109469651438586752'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/dbmsprofiler.html' title='dbms_profiler'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109460024632778109</id><published>2004-09-08T07:37:00.000+08:00</published><updated>2004-09-08T07:37:26.326+08:00</updated><title type='text'>7 Rules for Project Progress (moving forward)</title><content type='html'>1. Untested code isn&#39;t done. &lt;br /&gt;2. Unreleased code isn&#39;t done. &lt;br /&gt;3. Undocumented code isn&#39;t done. &lt;br /&gt;4. Set many, small, specific goals. &lt;br /&gt;5. Do something every day. Finish something every week. &lt;br /&gt;6. One feature finished is better than ten features planned.&lt;br /&gt;7. Simplicity gives you more options than complexity. &lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109460024632778109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109460024632778109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109460024632778109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109460024632778109'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/09/7-rules-for-project-progress-moving.html' title='7 Rules for Project Progress (moving forward)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7058542.post-109296193260853992</id><published>2004-08-20T08:32:00.000+08:00</published><updated>2004-08-27T09:59:06.746+08:00</updated><title type='text'>Exception Handling</title><content type='html'>&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;Picked this up from asktom.oracle.com (&lt;/span&gt;&lt;a href=&quot;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1932043078402&quot;&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1932043078402&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;exceptions should be caught IF and ONLY IF you&lt;br /&gt;&lt;br /&gt;a) expect them&lt;br /&gt;b) can do something about them&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;eg: when no_data_found -- catch it, deal with it.&lt;br /&gt;&lt;br /&gt;other exceptions that you cannot possibly recover from should not be caught and&lt;br /&gt;the job queues will absolutely record the line number and everything exactly&lt;br /&gt;right in the alert log. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:78%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracleprofessional.blogspot.com/feeds/109296193260853992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7058542/109296193260853992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109296193260853992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7058542/posts/default/109296193260853992'/><link rel='alternate' type='text/html' href='http://oracleprofessional.blogspot.com/2004/08/exception-handling.html' title='Exception Handling'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>