<?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-4758846885014782254</id><updated>2025-12-29T19:25:07.529+05:30</updated><title type='text'>Solution for Informatica problems</title><subtitle type='html'>&amp;gt;&amp;gt; Scenario based solutions</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>118</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-2633028577780284765</id><published>2012-12-03T16:57:00.006+05:30</published><updated>2023-03-15T17:20:07.157+05:30</updated><title type='text'>Difference Between Primary key and Unique key</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;span style=&quot;font-family: georgia;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: georgia;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Unique key -&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; It display the unique values which &lt;b&gt;&lt;i&gt;can have one null&lt;/i&gt;&lt;/b&gt; value where&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: georgia; font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: georgia;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Primary key -&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;has &lt;b&gt;unique values without null.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: georgia; font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: georgia;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Whenever you create the primary key constraints, Oracle by default create a unique index with not null. &lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: georgia; font-size: 11pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/2633028577780284765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2012/12/diff-between-primary-key-and-unique-key.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2633028577780284765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2633028577780284765'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2012/12/diff-between-primary-key-and-unique-key.html' title='Difference Between Primary key and Unique key'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-1402524879039274977</id><published>2012-06-15T17:43:00.005+05:30</published><updated>2012-06-15T17:43:53.910+05:30</updated><title type='text'>SQL Transformation with examples</title><content type='html'>&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapedefaults v:ext=&quot;edit&quot; spidmax=&quot;1027&quot;/&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapelayout v:ext=&quot;edit&quot;&gt;
  &lt;o:idmap v:ext=&quot;edit&quot; data=&quot;1&quot;/&gt;
 &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 10.0pt;&quot;&gt;=============================================================================================&lt;/span&gt;&lt;/div&gt;
&lt;h3 align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;
SQL Transformation with examples&lt;/h3&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&lt;span class=&quot;ilad&quot;&gt;&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Use&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;: &lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;SQL Transformation is a connected
transformation used to process SQL queries in the midstream of a &lt;span class=&quot;ilad&quot;&gt;pipeline&lt;/span&gt;. We can insert, update, delete and retrieve rows
from the database at run time using the SQL transformation.&lt;/span&gt; &lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Use SQL transformation in &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;script mode&lt;/b&gt; to run DDL (data definition
language) statements like creating or dropping the tables.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;The
following SQL statements can be used in the SQL transformation.&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Data Definition Statements (CREATE, ALTER, DROP,
     TRUNCATE, RENAME)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;DATA MANIPULATION statements (INSERT, UPDATE, DELETE,
     MERGE)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;DATA Retrieval Statement (SELECT)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;DATA Control Language Statements (GRANT, REVOKE)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Transaction Control Statements (COMMIT, ROLLBACK)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Scenario: &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Let’s say we want to create a
temporary table in mapping while workflow is running for some intermediate
calculation. We can use SQL transformation in &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;script mode &lt;/b&gt;to achieve the same.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Below we
will see how to create sql transformation in script mode with an example where
we will create a table in mapping and will insert some rows in the same table.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;b&gt;Solution: &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Step 1: &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Create two
text files in the $PMSourceFileDir directory with some sql queries. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; mso-list: l4 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;color: purple; font-family: Verdana; font-size: 9.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;1.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana; font-size: 9.0pt;&quot;&gt;sql_script.txt &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;File contains the below Sql queries (you can have multiple
sql queries in file separated by semicolon)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;create table
create_emp_table &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; text-indent: .5in;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;(emp_id number,emp_name varchar2(100))&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; mso-list: l4 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;color: purple; font-family: Verdana; font-size: 9.0pt; mso-bidi-font-family: Verdana; mso-fareast-font-family: Verdana;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;2.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: purple; font-family: Verdana; font-size: 9.0pt;&quot;&gt;sql_script2.txt&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;File contains the below Sql queries (you can have multiple
sql queries in file separated by semicolon)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;insert into create_emp_table values
(1,&#39;abc&#39;)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;These are
the script files to be executed by SQL transformation on database server.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Step 2: &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&lt;br /&gt;
We need a source which contains the above script file names with a complete path.
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;So, I
created another file in the $PMSourceFileDir directory to store these script
file names as &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Sql_script_input.txt&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;File
contains the list of files with their complete path:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;E:\softs\Informatica\server\infa_shared\SrcFiles\&lt;span style=&quot;color: purple;&quot;&gt;sql_script.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;E:\softs\Informatica\server\infa_shared\SrcFiles\&lt;span style=&quot;color: purple;&quot;&gt;sql_script2.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Step 3:&lt;/span&gt; &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Now we
will create a mapping to execute the script files using the SQL transformation.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Go to the
mapping designer tool, source analyzer and Import from file &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;=&amp;gt;then
creates source definition by selecting a file &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Sql_script_input.txt&lt;/b&gt; Located at E:\softs\Informatica\server\infa_shared\SrcFiles.
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Source
definition will look like&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3COIl_DZdoMqWLQT13C3bXu11l17O3ZaF_TFRXLt232GvTsFRgrptS1kVUsNzkaxQVxhv9tOnSA5L1UtYsadeahMT6vk-gDfDe89gAfowa4-s4J3-uvPRGKU5nmg2ke1eukXL5B8Fhg8/s1600/input.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3COIl_DZdoMqWLQT13C3bXu11l17O3ZaF_TFRXLt232GvTsFRgrptS1kVUsNzkaxQVxhv9tOnSA5L1UtYsadeahMT6vk-gDfDe89gAfowa4-s4J3-uvPRGKU5nmg2ke1eukXL5B8Fhg8/s1600/input.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Similarly
create a target definition, go to target designer and create a target flat file
with result and error ports. This is shown in the below image &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQQmYJf898d1qm94TDWGyYoV9_hPKFdYhCI5n-xH9YTRI4_bL_VYY-rLYQIU8cuH8cQIms_IAeIhav0_k22Aq-eDIzVafxTfYxcIey85E7bPQGekAGWQnTxEza7FG-iG4I6TI8cxiZGJA/s1600/output.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQQmYJf898d1qm94TDWGyYoV9_hPKFdYhCI5n-xH9YTRI4_bL_VYY-rLYQIU8cuH8cQIms_IAeIhav0_k22Aq-eDIzVafxTfYxcIey85E7bPQGekAGWQnTxEza7FG-iG4I6TI8cxiZGJA/s1600/output.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Step 4:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Go to the mapping designer and create a new mapping.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Drag the flat file into the mapping designer.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Go to the Transformation in the toolbar, Create,
     select the SQL transformation, enter a name and click on create.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Now select the SQL transformation options as script
     mode and DB type as Oracle and click ok. &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgXU_KLGPQIcLu6oyMeH1qxaML15EBUUdshrcIOkeasehCeq2VlTJ7J0bosrfnO7RqHcOgDGjaSMYsMEzO7WssoiWlJ3T5R331XMqm0QfqFygNBgDph1znPial1vINzNmjcyHPiNcss0/s1600/SQL.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixgXU_KLGPQIcLu6oyMeH1qxaML15EBUUdshrcIOkeasehCeq2VlTJ7J0bosrfnO7RqHcOgDGjaSMYsMEzO7WssoiWlJ3T5R331XMqm0QfqFygNBgDph1znPial1vINzNmjcyHPiNcss0/s1600/SQL.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJC6VdOSls3UmBflOVipq1T_fDzOyhJQyAOULGUb26tRkKUR7N_TDsW8plnT9M6axClkeprWcpEoLCM4sPJWPo-AE6cA2yvwQKPOLWUvxEAaIoXoZ75L63XJ8nLr8OAKx4-RgtWhBEVe0/s1600/sql_transformation_script_mode.jpg&quot;&gt;&lt;span style=&quot;text-decoration: none; text-underline: none;&quot;&gt;&lt;span style=&quot;mso-ignore: vglayout;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;The SQL transformation is created with the default
     ports.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Now connect the source qualifier transformation ports
     to the SQL transformation input port.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Drag the target flat file into the mapping and
     connect the SQL transformation output ports to the target.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Save the mapping. The mapping flow image is shown in
     the below picture.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXsHXTPafEiFJy5EVSUONAH_XmFmoIaCUX5JHFAWwb6ZCq6oj5zF3Ez4m2i6_Aq9bv36tZMhRrO1kKBAt9R6HgfRCN8cdEs5zl7851cEgH_4berrbY86Hnal7wDC5E9Ggr8UNR-DtXOAU/s1600/mapping.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXsHXTPafEiFJy5EVSUONAH_XmFmoIaCUX5JHFAWwb6ZCq6oj5zF3Ez4m2i6_Aq9bv36tZMhRrO1kKBAt9R6HgfRCN8cdEs5zl7851cEgH_4berrbY86Hnal7wDC5E9Ggr8UNR-DtXOAU/s1600/mapping.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Go to the workflow manager; create a new workflow and
     session.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Edit the session. For source, enter the source &amp;amp;
     target file directory.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;For the SQL transformation, enter the oracle database
     relational connection as shown below.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyHEtBF9QkjGcRBw2J6au4r9IE-U5pW6DQnZoe_oozcigKDlYrGdM45QFYGKQgLXP8LOsVsA4AvDdrE9SkV06fr0as_rCn108m_kkGbKZQ8XrSo-7IeuO04v9sysKA544RygjSt9Et4Tk/s1600/setting.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyHEtBF9QkjGcRBw2J6au4r9IE-U5pW6DQnZoe_oozcigKDlYrGdM45QFYGKQgLXP8LOsVsA4AvDdrE9SkV06fr0as_rCn108m_kkGbKZQ8XrSo-7IeuO04v9sysKA544RygjSt9Et4Tk/s1600/setting.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Save the workflow and run it.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Open the target file, you will find the below data.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: .5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&quot;PASSED&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: .5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&quot;PASSED&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: .5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;&quot;PASSED&quot;; -: for &lt;span style=&quot;color: purple;&quot;&gt;sql_script.txt,
where it will crate the table and&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&quot;PASSED&quot;; -: For &lt;span style=&quot;color: purple;&quot;&gt;sql_scriptw.txt,
where it will insert rows in to the table&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; mso-list: l0 level1 lfo6; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 9.0pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;&quot;&gt;&lt;span style=&quot;mso-list: Ignore;&quot;&gt;&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9.0pt;&quot;&gt;Fire
a select query on the database to check whether table is created or not.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: .5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 10.0pt;&quot;&gt;=============================================================================&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/1402524879039274977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/sql-transformation-with-examples.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1402524879039274977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1402524879039274977'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/sql-transformation-with-examples.html' title='SQL Transformation with examples'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3COIl_DZdoMqWLQT13C3bXu11l17O3ZaF_TFRXLt232GvTsFRgrptS1kVUsNzkaxQVxhv9tOnSA5L1UtYsadeahMT6vk-gDfDe89gAfowa4-s4J3-uvPRGKU5nmg2ke1eukXL5B8Fhg8/s72-c/input.bmp" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-7393070200673336043</id><published>2012-06-07T17:14:00.002+05:30</published><updated>2012-06-07T17:14:23.840+05:30</updated><title type='text'>Efficient SQL Statements : SQL Tunning Tips</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;//img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt;
&lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-bottom: double windowtext 2.25pt; border: none; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-bottom-alt: double windowtext 2.25pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h1&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Efficient SQL Statements&lt;/span&gt;&lt;/h1&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;This is an extremely
brief look at some of the factors that may effect the efficiency of your SQL
and PL/SQL code. It is not intended as a thorough discussion of the area and
should not be used as such.&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Check_Your_Stats&quot;&gt;Check
     Your Stats&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Why_Indexes_Aren_t_Used&quot;&gt;Why
     Indexes Aren&#39;t Used&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Caching_Tables&quot;&gt;Caching
     Tables&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Exists&quot;&gt;EXISTS
     vs. IN&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Presence_Checking&quot;&gt;Presence
     Checking&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Inequalities&quot;&gt;Inequalities&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Looks_Bad&quot;&gt;When
     Things Look Bad!&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Driving_Tables&quot;&gt;Driving
     Tables (RBO Only)&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Improving_Parse_Speed&quot;&gt;Improving
     Parse Speed&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l5 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/efficient-sql-statements.php#Packages_Procedures_and_Functions&quot;&gt;Packages
     Procedures and Functions&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Check Your Stats&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The Cost Based Optimizer
(CBO) uses statistics to decide which execution plan to use. If these
statistics are incorrect the decision made by the CBO may be incorrect. For
this reason it is important to make sure that these statistics are refreshed
regularly. The following article will help you achieve this aim.&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;a href=&quot;http://www.oracle-base.com/articles/misc/cost-based-optimizer-and-database-statistics.php&quot;&gt;Cost
     Based Optimizer (CBO) and Database Statistics&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Why Indexes Aren&#39;t Used&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The presence of an index
on a column does not guarantee it will be used. The following is a small list
of factors that will prevent an index from being used.&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The optimizer decides it would be more efficient not
     to use the index. If your query is returning the majority of the data in a
     table, then a full table scan is probably going to be the most efficient
     way to access the table.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;You perform a function on the indexed column i.e.
     WHERE UPPER(name) = &#39;JONES&#39;. The solution to this is to use a &lt;a href=&quot;http://www.oracle-base.com/articles/8i/function-based-indexes.php&quot;&gt;Function-Based
     Index&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;You perform mathematical operations on the indexed
     column i.e. WHERE salary + 1 = 10001&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;You concatenate a column i.e. WHERE firstname || &#39; &#39;
     || lastname = &#39;JOHN JONES&#39;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;You do not include the first column of a concatenated
     index in the WHERE clause of your statement. For the index to be used in a
     partial match, the first column (leading-edge) must be used. &lt;a href=&quot;http://www.oracle-base.com/articles/9i/index-skip-scanning.php&quot;&gt;Index
     Skip Scanning&lt;/a&gt; in Oracle 9i and above allow indexes to be used even
     when the leading edge is not referenced. &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The use of &#39;OR&#39; statements confuses the Cost Based
     Optimizer (CBO). It will rarely choose to use an index on column
     referenced using an OR statement. It will even ignore optimizer hints in
     this situation. The only way of guaranteeing the use of indexes in these
     situations is to use an INDEX hint.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;EXISTS vs. IN&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The EXISTS function
searches for the presence of a single row meeting the stated criteria as
opposed to the IN statement which looks for all occurrences.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;TABLE1 - 1000 rows&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;TABLE2 - 1000 rows&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;(A)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT t1.id&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;table1 t1&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;t1.code IN (SELECT t2.code &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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;&lt;/span&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;table2 t2);&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;(B)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT t1.id&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;table1 t1&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;EXISTS (SELECT &#39;1&#39; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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;&lt;/span&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;table2 t2 &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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;&lt;/span&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;t2.code = t1.code)&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;For query A, all rows in
TABLE2 will be read for every row in TABLE1. The effect will be 1,000,000 rows
read from items. In the case of query B, a maximum of 1 row from TABLE2 will be
read for each row of TABLE1, thus reducing the processing overhead of the
statement.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Rule of thumb:&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If the majority of the filtering criteria are in the
     subquery then the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;IN&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;
     variation may be more performant.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l2 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If the majority of the filtering criteria are in the
     top query then the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;EXISTS&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt; variation may be more performant.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;I would suggest they you
should try both variants and see which works the best.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Note. In later versions
of Oracle there is little difference between EXISTS and IN operations.&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Presence Checking&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The first question you
should ask yourself is, &quot;Do I need to check for the presence of a
record?&quot; Alternatives to presence checking include:&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Use the &lt;a href=&quot;http://www.oracle-base.com/articles/10g/merge-enhancements-10g.php&quot;&gt;MERGE&lt;/a&gt;
     statement if you are not sure if data is already present.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Perform an insert and trap failure because a row is
     already present using the &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;DUP_VAL_ON_INDEX&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt; exception handler.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l1 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Perform an update and test for no rows updated using &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SQL%ROWCOUNT&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If none of these options
are right for you and processing is conditional on the presence of certain
records in a table, you may decide to code something like the following.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT Count(*)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;INTO&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v_count&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;items&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;item_size = &#39;SMALL&#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;IF v_count = 0 THEN&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;-- Do processing related to no small items present&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;END IF;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If there are many small
items, time and processing will be lost retrieving multiple records which are
not needed. This would be better written like one of the following.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT COUNT(*)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;INTO&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v_count&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;items&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;item_size = &#39;SMALL&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;rownum = 1;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;IF v_count = 0 THEN&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;-- Do processing related to no small items present&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;END IF;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;OR &lt;/span&gt;&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT COUNT(*)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;INTO&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v_count&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;dual&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;EXISTS (SELECT 1&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;FROM items&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;WHERE item_size = &#39;SMALL&#39;);&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;IF v_count = 0 THEN&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;-- Do processing related to no small items present&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;END IF;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;In these examples only
single a record is retrieved in the presence/absence check.&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Inequalities&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If a query uses
inequalities (item_no &amp;gt; 100) the optimizer must estimate the number of rows
returned before it can decide the best way to retrieve the data. This
estimation is prone to errors. If you are aware of the data and it&#39;s
distribution you can use optimizer hints to encourage or discourage full table
scans to improve performance.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If an index is being used
for a range scan on the column in question, the performance can be improved by
substituting &amp;gt;= for &amp;gt;. In this case, item_no &amp;gt; 100 becomes item_no
&amp;gt;= 101. In the first case, a full scan of the index will occur. In the
second case, Oracle jumps straight to the first index entry with an item_no of
101 and range scans from this point. For large indexes this may significantly
reduce the number of blocks read.&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;When Things Look Bad!&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If you have a
process/script that shows poor performance you should do the following:&lt;/span&gt;&lt;br /&gt;


&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Write sensible queries in the first place!&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Identify the specific statement(s) that are causing a
     problem. The simplest way to do this is to use &lt;a href=&quot;http://www.oracle-base.com/articles/10g/sql-trace-10046-trcsess-and-tkprof-10g.php&quot;&gt;SQL
     Trace&lt;/a&gt;, but you can try running the individual statements using
     SQL*Plus and timing them (SET TIMING
      ON) &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Use EXPLAIN to look at the execution plan of the
     statement. Look for any full table accesses that look dubious. Remember, a
     full table scan of a small table is often more efficient than access by
     index. &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Check to see if there are any indexes that may help
     performance. &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;mso-list: l3 level1 lfo6; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Try adding new indexes to the system to reduce
     excessive full table scans. Typically, foreign key columns should be
     indexed as these are regularly used in join conditions. On occasion it may
     be necessary to add composite (concatenated) indexes that will only aid
     individual queries. Remember, excessive indexing can reduce INSERT, UPDATE
     and DELETE performance. &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Driving Tables (RBO
Only)&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The structure of the FROM
and WHERE clauses of DML statements can be tailored to improve the performance
of the statement. The rules vary depending on whether the database engine is
using the Rule or Cost based optimizer. The situation is further complicated by
the fact that the engine may perform a Merge Join or a Nested Loop join to
retrieve the data. Despite this, there are a few rules you can use to improve
the performance of your SQL.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Oracle processes result
sets a table at a time. It starts by retrieving all the data for the first
(driving) table. Once this data is retrieved it is used to limit the number of
rows processed for subsequent (driven) tables. In the case of multiple table
joins, the driving table limits the rows processed for the first driven table.
Once processed, this combined set of data is the driving set for the second
driven table etc. Roughly translated into English, this means that it is best
to process tables that will retrieve a small number of rows first. The
optimizer will do this to the best of it&#39;s ability regardless of the structure
of the DML, but the following factors may help.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Both the Rule and Cost
based optimizers select a driving table for each query. If a decision cannot be
made, the order of processing is from the end of the FROM clause to the start.
Therefore, you should always place your driving table at the end of the FROM
clause. Subsequent driven tables should be placed in order so that those
retrieving the most rows are nearer to the start of the FROM clause.
Confusingly, the WHERE clause should be writen in the opposite order, with the
driving tables conditions first and the final driven table last. ie.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;d, c, b, a&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE a.join_column = 12345&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;a.join_column = b.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;b.join_column = c.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;c.join_column = d.join_column;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;If we now want to limit
the rows brought back from the &quot;D&quot; table we may write the following.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;d, c, b, a&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE a.join_column = 12345&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;a.join_column = b.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;b.join_column = c.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;c.join_column = d.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;d.name = &#39;JONES&#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Depending on the number
of rows and the presence of indexes, Oracle my now pick &quot;D&quot; as the
driving table. Since &quot;D&quot; now has two limiting factors (join_column
and name), it may be a better candidate as a driving table so the statement may
be better written as follows.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;c, b, a, d&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE d.name = &#39;JONES&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;d.join_column = 12345&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;d.join_column = a.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;a.join_column = b.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;b.join_column = c.join_column&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;This grouping of limiting
factors will guide the optimizer more efficiently making table &quot;D&quot;
return relatively few rows, and so make it a more efficient driving table.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Remember, the order of
the items in both the FROM and WHERE clause will not force the optimizer to
pick a specific table as a driving table, but it may influence it&#39;s decision.
The grouping of limiting conditions onto a single table will reduce the number
of rows returned from that table, and will therefore make it a stronger
candidate for becoming the driving table.&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Caching Tables&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Queries will execute much
faster if the data they reference is already cached. For small frequently used
tables performance may be improved by caching tables. Normally, when full table
scans occur, the cached data is placed on the Least Recently Used (LRU) end of
the buffer cache. This means that it is the first data to be paged out when
more buffer space is required. If the table is cached (ALTER TABLE employees
CACHE;) the data is placed on the Most Recently Used (MRU) end of the buffer,
and so is less likely to be paged out before it is re-queried. Caching tables
may alter the CBO&#39;s path through the data and should not be used without
careful consideration.&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Improving Parse Speed&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Execution plans for
SELECT statements are cached by the server, but unless the exact same statement
is repeated the stored execution plan details will not be reused. Even
differing spaces in the statement will cause this lookup to fail. Use of bind
variables allows you to repeatedly use the same statements whilst changing the
WHERE clause criteria. Assuming the statement does not have a cached execution
plan it must be parsed before execution. The parse phase for statements can be
decreased by efficient use of aliasing. If an alias is not present, the engine
must resolve which tables own the specified columns. The following is an
example.&lt;/span&gt;&lt;br /&gt;


&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;mso-cellspacing: 1.5pt;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Bad Statement &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Good Statement &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt; width: 150.0pt;&quot; width=&quot;200&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT first_name,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;last_name,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;country&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;employee,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;countries&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;country_id = id&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;lastname&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;= &#39;HALL&#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt; width: 150.0pt;&quot; width=&quot;200&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;SELECT e.first_name,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.last_name,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;c.country&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;FROM&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;employee e,&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;countries c&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;WHERE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;e.country_id = c.id&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;AND&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.last_name&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;= &#39;HALL&#39;;&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Packages Procedures and
Functions&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;When an SQL statement, or
anonymous block, is passed to the server it is processed in three phases.&lt;/span&gt;&lt;br /&gt;


&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;mso-cellspacing: 1.5pt;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Phase &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Actions &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Parse&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Syntax
  Check and Object Resolution&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 2;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Execution&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Necessary
  Reads and Writes performed&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 3; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Fetch&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;padding: .75pt .75pt .75pt .75pt;&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;Resultant
  rows are Retrieved, Assembled, Sorted and Returned&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11.0pt;&quot;&gt;The Parse phase is the
most time and resource intensive. This phase can be avoided if all anonymous
blocks are stored as Database Procedures, Functions, Packages or Views. Being
database objects their SQL text and compiled code is stored in Data Dictionary
and the executable copies reside in the Shared Pool.&lt;/span&gt;&lt;br /&gt;


&lt;div style=&quot;border-bottom: double windowtext 2.25pt; border: none; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-bottom-alt: double windowtext 2.25pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/7393070200673336043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/efficient-sql-statements-sql-tunning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7393070200673336043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7393070200673336043'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/efficient-sql-statements-sql-tunning.html' title='Efficient SQL Statements : SQL Tunning Tips'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-9152058783552968513</id><published>2012-06-07T17:06:00.002+05:30</published><updated>2012-06-07T17:06:57.582+05:30</updated><title type='text'>Function : NVL2 and COALESCE</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-bottom: double windowtext 2.25pt; border: none; mso-element: para-border-div; padding: 0in 0in 0in 0in;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-bottom-alt: double windowtext 2.25pt; mso-padding-alt: 0in 0in 0in 0in; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: purple; font-family: Tahoma; font-size: 10.0pt;&quot;&gt;NVL2&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Tahoma; font-size: 10.0pt;&quot;&gt;The &lt;code&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;NVL2&lt;/span&gt;&lt;/code&gt; function accepts three
parameters. If the first parameter value is not null it returns the value in
the second parameter. If the first parameter value is null, it returns the
third parameter.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Tahoma; font-size: 10.0pt;&quot;&gt;The following query shows &lt;code&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;NVL2&lt;/span&gt;&lt;/code&gt; in action.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;SQL&amp;gt; SELECT * FROM null_test_tab ORDER BY id;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ID COL1&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;COL2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;COL3&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;COL4&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;---------- ---------- ---------- ---------- ----------&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 ONE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TWO&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;THREE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FOUR&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2&lt;span style=&quot;mso-spacerun: yes;&quot;&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;TWO&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;THREE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FOUR&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;THREE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FOUR&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4&lt;span style=&quot;mso-spacerun: yes;&quot;&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; &lt;/span&gt;THREE&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;4 rows selected.&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;SQL&amp;gt; SELECT id, NVL2(col1, col2, col3) AS output FROM null_test_tab ORDER BY id;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&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; &lt;/span&gt;ID OUTPUT&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;---------- ----------&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;1 TWO&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;2 THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;3 THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&lt;/span&gt;4 THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;4 rows selected.&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;SQL&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: purple; font-family: Tahoma; font-size: 10.0pt;&quot;&gt;COALESCE&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Tahoma; font-size: 10.0pt;&quot;&gt;The &lt;code&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;COALESCE&lt;/span&gt;&lt;/code&gt; function was introduced in
Oracle 9i. It accepts two or more parameters and returns the first non-null
value in a list. If all parameters contain null values, it returns null.&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;SQL&amp;gt; SELECT id, COALESCE(col1, col2, col3) AS output FROM null_test_tab ORDER BY id;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ID OUTPUT&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;---------- ----------&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;1 ONE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;2 TWO&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3 THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;4 THREE&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;4 rows selected.&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;SQL&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border-bottom: double windowtext 2.25pt; border: none; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: none; mso-border-bottom-alt: double windowtext 2.25pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/9152058783552968513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/function-nvl2-and-coalesce.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/9152058783552968513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/9152058783552968513'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2012/06/function-nvl2-and-coalesce.html' title='Function : NVL2 and COALESCE'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-4606902392236233738</id><published>2012-02-08T16:20:00.002+05:30</published><updated>2012-02-08T16:26:23.881+05:30</updated><title type='text'>Load the session statistics such as Session Start &amp; End Time, Success Rows, Failed Rows and Rejected Rows etc. into a database table for audit/log purpose.</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Load the session statistics such as Session Start
&amp;amp; End Time, Success Rows, Failed Rows and Rejected Rows etc. into a
database table for audit/log purpose.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;After performing the below solution steps your end
workflow will look as follows: &lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;postbody&quot;&gt;START =&amp;gt; SESSION1 =&amp;gt; ASSIGNMENT TASK =&amp;gt; SESSION2&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
SOLUTION STEPS &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
SESSION1 &lt;br /&gt;
This session is used to achieve your actual business logic. Meaning this
session will perform your actual data load. It can be anything File Table.&lt;/span&gt;&lt;span style=&quot;font-family: Symbol; font-size: 11pt;&quot;&gt;&lt;span&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;File or Table&lt;/span&gt;&lt;span style=&quot;font-family: Symbol; font-size: 11pt;&quot;&gt;&lt;span&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Table,
File &lt;/span&gt;&lt;span style=&quot;font-family: Symbol; font-size: 11pt;&quot;&gt;&lt;span&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
WORKFLOW VARIABLES &lt;br /&gt;
&lt;br /&gt;
Create the following workflow variables. &lt;br /&gt;
&lt;br /&gt;
=&amp;gt; $$Workflowname &lt;br /&gt;
=&amp;gt; $$SessionStartTime &lt;br /&gt;
=&amp;gt; $$SessionEndTime &lt;br /&gt;
=&amp;gt; $$TargetSuccessrows &lt;br /&gt;
=&amp;gt; $$TargetFailedRows &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ASSIGNMENT TASK &lt;br /&gt;
&lt;br /&gt;
Use the Expression tab in the Assignment Task and assign as follows: &lt;br /&gt;
&lt;br /&gt;
$$workflowname = $PMWorkflowName &lt;br /&gt;
$$sessionStartTime = $ SESSION1.StartTime &lt;br /&gt;
$$SessionEndTime = $ SESSION1.Endtime &lt;br /&gt;
$$ TargetSuccessrows = $ SESSION1. TgtSuccessRows &lt;br /&gt;
$$ TargetFailedRows = $ SESSION1. TgtFailedRows &lt;br /&gt;
&lt;br /&gt;
SESSION2 &lt;br /&gt;
&lt;br /&gt;
This session is used to load the session statistics into a database table. &lt;br /&gt;
=&amp;gt; This should call a mapping say ‘m_sessionLog’ &lt;br /&gt;
=&amp;gt; This mapping m_sessionLog should have mapping variables for the above
defined workflow variables such as $$wfname, $$Stime, $$Etime, $$TSRows and
$$TFRows. &lt;br /&gt;
=&amp;gt; This mapping m_sessionLog should use a dummy source and it must have a expression
transformation and a target =&amp;gt; database Audit table) &lt;br /&gt;
=&amp;gt; Inside the expression you must assign the mapping variables to the output
ports &lt;br /&gt;
workflowname=$$wfname &lt;br /&gt;
starttime=$$Stime &lt;br /&gt;
endtime=$$Etime &lt;br /&gt;
SucessRows=$$TSRows &lt;br /&gt;
FailedRows=$$TFRows &lt;br /&gt;
=&amp;gt; Create a target database table with the following columns &lt;br /&gt;
Workflowname, start time, end time, success rows and failed rows. &lt;br /&gt;
=&amp;gt; Connect all the required output ports to the target which is nothing but
your audit table. &lt;br /&gt;
PRE-Session Variable &lt;br /&gt;
=&amp;gt; Session 2: In the Pre-session variable assignment tab assign the mapping
variable = workflow variable &lt;br /&gt;
=&amp;gt; In our case &lt;br /&gt;
$$wfname=$$workflowname &lt;br /&gt;
$$Stime=$$sessionStartTime &lt;br /&gt;
$$Etime=$$sessionEndTime &lt;br /&gt;
$$TSRows=$$TargetSuccessrows &lt;br /&gt;
$$TFRows=$$TargetFailedrows &lt;br /&gt;
&lt;br /&gt;
Workflow Execution&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/4606902392236233738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2012/02/load-session-statistics-such-as-session.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4606902392236233738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4606902392236233738'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2012/02/load-session-statistics-such-as-session.html' title='Load the session statistics such as Session Start &amp; End Time, Success Rows, Failed Rows and Rejected Rows etc. into a database table for audit/log purpose.'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-4935619575341139959</id><published>2011-12-30T13:34:00.001+05:30</published><updated>2012-01-18T17:26:17.990+05:30</updated><title type='text'>Use Target File Path in Parameter File</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario: &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;padding: 0in;&quot; valign=&quot;top&quot;&gt;&lt;/td&gt;&lt;td style=&quot;padding: 0in;&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;I want to use mapping parameter to store target file
path. My question is can define file path in parameter file? If possible can
anyone explain how to assign target file path as parameter?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;You can define the file path in
parameter file. &lt;br /&gt;
&lt;br /&gt;
$OutputFileName=your file path here &lt;br /&gt;
&lt;br /&gt;
Give the above mentioned parameter in your parameter file.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/4935619575341139959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/use-target-file-path-in-parameter-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4935619575341139959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4935619575341139959'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/use-target-file-path-in-parameter-file.html' title='Use Target File Path in Parameter File'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-1705715546868604713</id><published>2011-12-27T14:56:00.003+05:30</published><updated>2011-12-30T18:56:06.798+05:30</updated><title type='text'>Insert and reject records using update strategy.</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h2&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt; font-weight: normal;&quot;&gt;Insert and reject records using update strategy.&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt; font-weight: normal;&quot;&gt;There is an emp table and from that table insert&amp;nbsp;the
data to targt where sal&amp;lt;3000 and reject other rows.&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;1.&amp;nbsp; connect
out-puts from SQF to Update Strategy transformation.&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;2.&amp;nbsp; In
properties of&amp;nbsp; Update Strategy write the condition like this&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
IIF(SAL&amp;lt;3000,DD_INSERT,DD_REJECT)&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;3. Connectthe Update Strategy to target&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/1705715546868604713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/insert-and-reject-records-using-update.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1705715546868604713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1705715546868604713'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/insert-and-reject-records-using-update.html' title='Insert and reject records using update strategy.'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-1709350175387365699</id><published>2011-12-27T14:01:00.002+05:30</published><updated>2011-12-27T14:45:34.095+05:30</updated><title type='text'>Convert Numeric Value to Date Format</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Suppose
you are importing a flat file emp.csv and hire_date colummn is in numeric
format, like 20101111 .Our objective is convert it to date,with a format
&#39;YYYYMMDD&#39;.&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Source&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&amp;nbsp; EMPNO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
HIRE_DATE(numeric)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;
-----------&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
1&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;
20101111&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
2&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;
20090909&lt;br /&gt;
&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Target&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
EMPNO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
HIRE_DATE (date)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
-----------&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
1&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;
11/11/2010&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
2&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;
09/09/2009&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Connect
     SQF to an expression.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;In
     expression make hire_date as input only and make another port hire_date1
     as o/p port with date data type.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;In
     o/p port of hire_date write condition like as below&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TO_DATE(TO_CHAR(hire_date),’YYYYMMDD’)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/1709350175387365699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/convert-numeric-value-to-date-format.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1709350175387365699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1709350175387365699'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/convert-numeric-value-to-date-format.html' title='Convert Numeric Value to Date Format'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-6091053500467902522</id><published>2011-12-26T17:05:00.002+05:30</published><updated>2011-12-26T17:05:20.285+05:30</updated><title type='text'>How to change a string to decimal with 2 decimal places in informatica?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How to change a string to decimal with 2 decimal
places in informatica? &lt;br /&gt;
&lt;br /&gt;
Eg:: input data 12345678 &lt;br /&gt;
&lt;br /&gt;
I want output as 123456.78&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;output = to_decimal(to_integer(input)/100,2)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;OR&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;SUBSTR(INPUT_FIELD, 1, LENGTH(INPUT_FIELD) - 2) ||
&#39;.&#39; || SUBSTR(INPUT_FIELD, -2)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/6091053500467902522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-change-string-to-decimal-with-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6091053500467902522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6091053500467902522'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-change-string-to-decimal-with-2.html' title='How to change a string to decimal with 2 decimal places in informatica?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-4031659171879824463</id><published>2011-12-26T16:54:00.001+05:30</published><updated>2011-12-26T16:54:20.699+05:30</updated><title type='text'>Append the data in a flat file for a daily run</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;I have the flat file in our server location; I want
to append the data in a flat file for a daily run.&lt;/span&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
We have an option in Informatica &quot;Append if exists&quot; in target session
properties.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/4031659171879824463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/append-data-in-flat-file-for-daily-run.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4031659171879824463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4031659171879824463'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/append-data-in-flat-file-for-daily-run.html' title='Append the data in a flat file for a daily run'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-924458533898080973</id><published>2011-12-22T18:14:00.002+05:30</published><updated>2011-12-22T18:14:25.246+05:30</updated><title type='text'>Convert Day No. to corresponding month and date of year</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h2&gt;

&lt;span style=&quot;font-family: Cambria; font-size: 11pt; font-weight: normal;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Suppose
you have a source is like this&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Source&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&amp;nbsp; E_NO&amp;nbsp;&amp;nbsp;&amp;nbsp; YEAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
DAYNO&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ------&amp;nbsp;&amp;nbsp; --------- - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
---------&lt;br /&gt;
&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
01-JAN-07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 301&lt;br /&gt;
&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
01-JAN-08&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&lt;br /&gt;
Year column&amp;nbsp; is a&amp;nbsp; date and dayno is numeric that represents a day (
as in 365 for 31-Dec-Year). Convert the Dayno to corresponding year&#39;s month and
date and then send to target.&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Target &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&amp;nbsp; E_NO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
YEAR_MONTH_DAY&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;&amp;nbsp;
--------- ----------&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
1&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; 29-OCT-07&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
2&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;
19-JUL-08&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Use below date format in exp transformation &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Add_to_date(YEAR,’DD’,DAYNO)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/924458533898080973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/convert-day-no-to-corresponding-month.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/924458533898080973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/924458533898080973'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/convert-day-no-to-corresponding-month.html' title='Convert Day No. to corresponding month and date of year'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-6788068602119536524</id><published>2011-12-22T17:38:00.001+05:30</published><updated>2011-12-22T17:38:30.834+05:30</updated><title type='text'>How to delete duplicate rows in a table?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How to delete duplicate rows in a table?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;delete from emp a where rowid != (select max(rowid) from
emp b where&amp;nbsp; a.empno=b.empno);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;OR&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;delete from emp a where rowid != (select min(rowid) from
emp b where&amp;nbsp; a.empno=b.empno);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/6788068602119536524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-delete-duplicate-rows-in-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6788068602119536524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6788068602119536524'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-delete-duplicate-rows-in-table.html' title='How to delete duplicate rows in a table?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-6061725563521047779</id><published>2011-12-22T17:37:00.002+05:30</published><updated>2011-12-22T17:37:16.887+05:30</updated><title type='text'>How to get nth max salaries ?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How to
get nth max salaries ?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
select distinct hiredate from emp a where &amp;amp;n =&amp;nbsp; (select count(distinct
sal) from emp b where a.sal &amp;gt;= b.sal);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/6061725563521047779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-get-nth-max-salaries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6061725563521047779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6061725563521047779'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-get-nth-max-salaries.html' title='How to get nth max salaries ?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-5055741366241183734</id><published>2011-12-22T17:35:00.001+05:30</published><updated>2011-12-22T17:35:01.616+05:30</updated><title type='text'>How to get 3 Max &amp; Min salaries?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How to get 3 Max &amp;amp; Min salaries?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Max -&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select distinct sal from emp a where 3 &amp;gt;= (select
count(distinct sal) from emp b where a.sal &amp;lt;= b.sal) order by a.sal desc; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Min - select distinct sal from emp a&amp;nbsp; where 3 &amp;gt;=
(select count(distinct sal) from emp b&amp;nbsp; where a.sal &amp;gt;= b.sal);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/5055741366241183734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-get-3-max-min-salaries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5055741366241183734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5055741366241183734'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-to-get-3-max-min-salaries.html' title='How to get 3 Max &amp; Min salaries?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-1597032864745347945</id><published>2011-12-22T17:16:00.001+05:30</published><updated>2011-12-22T17:16:48.761+05:30</updated><title type='text'>Find FIRST &amp;  LAST n records from a table.</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Find FIRST &amp;amp;&amp;nbsp; LAST n records from a table.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;br /&gt;
First - select * from emp where rownum &amp;lt;= &amp;amp;n;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Last - select
* from emp minus select * from emp where rownum &amp;lt;= (select count(*) - &amp;amp;n
from emp);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/1597032864745347945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/select-first-last-n-records-from-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1597032864745347945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/1597032864745347945'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/select-first-last-n-records-from-table.html' title='Find FIRST &amp;  LAST n records from a table.'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-2571754595938581456</id><published>2011-12-22T17:13:00.002+05:30</published><updated>2011-12-22T17:13:43.102+05:30</updated><title type='text'>Find the 3rd MAX &amp; MIN salary in the emp table</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Find the
3rd MAX &amp;amp; MIN salary in the emp table&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Max -&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
distinct sal from emp e1 where 3 = &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;(select
count(distinct sal) from emp e2 where e1.sal &amp;lt;= e2.sal);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Min - &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
distinct sal from emp e1 where 3 = &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;(select
count(distinct sal) from emp e2 where e1.sal &amp;gt;= e2.sal);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/2571754595938581456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/find-3rd-max-min-salary-in-emp-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2571754595938581456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2571754595938581456'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/find-3rd-max-min-salary-in-emp-table.html' title='Find the 3rd MAX &amp; MIN salary in the emp table'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-2724587128762492598</id><published>2011-12-22T16:58:00.001+05:30</published><updated>2011-12-22T16:58:18.270+05:30</updated><title type='text'>Sql query to find EVEN &amp; ODD NUMBERED records from a table.</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Sql query to find EVEN
&amp;amp; ODD NUMBERED records from a table.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Even - select
* from emp where rowid in (select decode(mod(rownum,2),0,rowid,&amp;nbsp;null) from
emp);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Odd - select
* from emp where rowid in (select decode(mod(rownum,2),0,null ,rowid) from emp);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/2724587128762492598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/sql-query-to-find-even-odd-numbered.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2724587128762492598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/2724587128762492598'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/sql-query-to-find-even-odd-numbered.html' title='Sql query to find EVEN &amp; ODD NUMBERED records from a table.'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-6475375386423517750</id><published>2011-12-22T16:55:00.004+05:30</published><updated>2011-12-22T16:55:56.636+05:30</updated><title type='text'>SQL questions which are the most frequently asked in interviews.</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h2 align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Complex Queries in
SQL ( Oracle )&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;To fetch ALTERNATE records from a table.
(EVEN NUMBERED)&lt;/b&gt;&lt;br /&gt;
select * from emp where rowid in (select
decode(mod(rownum,2),0,rowid,&amp;nbsp;null) from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;To select ALTERNATE records from a table.
(ODD NUMBERED)&lt;/b&gt;&lt;br /&gt;
select * from emp where rowid in (select decode(mod(rownum,2),0,null ,rowid)
from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Find the 3rd MAX salary in the emp table.&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp
e2 where e1.sal &amp;lt;= e2.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Find the 3rd MIN salary in the emp table.&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp
e2where e1.sal &amp;gt;= e2.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select FIRST n records from a table.&lt;/b&gt;&lt;br /&gt;
select * from emp where rownum &amp;lt;= &amp;amp;n; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select LAST n records from a table&lt;/b&gt;&lt;br /&gt;
select * from emp minus select * from emp where rownum &amp;lt;= (select count(*) -
&amp;amp;n from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;List dept no., Dept name for all the
departments in which there are no employees in the department.&lt;/b&gt;&lt;br /&gt;
select * from dept where deptno not in (select deptno from emp);&amp;nbsp;&lt;br /&gt;
alternate solution:&amp;nbsp;&amp;nbsp;select * from dept a where&amp;nbsp;not exists
(select * from emp b where a.deptno = b.deptno);&lt;br /&gt;
altertnate solution:&amp;nbsp;&amp;nbsp;select empno,ename,b.deptno,dname from emp a,
dept b where a.deptno(+) = b.deptno and empno is null; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get 3 Max salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp a where 3 &amp;gt;= (select count(distinct sal) from
emp b where a.sal &amp;lt;= b.sal) order by a.sal desc; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get 3 Min salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp a&amp;nbsp; where 3 &amp;gt;= (select count(distinct sal)
from emp b&amp;nbsp; where a.sal &amp;gt;= b.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get nth max salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct hiredate from emp a where &amp;amp;n =&amp;nbsp; (select count(distinct
sal) from emp b where a.sal &amp;gt;= b.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select DISTINCT RECORDS from emp table.&lt;/b&gt;&lt;br /&gt;
select * from emp a where&amp;nbsp; rowid = (select max(rowid) from emp b
where&amp;nbsp; a.empno=b.empno); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to delete duplicate rows in a table?&lt;/b&gt;&lt;br /&gt;
delete from emp a where rowid != (select max(rowid) from emp b where&amp;nbsp;
a.empno=b.empno); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count of number of employees in&amp;nbsp;
department&amp;nbsp; wise.&lt;/b&gt;&lt;br /&gt;
select count(EMPNO), b.deptno, dname from emp a, dept b&amp;nbsp; where
a.deptno(+)=b.deptno&amp;nbsp; group by b.deptno,dname; &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&amp;nbsp;Suppose there is annual salary
information provided by emp table. How to fetch monthly salary of each and
every employee?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select ename,sal/12 as
monthlysal from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp table where
deptno =10 or 40.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
deptno=30 or deptno=10;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp table where
deptno=30 and sal&amp;gt;1500.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
deptno=30 and sal&amp;gt;1500;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; all record&amp;nbsp; from emp where
job not in SALESMAN&amp;nbsp; or CLERK.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
job not in (&#39;SALESMAN&#39;,&#39;CLERK&#39;);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp where ename in
&#39;BLAKE&#39;,&#39;SCOTT&#39;,&#39;KING&#39;and&#39;FORD&#39;.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename in(&#39;JONES&#39;,&#39;BLAKE&#39;,&#39;SCOTT&#39;,&#39;KING&#39;,&#39;FORD&#39;);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where ename starts with
‘S’ and its lenth is 6 char.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename like&#39;S____&#39;;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where ename may be any
no of&amp;nbsp; character but it should end with ‘R’.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename like&#39;%R&#39;;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count&amp;nbsp; MGR and their salary in emp
table.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
count(MGR),count(sal) from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;In emp table add comm+sal as total
sal&amp;nbsp; .&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
ename,(sal+nvl(comm,0)) as totalsal from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; any salary &amp;lt;3000 from emp
table.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp&amp;nbsp;
where sal&amp;gt; any(select sal from emp where sal&amp;lt;3000);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; all salary &amp;lt;3000 from emp
table.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp&amp;nbsp;
where sal&amp;gt; all(select sal from emp where sal&amp;lt;3000);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all the employee&amp;nbsp; group by
deptno and sal in descending order.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select ename,deptno,sal
from emp order by deptno,sal desc;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How can I create an empty table emp1 with
same structure as emp?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Create table emp1 as
select * from emp where 1=2;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to retrive record where sal between
1000 to 2000?&lt;/b&gt;&lt;br /&gt;
Select * from emp where sal&amp;gt;=1000 And&amp;nbsp; sal&amp;lt;2000&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where dept no of both
emp and dept table matches.&lt;/b&gt;&lt;br /&gt;
select * from emp where exists(select * from dept where emp.deptno=dept.deptno)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;If there are two tables emp1 and emp2, and
both have common record. How can I fetch all the recods but common records only
once?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Union (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to fetch only common records from two
tables emp and emp1?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Intersect (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&amp;nbsp;How can I retrive all records of emp1
those should not present in emp2?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Minus (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count the totalsa&amp;nbsp; deptno wise where
more than 2 employees exist.&lt;/b&gt;&lt;br /&gt;
SELECT&amp;nbsp; deptno, sum(sal) As totalsal&lt;br /&gt;
FROM emp&lt;br /&gt;
GROUP BY deptno&lt;br /&gt;
HAVING COUNT(empno) &amp;gt; 2&lt;/span&gt;&lt;br /&gt;


&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/6475375386423517750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/sql-questions-which-are-most-frequently.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6475375386423517750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/6475375386423517750'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/sql-questions-which-are-most-frequently.html' title='SQL questions which are the most frequently asked in interviews.'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-7521711235287517842</id><published>2011-12-22T16:55:00.001+05:30</published><updated>2011-12-22T16:55:19.148+05:30</updated><title type='text'>Complex Queries in SQL ( Oracle )</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h2 align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Complex Queries in
SQL ( Oracle )&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;To fetch ALTERNATE records from a table.
(EVEN NUMBERED)&lt;/b&gt;&lt;br /&gt;
select * from emp where rowid in (select
decode(mod(rownum,2),0,rowid,&amp;nbsp;null) from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;To select ALTERNATE records from a table.
(ODD NUMBERED)&lt;/b&gt;&lt;br /&gt;
select * from emp where rowid in (select decode(mod(rownum,2),0,null ,rowid)
from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Find the 3rd MAX salary in the emp table.&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp
e2 where e1.sal &amp;lt;= e2.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Find the 3rd MIN salary in the emp table.&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp
e2where e1.sal &amp;gt;= e2.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select FIRST n records from a table.&lt;/b&gt;&lt;br /&gt;
select * from emp where rownum &amp;lt;= &amp;amp;n; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select LAST n records from a table&lt;/b&gt;&lt;br /&gt;
select * from emp minus select * from emp where rownum &amp;lt;= (select count(*) -
&amp;amp;n from emp); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;List dept no., Dept name for all the
departments in which there are no employees in the department.&lt;/b&gt;&lt;br /&gt;
select * from dept where deptno not in (select deptno from emp);&amp;nbsp;&lt;br /&gt;
alternate solution:&amp;nbsp;&amp;nbsp;select * from dept a where&amp;nbsp;not exists
(select * from emp b where a.deptno = b.deptno);&lt;br /&gt;
altertnate solution:&amp;nbsp;&amp;nbsp;select empno,ename,b.deptno,dname from emp a,
dept b where a.deptno(+) = b.deptno and empno is null; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get 3 Max salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp a where 3 &amp;gt;= (select count(distinct sal) from
emp b where a.sal &amp;lt;= b.sal) order by a.sal desc; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get 3 Min salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct sal from emp a&amp;nbsp; where 3 &amp;gt;= (select count(distinct sal)
from emp b&amp;nbsp; where a.sal &amp;gt;= b.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to get nth max salaries ?&lt;/b&gt;&lt;br /&gt;
select distinct hiredate from emp a where &amp;amp;n =&amp;nbsp; (select count(distinct
sal) from emp b where a.sal &amp;gt;= b.sal); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select DISTINCT RECORDS from emp table.&lt;/b&gt;&lt;br /&gt;
select * from emp a where&amp;nbsp; rowid = (select max(rowid) from emp b
where&amp;nbsp; a.empno=b.empno); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to delete duplicate rows in a table?&lt;/b&gt;&lt;br /&gt;
delete from emp a where rowid != (select max(rowid) from emp b where&amp;nbsp;
a.empno=b.empno); &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count of number of employees in&amp;nbsp;
department&amp;nbsp; wise.&lt;/b&gt;&lt;br /&gt;
select count(EMPNO), b.deptno, dname from emp a, dept b&amp;nbsp; where
a.deptno(+)=b.deptno&amp;nbsp; group by b.deptno,dname; &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&amp;nbsp;Suppose there is annual salary
information provided by emp table. How to fetch monthly salary of each and
every employee?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select ename,sal/12 as
monthlysal from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp table where
deptno =10 or 40.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
deptno=30 or deptno=10;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp table where
deptno=30 and sal&amp;gt;1500.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
deptno=30 and sal&amp;gt;1500;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; all record&amp;nbsp; from emp where
job not in SALESMAN&amp;nbsp; or CLERK.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
job not in (&#39;SALESMAN&#39;,&#39;CLERK&#39;);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all record from emp where ename in
&#39;BLAKE&#39;,&#39;SCOTT&#39;,&#39;KING&#39;and&#39;FORD&#39;.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename in(&#39;JONES&#39;,&#39;BLAKE&#39;,&#39;SCOTT&#39;,&#39;KING&#39;,&#39;FORD&#39;);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where ename starts with
‘S’ and its lenth is 6 char.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename like&#39;S____&#39;;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where ename may be any
no of&amp;nbsp; character but it should end with ‘R’.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp where
ename like&#39;%R&#39;;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count&amp;nbsp; MGR and their salary in emp
table.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
count(MGR),count(sal) from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;In emp table add comm+sal as total
sal&amp;nbsp; .&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select
ename,(sal+nvl(comm,0)) as totalsal from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; any salary &amp;lt;3000 from emp
table.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp&amp;nbsp;
where sal&amp;gt; any(select sal from emp where sal&amp;lt;3000);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select&amp;nbsp; all salary &amp;lt;3000 from emp
table.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select * from emp&amp;nbsp;
where sal&amp;gt; all(select sal from emp where sal&amp;lt;3000);&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all the employee&amp;nbsp; group by
deptno and sal in descending order.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select ename,deptno,sal
from emp order by deptno,sal desc;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How can I create an empty table emp1 with
same structure as emp?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Create table emp1 as
select * from emp where 1=2;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to retrive record where sal between
1000 to 2000?&lt;/b&gt;&lt;br /&gt;
Select * from emp where sal&amp;gt;=1000 And&amp;nbsp; sal&amp;lt;2000&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Select all records where dept no of both
emp and dept table matches.&lt;/b&gt;&lt;br /&gt;
select * from emp where exists(select * from dept where emp.deptno=dept.deptno)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;If there are two tables emp1 and emp2, and
both have common record. How can I fetch all the recods but common records only
once?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Union (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;How to fetch only common records from two
tables emp and emp1?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Intersect (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&amp;nbsp;How can I retrive all records of emp1
those should not present in emp2?&lt;/b&gt;&lt;br /&gt;
(Select * from emp) Minus (Select * from emp1)&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Count the totalsa&amp;nbsp; deptno wise where
more than 2 employees exist.&lt;/b&gt;&lt;br /&gt;
SELECT&amp;nbsp; deptno, sum(sal) As totalsal&lt;br /&gt;
FROM emp&lt;br /&gt;
GROUP BY deptno&lt;br /&gt;
HAVING COUNT(empno) &amp;gt; 2&lt;/span&gt;&lt;br /&gt;


&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/7521711235287517842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/complex-queries-in-sql-oracle.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7521711235287517842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7521711235287517842'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/complex-queries-in-sql-oracle.html' title='Complex Queries in SQL ( Oracle )'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-4975609510427639684</id><published>2011-12-22T16:48:00.002+05:30</published><updated>2011-12-22T16:48:35.285+05:30</updated><title type='text'>Informatica Quiz: Set 2</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;http://img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt;
&lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Quiz: Informatica Set 2&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
A lookup transformation is used to look up data in&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;flat file&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Relational table&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;view&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;synonyms&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;All of the above&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which value returned by NewLookupRow port says that Integration Service does
not update or insert the row in the cache?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;3&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;2&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;1&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;0&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one need a common key to join?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;source qualifier&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;joiner&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;look up&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one support hetrogeneous join?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;source qualifier&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;joiner&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;look up&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What is the use of target loader?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Target load order is first
     the data is load in dimension table and then fact table. &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Target load order is first
     the data is load in fact table and then dimensional table.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Load the data from different
     target at same time.&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one is not tracing level?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;terse&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;verbose&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;initialization&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;verbose initialization&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;terse initialization&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which output file is not created during&amp;nbsp; session running?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Session log&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;workflow log&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Error log&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Bad files&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;cache files&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Is Fact table is normalised ?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;yes&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;no&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which value returned by NewLookupRow port says that Integration Service
inserts the row into the cache?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;0&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;1&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;2&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;3&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which transformation only works on relational source?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;lookup&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Union&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;joiner&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Sql&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which are&amp;nbsp; both connected and unconnected?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;External Store Procedure&lt;span class=&quot;li-highlight-orange&quot;&gt; (omitted)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Stote Procedure&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Lookup&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Advanced External Procedure
     Transformation&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Can we generate alpha-numeric value in sequence generator?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;yes&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;no&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which transformation is used by cobol source?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Advanced External Procedure
     Transformation&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Cobol Transformation&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Unstructured Data
     Transformation&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Normalizer&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What is VSAM normalizer transformation?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a COBOL source
     definition.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a flat file
     source definition.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a xml source
     definition.&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Non of these&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What is VSAM normalizer transformation?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a COBOL source
     definition.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a flat file
     source definition.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;The VSAM normalizer
     transformation is the source qualifier transformation for a xml source
     definition.&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Non of these&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/4975609510427639684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/informatica-quiz-set-2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4975609510427639684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4975609510427639684'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/informatica-quiz-set-2.html' title='Informatica Quiz: Set 2'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-5725034223985839574</id><published>2011-12-22T16:41:00.003+05:30</published><updated>2011-12-22T16:41:35.809+05:30</updated><title type='text'>Informatica Quiz: Set 1</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Quiz: Informatica Set 1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
Which one is not correct about filter transformation?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;Filter
generally parses single condition. For multiple condition we can use router&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Act as a &#39;where&#39; condition&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Can&#39;t passes multiple
     conditions&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Act like &#39;Case&#39; in pl/sql&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;If one record does not match
     condition, the record is blocked &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Can we calculate in aggrigator ?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;No&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Yes&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one is not a type of&amp;nbsp; fact?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Semi-aditive&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Additive&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Confirm fact&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Not additive&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp;Which one is not a type of dimension ?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Conformed dimension&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Rapidly changing dimension&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Junk dimension&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Degenerated dimension &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which of these not correct about Code Page?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;A code page contains encoding
     to specify characters in a set of one or more languages&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;A code page contains decoding
     to specify characters in a set of one or more languages&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;In this way application
     stores, receives, and sends character data.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Non of these&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What is a mapplet?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Combination of reusable
     transformation.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Combination of reusable
     mapping&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Set of transformations and
     it allows us to reuse&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Non of these&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What does reusable transformation mean?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;It can be re-used across
     repositories&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;I can only be used in
     mapplet.&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;It can use in multiple
     mapping only once&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;It can use in multiple
     mapping multiple times&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one is not an option in update strategy?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;dd_reject&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;4&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;2&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;dd_delete&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Can we update records without using update strategy?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Yes&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;No&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
How to select distinct records form Source Qualifier?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Choose &#39;non duplicate&#39;
     option&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Choose &#39;select distinct&#39;
     option&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Choose &#39;Select non
     duplicate&#39;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
What type of repository is no available in Informatica Repository Manager?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Standalone Repository&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Local Repository&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;User Defined&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Versioned Repository&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Manual Repository &lt;span class=&quot;li-highlight-red&quot;&gt;(wrong)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Joiner does not support flat file.&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;False&lt;span class=&quot;li-highlight-green&quot;&gt; (correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;True&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
How to execute PL/SQL script from Informatica mapping?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Lookup &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Store Procdure &lt;span class=&quot;li-highlight-green&quot;&gt;(correct)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Expression &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Non of these &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
NetSal= bassic+hra. In which transformation we can achive this?&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Aggrigator&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Lookup &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Filter&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Expression &lt;span class=&quot;li-highlight-green&quot;&gt;(correct)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Which one is not an active transformation?&lt;br /&gt;
&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;
&lt;strong&gt;Explanation: &lt;/strong&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Sequence generator&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Normalizer&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Sql&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Store Procedure&lt;span class=&quot;li-highlight-red&quot;&gt; (wrong)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/5725034223985839574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/informatica-quiz-set-1.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5725034223985839574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5725034223985839574'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/informatica-quiz-set-1.html' title='Informatica Quiz: Set 1'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-4939117704525949813</id><published>2011-12-22T16:16:00.000+05:30</published><updated>2011-12-22T16:16:08.177+05:30</updated><title type='text'>How large is the database,used and free space?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How large
is the database,used and free space?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;select&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;round(sum(used.bytes) / 1024 / 1024 / 1024 )
|| &#39; GB&#39; &quot;Database Size&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;round(sum(used.bytes) / 1024 /
1024 / 1024 ) - &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;round(free.p / 1024 / 1024 /
1024) || &#39; GB&#39; &quot;Used space&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;round(free.p / 1024 / 1024 /
1024) || &#39; GB&#39; &quot;Free space&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;from&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(select&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bytes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;from&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v$datafile&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;union&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;all&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;select&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bytes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;from &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v$tempfile&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;union &lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;all&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;select &lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;bytes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;from &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;v$log) used&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(select sum(bytes) as p&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;from dba_free_space) free&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;group by
free.p&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/4939117704525949813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-large-is-databaseused-and-free.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4939117704525949813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/4939117704525949813'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-large-is-databaseused-and-free.html' title='How large is the database,used and free space?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-7305916123603399235</id><published>2011-12-20T15:39:00.002+05:30</published><updated>2011-12-20T15:39:53.890+05:30</updated><title type='text'>Batch File to Append Date to file name</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Batch File to Append Date
to file name&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;@echo off&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;REM&amp;nbsp;Create a log
file with the current date and time in the filename&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;REM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
the ~4 in the Date skips the first four characters of the echoed date stamp and
writes the remainder and so on&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;set
LOG_FILE_NAME=Example_File_Name.%date:~4,2%%date:~7,2%%date:~10,4%.%time:~0,2%%time:~3,2%%time:~6,2%.txt&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;Echo This is much easier
in UNIX &amp;gt; c: emp\%LOG_FILE_NAME%&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;:exit&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;OR&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;@echo off&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;for /F &quot;tokens=2,3,4
delims=/ &quot; %%i in (&#39;date/t&#39;) do set y=%%k&lt;br /&gt;
for /F &quot;tokens=2,3,4 delims=/ &quot; %%i in (&#39;date/t&#39;) do set d=%%k%%i%%j&lt;br /&gt;
for /F &quot;tokens=5-8 delims=:. &quot; %%i in (&#39;echo.^| time ^| find
&quot;current&quot; &#39;) do set t=%%i%%j&lt;br /&gt;
set t=%t%_&lt;br /&gt;
if &quot;%t:~3,1%&quot;==&quot;_&quot; set t=0%t%&lt;br /&gt;
set t=%t:~0,4%&lt;br /&gt;
set &quot;theFilename=%d%%t%&quot;&lt;br /&gt;
echo %theFilename%&lt;/span&gt;&lt;br /&gt;


&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/7305916123603399235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/batch-file-to-append-date-to-file-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7305916123603399235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/7305916123603399235'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/batch-file-to-append-date-to-file-name.html' title='Batch File to Append Date to file name'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-5214602828704989731</id><published>2011-12-19T19:52:00.004+05:30</published><updated>2011-12-19T19:52:44.760+05:30</updated><title type='text'>PL/SQL Interview Questions</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;img src=&quot;http://img2.blogblog.com/img/video_object.png&quot; style=&quot;background-color: #b2b2b2; &quot; class=&quot;BLOGGER-object-element tr_noresize tr_placeholder&quot; id=&quot;ieooui&quot; data-original-id=&quot;ieooui&quot; /&gt;
&lt;style&gt;
st1\:*{behavior:url(#ieooui) }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;1.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4635&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;What is PL/SQL ?&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 10.95pt;&quot;&gt;
  &lt;td style=&quot;border: 1pt solid black; height: 10.95pt; padding: 1.5pt; width: 472.5pt;&quot; width=&quot;630&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PL/SQL
  is Oracle&#39;s Procedural Language extension to SQL. PL/SQL&#39;s language syntax,
  structure and datatypes are similar to that of ADA. The language includes object oriented
  programming techniques such as encapsulation, function overloading,
  information hiding (all but inheritance), and so, brings state-of-the-art
  programming to the Oracle database server and a variety of Oracle tools.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;PL SQL is
  a block structured programming language. It combines data manipulation &amp;amp;
  data processing power. It supports all SQL data types. Also has its own data
  types i,e BOOLEAN,BINARY INTEGER&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  
  &lt;td height=&quot;15&quot; style=&quot;border: medium none; height: 10.95pt;&quot; width=&quot;0&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;2.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4636&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is the basic structure of PL/SQL ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A&amp;nbsp;PL&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;/SQL block has three parts: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;a declarative part,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;an executable part,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;and an exception-handling part.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;First comes the declarative part,
in which items can&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;be declared. Once declared, items
can be manipulated in the executable part.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Exceptions raised during
execution can be dealt with in the exception-handling&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;part.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;3.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4637&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the components of a PL/SQL block ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;PL/SQL Block contains :&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Declare&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; : optional&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Variable declaration&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Begin&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&amp;nbsp; : Manadatory&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Procedural statements.&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Exception&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; : Optional&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;any errors to be trapped&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;End &lt;/span&gt;&lt;/strong&gt;&lt;span&gt;:&amp;nbsp; Mandatory&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;5.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4639&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the datatypes a available in PL/SQL ?&lt;/span&gt;&lt;/a&gt;&lt;strong&gt;&lt;span style=&quot;color: #330099; font-family: Calibri;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;color: #330099; font-family: Calibri;&quot;&gt;Following are the datatype supported in oracle PLSQL&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;color: #330099; font-family: Calibri;&quot;&gt;Scalar Types&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;


&lt;span&gt;BINARY_INTEGER&lt;br /&gt;
DEC&lt;br /&gt;
DECIMAL&lt;br /&gt;
DOUBLE PRECISION&lt;br /&gt;
FLOAT&lt;br /&gt;
INT&lt;br /&gt;
INTEGER&lt;br /&gt;
NATURAL&lt;br /&gt;
NATURALN&lt;br /&gt;
NUMBER&lt;br /&gt;
NUMERIC&lt;br /&gt;
PLS_INTEGER&lt;br /&gt;
POSITIVE&lt;br /&gt;
POSITIVEN&lt;br /&gt;
REAL&lt;br /&gt;
SIGNTYPE&lt;br /&gt;
SMALLINT&lt;br /&gt;
CHAR&lt;br /&gt;
CHARACTER&lt;br /&gt;
LONG&lt;br /&gt;
LONG RAW&lt;br /&gt;
NCHAR&lt;br /&gt;
NVARCHAR2&lt;br /&gt;
RAW&lt;br /&gt;
ROWID&lt;br /&gt;
STRING&lt;br /&gt;
UROWID&lt;br /&gt;
VARCHAR&lt;br /&gt;
VARCHAR2&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;DATE&lt;br /&gt;
INTERVAL DAY TO SECOND&lt;br /&gt;
INTERVAL YEAR TO MONTH&lt;br /&gt;
TIMESTAMP&lt;br /&gt;
TIMESTAMP WITH LOCAL TIME ZONE&lt;br /&gt;
TIMESTAMP WITH TIME ZONE&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;BOOLEAN&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Composite
Types&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span&gt;RECORD&lt;br /&gt;
TABLE&lt;br /&gt;
VARRAY&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;LOB
Types&lt;/span&gt;&lt;/strong&gt;&lt;b&gt;&lt;span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span&gt;BFILE&lt;br /&gt;
BLOB&lt;br /&gt;
CLOB&lt;br /&gt;
NCLOB&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Reference
Types&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
REF CURSOR&lt;br /&gt;
REF object_type&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;




&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;6.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4640&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What&amp;nbsp; are % TYPE and % ROWTYPE ? What are the advantages of using
these over datatypes?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;%&amp;nbsp; TYPE&amp;nbsp; provides&amp;nbsp; the data type of
a variable or a database column to that variable.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;% ROWTYPE&amp;nbsp; provides the record type that
represents a entire row of a table or view or columns selected in the cursor.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;The advantages are : &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;I. Need not&amp;nbsp; know about variable&#39;s data type&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;ii.&amp;nbsp; If&amp;nbsp; the&amp;nbsp; database&amp;nbsp;
definition of a column in a table changes, the data type of a variable changes
accordingly.&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;Advantage is, if one change the
type or size of the column in the table, it will be reflected in our program
unit without making any change.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;%type is used to refer the column&#39;s
datatype&amp;nbsp; where as %rowtype is used to refer the whole record in a table.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;7.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4641&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is difference between % ROWTYPE and TYPE RECORD ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;%&amp;nbsp; ROWTYPE&amp;nbsp; is to be used whenever query
returns a entire row of a table or view.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;TYPE&amp;nbsp; rec&amp;nbsp; RECORD is to be used whenever
query returns columns of different table or views and
variables.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E.g. &amp;nbsp;TYPE&amp;nbsp; r_emp is RECORD
(eno emp.empno% type,ename emp ename %type);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rec emp%
ROWTYPE&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor c1 is select empno,deptno from
emp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e_rec c1 %ROWTYPE.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;8.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4642&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What is
PL/SQL table ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A PL/SQL table is a one-dimensional, unbounded, sparse collection of
homogenous elements, indexed by integers&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;One-dimensional&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;AUTOID-8632&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A PL&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;/SQL table can have only one column. It is, in this
way, similar to a one-dimensional array. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Unbounded
or Unconstrained&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;There is no predefined limit to the number of rows in a PL/SQL table.
The PL/SQL table grows dynamically as you add more rows to the table. The
PL/SQL table is, in this way, very different from an array. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Related to this definition, no rows for PL/SQL tables are allocated for
this structure when it is defined. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Sparse&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;AUTOID-8647&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;In a PL/SQL table, a row exists in the table only
when a value is assigned to that row. Rows do not have to be defined
sequentially. Instead you can assign a value to any row in the table. So row 15
could have a value of `Fox&#39; and row 15446 a value of `Red&#39;, with no other rows
defined in between. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Homogeneous
elements&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;AUTOID-8656&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Because a PL/SQL table can have only a single
column, all rows in a PL/SQL table contain values of the same datatype. It is,
therefore, homogeneous. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With PL/SQL Release 2.3, you can have PL/SQL tables of records. The
resulting table is still, however, homogeneous. Each row simply contains the
same set of columns. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Indexed
by integers&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;AUTOID-8664&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PL/SQL tables currently support a single indexing
mode: by BINARY_INTEGER. This number acts as the &quot;primary key&quot; of the
PL/SQL table. The range of a BINARY_INTEGER is from -2&lt;sup&gt;31&lt;/sup&gt;-1 to 2&lt;sup&gt;31&lt;/sup&gt;-1,
so you have an awful lot of rows with which to work&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;9.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4643&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What is a
cursor ? Why Cursor is required ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Cursor is a named private SQL area from where
information can be accessed. Cursors&amp;nbsp; are&amp;nbsp; required&amp;nbsp; to&amp;nbsp; process
rows individually for queries returning multiple rows.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;10.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4644&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;Explain the
two type of Cursors ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;implicit cursor: implicit cursor is
a type of cursor which is automatically maintained by the Oracle server
itself.implicit cursor returns only one row.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Explicit Cursor: Explicit Cursor is
defined by the Proframmer,and it has for phases:declare,open,fetch and
close.explicit Cursor returns more than one row.&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;11.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4645&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What are the
PL/SQL Statements used in cursor processing ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;DECLARE&amp;nbsp; CURSOR&amp;nbsp; cursor&amp;nbsp; name,&amp;nbsp;
OPEN&amp;nbsp; cursor&amp;nbsp; name,&amp;nbsp; FETCH cursor name INTO&amp;nbsp; or Record
types, CLOSE cursor name.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;12.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4646&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What are the
cursor attributes used in PL/SQL ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;%ISOPEN&amp;nbsp; - to check whether cursor is open or
not&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;% ROWCOUNT -
number of rows fetched/updated/deleted.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; %&amp;nbsp; FOUND - to check whether
cursor has fetched any row. True if rows are fetched.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; % NOT FOUND - to check
whether cursor has fetched any row. True if no rows are featched.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;These&amp;nbsp; attributes are proceeded with SQL for
Implicit Cursors and with Cursor name for Explicit Cursors&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;13.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4647&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What is a
cursor for loop ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Cursor&amp;nbsp; for loop implicitly declares %ROWTYPE
as loop index,opens a cursor, fetches rows of values from active set into
fields in the record and closes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;when all the records have been processed.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;eg. FOR
emp_rec IN C1 LOOP&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;salary_total := salary_total +emp_rec sal;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
END LOOP;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;cursor for loop is use for automatically
open ,fetch,close&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;15.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4649&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Explain the usage of&amp;nbsp; WHERE CURRENT OF clause in cursors ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;ch06-idx-104772-3&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;AUTOID-5900&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;AUTOID-5897&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PL/SQL provides the WHERE CURRENT OF clause for both UPDATE and DELETE
statements inside a cursor in order to allow you to easily make changes to the
most recently fetched row of data. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The general format for the WHERE CURRENT OF clause is as follows:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;UPDATE
table_name&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SET set_clause WHERE CURRENT
OF cursor_name;DELETE&lt;span&gt;&amp;nbsp; &lt;/span&gt;FROM table_name
WHERE CURRENT OF cursor_name;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Notice that the WHERE CURRENT OF clause references the cursor and not
the record into which the next fetched row is deposited. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The most important advantage to using WHERE CURRENT OF where you need to
change the row fetched last is that you do not have to code in two (or more)
places the criteria used to uniquely identify a row in a table. Without WHERE
CURRENT OF, you would need to repeat the WHERE clause of your cursor in the
WHERE clause of the associated UPDATEs and DELETEs. As a result, if the table
structure changes in a way that affects the construction of the primary key,
you have to make sure that each SQL statement is upgraded to support this
change. If you use WHERE CURRENT OF, on the other hand, you only have to modify
the WHERE clause of the SELECT statement. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;This might seem like a relatively minor issue, but it is one of many
areas in your code where you can leverage subtle features in PL/SQL to minimize
code redundancies. Utilization of WHERE CURRENT OF, %TYPE, and %ROWTYPE
declaration attributes, cursor FOR loops, local modularization, and other
PL/SQL language constructs can have a big impact on reducing the pain you may
experience when you maintain your Oracle-based applications. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Let&#39;s see how this clause would improve the previous example. In the
jobs cursor FOR loop above, I want to UPDATE the record that was currently
FETCHed by the cursor. I do this in the UPDATE statement by repeating the same
WHERE used in the cursor because (task, year) makes up the primary key of this
table: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;WHERE
task = job_rec.task&lt;span&gt;&amp;nbsp; &lt;/span&gt;AND year = TO_CHAR
(SYSDATE, &#39;YYYY&#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;This is a less than ideal situation, as explained above: I have coded
the same logic in two places, and this code must be kept synchronized. It would
be so much more convenient and natural to be able to code the equivalent of the
following statements: &lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td style=&quot;height: 11.25pt; padding: 0.75pt; width: 130.35pt;&quot; width=&quot;174&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;Delete the record I just
  fetched.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;
  
  &lt;td height=&quot;15&quot; style=&quot;border: medium none; height: 11.25pt;&quot; width=&quot;0&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;or:&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td style=&quot;height: 11.25pt; padding: 0.75pt; width: 194.9pt;&quot; width=&quot;260&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;Update these columns in that
  row I just fetched.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;
  
  &lt;td height=&quot;15&quot; style=&quot;border: medium none; height: 11.25pt;&quot; width=&quot;0&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A perfect fit for WHERE CURRENT OF! The next version of my winterization
program below uses this clause. I have also switched to a simple loop from FOR
loop because I want to exit conditionally from the loop: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;DECLARE&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CURSOR fall_jobs_cur IS SELECT ... same as
before ... ;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;job_rec
fall_jobs_cur%ROWTYPE;BEGIN&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OPEN
fall_jobs_cur;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LOOP&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FETCH fall_jobs_cur INTO job_rec;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;IF fall_jobs_cur%NOTFOUND&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;THEN&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EXIT;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ELSIF job_rec.do_it_yourself_flag =
&#39;YOUCANDOIT&#39;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;THEN&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;UPDATE winterize SET responsible =
&#39;STEVEN&#39;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WHERE CURRENT OF
fall_jobs_cur;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;COMMIT;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;EXIT;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;END IF;&lt;span&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;END LOOP;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CLOSE
fall_jobs_cur;END;&lt;a href=&quot;&quot; name=&quot;AUTOID-5925&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;AUTOID-5924&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;AUTOID-5923&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;16.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4650&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is a database trigger ? Name some usages of database trigger ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;A database trigger is a &lt;/span&gt;&lt;a href=&quot;http://www.tech-faq.com/stored-procedure.shtml&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;stored
procedure&lt;/span&gt;&lt;/a&gt;&lt;span&gt; that is invoked
automatically when a predefined event occurs. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Database triggers enable DBA&#39;s
(Data Base Administrators) to create additional relationships between separate
databases.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;For example, the modification of a
record in one database could trigger the modification of a record in a second
database.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;17.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4651&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How many types of database triggers can be specified on a table ? What are
they ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 11.25pt;&quot;&gt;
  &lt;td style=&quot;height: 11.25pt; padding: 1.5pt; width: 472.5pt;&quot; width=&quot;630&quot;&gt;
  &lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;
  Insert&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Update&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delete&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Before&amp;nbsp; Row&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o.k.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;After Row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;o.k.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Before Statement&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o.k.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;After Statement&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  o.k.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; o.k.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;If FOR EACH ROW clause is specified, then the
  trigger for each Row affected by the statement.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;If&amp;nbsp; WHEN&amp;nbsp; clause&amp;nbsp; is specified,
  the trigger fires according to the returned Boolean value.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;the
  different types of triggers: * Row Triggers and Statement Triggers * BEFORE
  and AFTER Triggers * INSTEAD OF Triggers * Triggers on System Events and User
  Events&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;18.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4653&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;What are
  two virtual tables available during database trigger execution ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The table columns are referred as OLD.column_name
  and NEW.column_name.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;For triggers related to INSERT only
  NEW.column_name values only available.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;For&amp;nbsp; triggers related to UPDATE only
  OLD.column_name NEW.column_name values only available.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;For triggers related to DELETE only
  OLD.column_name values only available.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The
  two virtual table available are old and new.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;19.What
  happens if a procedure that updates a column of table X is called in a
  database trigger of the same table ?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  
  &lt;td height=&quot;15&quot; style=&quot;border: medium none; height: 11.25pt;&quot; width=&quot;0&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;&quot; name=&quot;top&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;To
avoid the mutation table error ,the procedure should be declared as an
AUTONOMOUS TRANSACTION.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;By this the procedure will be
treated as an separate identity.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;20.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4655&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Write&amp;nbsp; the&amp;nbsp; order&amp;nbsp; of precedence for validation of a column
in a table ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I.&amp;nbsp; done using Database triggers.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
ii. done using Integarity Constraints.&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;21.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4656&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is an Exception ? What are types of Exception ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: black; font-family: Symbol; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Symbol; font-size: 10pt;&quot;&gt;·&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 10pt;&quot;&gt;Predefined&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;Do not declare and allow the Oracle server to &lt;i&gt;raise implicitly&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;NO_DATA_FOUND&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;TOO_MANY_ROWS&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;INVALID_CURSOR&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;ZERO_DIVIDE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;INVALID_CURSOR&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;WHEN EXCEPTION THEN …&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in; text-indent: 0.75in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Symbol; font-size: 10pt;&quot;&gt;·&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 10pt;&quot;&gt;Non predefined&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&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;&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;Declare within the declarative section and allow allow Oracle server to &lt;i&gt;raise implicitly&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1.5in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;color: #ff6600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;color: #ff6600; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 10pt;&quot;&gt;SQLCODE&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt; – Returns the
numeric value for the seeor code&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1.5in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;color: #ff6600; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;o&lt;/span&gt;&lt;span style=&quot;color: #ff6600; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 10pt;&quot;&gt;SQLERRM&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt; – Returns the
message associated with error number&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 1.25in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;DECLARE -- PRAGMA EXCEPTION_INIT (exception,
error_number)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 1.25in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;RAISE – WHEN EXCEPTION_NAME THEN …&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Symbol; font-size: 10pt;&quot;&gt;·&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: black; font-family: Arial; font-size: 10pt;&quot;&gt;User defined&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Declare within the
declarative section and&lt;i&gt; raise explicitly.&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.75in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 2in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;IF confidition
the&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 2in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600; font-family: Arial; font-size: 10pt;&quot;&gt;RAISE EXCEPTION
or RAISE_APPLICATION_ERROR&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;22.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4657&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Pragma EXECPTION_INIT ? Explain the usage ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Pragma exception_init&amp;nbsp; Allow
you to handle the Oracle predefined message by you&#39;r own message. means you
can&amp;nbsp;instruct compiler to&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; line-height: 115%;&quot;&gt;associate&lt;/span&gt;&lt;span&gt;the specific message to oracle predefined message at compile time.This
way you Improve the Readbility of your program,and handle it accoding to your
own way.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;It should be&amp;nbsp;declare at the
DECLARE section.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;example&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;declare&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;salary number;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;FOUND_NOTHING exception;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Pragma exception_init(FOUND_NOTHING
,100);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;begin&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;select sal in to salaryfrom emp
where ename =&#39;ANURAG&#39;;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;dbms_output.put_line(salary);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;exception&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;WHEN FOUND_NOTHING THEN&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;dbms_output.put_line(SQLERRM);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end;&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;23.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4658&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Raise_application_error ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Raise_application_error is used to
create your own error messages which can be more descriptive than named
exceptions.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Syntax is:-&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Raise_application_error (error_number,error_messages);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;where error_number is between
-20000 to -20999..&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;24.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4659&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the return values of functions SQLCODE and SQLERRM ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Pl / Sql Provides Error Information
via two Built-in functions, SQLCODE &amp;amp; SQLERRM.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;SQLCODE Returns the Current Error
Code.&lt;/span&gt;&lt;br /&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;&amp;nbsp;&amp;nbsp;
Returns 1.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;SQLERRM&amp;nbsp; Returns the Current
Error Message Text.&lt;/span&gt;&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Returns&amp;nbsp; &quot; User Defined Exception&amp;nbsp; &quot;&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;25.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4660&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Where the Pre_defined_exceptions are stored ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;


PL/SQL declares predefined exceptions in the &lt;span style=&quot;font-family: Courier; font-size: 12pt; line-height: 115%;&quot;&gt;STANDARD &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;; font-size: 12pt; line-height: 115%;&quot;&gt;package.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;26.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4661&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is a stored procedure ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Stored Procedure is the PlSQL
subprgram stored in the databasse .&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt;Stored Procedure &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;
&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;program &lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt;running in the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;database&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; that can take
complex actions based on the inputs you send it. Using a stored&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;procedure&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; is faster than doing the same work on a client, because
the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;program&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; runs right inside the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;database&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; server. Stored procedures are nomally written in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;PL/SQL&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; or&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0066cc; font-family: Arial; font-size: 10pt;&quot;&gt;Java.&lt;/span&gt;&lt;span style=&quot;color: darkblue; font-family: &amp;quot;Trebuchet MS&amp;quot;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;advantages fo Stored Procedure&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;


&lt;span&gt;Extensibility,Modularity,
Reusability, Maintainability and one time compilation.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;28.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4664&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the modes of parameters that can be passed to a procedure ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1.in:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;in parameter mode is used to pass
values to subprogram when invoked.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;2.out:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;out is used to return values to
callers of subprograms&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;3.in out:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;it is used to define in and out&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;29.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4665&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the two parts of a procedure ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PROCEDURE name (parameter list.....)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local variable
declarations&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Executable statements.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exception.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exception handlers&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;31.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4667&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Give the structure of the function ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp; FUNCTION name (argument list .....) Return
datatype is&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; local variable
declarations&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Begin&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
executable statements&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exception&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
execution handlers&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End;&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;32.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4668&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Explain how procedures and functions are called in a PL/SQL block ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Procedure can be called in the following
ways&lt;br /&gt;
&lt;br /&gt;
a) CALL &amp;lt;procedure name&amp;gt; direc&lt;br /&gt;
&lt;br /&gt;
b) EXCECUTE &amp;lt;procedure name&amp;gt; from calling environment&lt;br /&gt;
&lt;br /&gt;
c) &amp;lt;Procedure name&amp;gt; from other procedures or functions or packages&lt;br /&gt;
&lt;br /&gt;
Functions can be called in the following ways&lt;br /&gt;
&lt;br /&gt;
a) EXCECUTE &amp;lt;Function name&amp;gt; from calling environment. Always use a
variable to get the return value.&lt;br /&gt;
&lt;br /&gt;
b) As part of an SQL/PL SQL Expression&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;33.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4670&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are two parts of package ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The two parts of package are PACKAGE SPECIFICATION
&amp;amp; PACKAGE BODY.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Package Specification contains declarations that
are global to the packages and local to the schema.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Package&amp;nbsp; Body&amp;nbsp; contains&amp;nbsp;
actual&amp;nbsp; procedures&amp;nbsp; and&amp;nbsp; local&amp;nbsp; declaration of the
procedures and cursor declarations.&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;33.What is difference between a Cursor declared in a
procedure and Cursor declared in a package specification ?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A&amp;nbsp; cursor declared in a package specification
is global and can be accessed by other procedures or procedures in a package.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;A&amp;nbsp; cursor declared in a procedure is local to the
procedure that can not be accessed by other procedures.&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;The scope of A cursor declared in a
procedure is limited to that procedure only.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;The Scope of cursor declared in a
package specification is global .&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Example:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;create or replace package curpack
is&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;cursor c1 is select * from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end curpack;&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;This
will create a package Now You can use this cursor any where. Like:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;


&lt;span&gt;set serveroutput on&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;begin&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;for r1 in curpack.c1 loop&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;dbms_output.put_line(r1.empno||&#39;&amp;nbsp;
&#39;||r1.ename);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end loop;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;this will dispaly all empno and
enames.&lt;/span&gt;&lt;br /&gt;


&lt;strong&gt;&lt;span style=&quot;color: red; font-family: Calibri;&quot;&gt;It will be better to use ref cursor in packages&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;35.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4672&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How packaged procedures and functions are called from the following?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Stored procedure or
anonymous block&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. an application program
such a PRC *C, PRO* COBOL&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c. SQL *PLUS&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. PACKAGE NAME.PROCEDURE
NAME (parameters);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variable
:= PACKAGE NAME.FUNCTION NAME (arguments);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXEC SQL
EXECUTE&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
BEGIN&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;
PACKAGE NAME.PROCEDURE NAME (parameters)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;
variable := PACKAGE NAME.FUNCTION NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
(arguments);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;END;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
END EXEC;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c.&amp;nbsp; EXECUTE PACKAGE
NAME.PROCEDURE if the procedures does not have any&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;out/in-out parameters. A function can not be
called.&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;36.&lt;/span&gt;&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;Name&amp;nbsp;
the&amp;nbsp; tables&amp;nbsp; where&amp;nbsp; characteristics&amp;nbsp; of&amp;nbsp;
Package,&amp;nbsp; procedure and functions are stored ?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;The Data dictionary tables/ Views where the
characteristics of subprograms and Packages are stored are mentioned below&lt;br /&gt;
&lt;br /&gt;
a) USER_OBJECTS, ALL_OBJECTS, DBA_OBJECTS&lt;br /&gt;
&lt;br /&gt;
b) USER_SOURCE, ALL_SOURCE, DBA_SOURCE&lt;br /&gt;
&lt;br /&gt;
c) USER_DEPENCENCIES&lt;br /&gt;
&lt;br /&gt;
d) USER_ERRORS, ALL_ERRORS, DBA_ERRORS&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;37.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4669&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Overloading of procedures ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;Overloading procs are 2 or more procs
with the same name but different arguments.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Arguments needs to be different by
class it self. ie char and Varchar2 are from same class.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Packages - &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;The main advantages of packages are
-&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1- Since packages has specification
and body separate so, whenever any ddl is run and if any proc/func(inside
pack)&amp;nbsp;is dependent on that, only body gets invalidated and not the spec.
So any other proc/func dependent on package does not gets invalidated.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;2- Whenever any func/proc from
package is called, whole package is loaded into memory and hence all objects of
pack is availaible in memory which means faster execution if any is called. And
since we put all related proc/func in one package this feature is useful as we
may need to run most of the objects.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;3- we can declare global variables
in the package&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;38.Is it possible to use Transaction
control Statements such a ROLLBACK or COMMIT in Database Trigger ? Why ?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Autonomous Transaction is a feature of oracle 8i which maintains the
state of &lt;br /&gt;
its transactions and save it , to affect with the commit or rollback of the &lt;br /&gt;
surrounding transactions. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Here is the simple example to understand this :- &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;ora816 SamSQL :&amp;gt; declare &lt;br /&gt;
&lt;br /&gt;
2 Procedure InsertInTest_Table_B &lt;br /&gt;
&lt;br /&gt;
3 is &lt;br /&gt;
&lt;br /&gt;
4 BEGIN &lt;br /&gt;
&lt;br /&gt;
5 INSERT into Test_Table_B(x) values (1); &lt;br /&gt;
&lt;br /&gt;
6 Commit; &lt;br /&gt;
&lt;br /&gt;
7 END ; &lt;br /&gt;
&lt;br /&gt;
8 BEGIN &lt;br /&gt;
&lt;br /&gt;
9 INSERT INTO Test_Table_A(x) values (123); &lt;br /&gt;
&lt;br /&gt;
10 InsertInTest_Table_B; &lt;br /&gt;
&lt;br /&gt;
11 Rollback; &lt;br /&gt;
&lt;br /&gt;
12 END; &lt;br /&gt;
&lt;br /&gt;
13 / PL/SQL procedure successfully completed. &lt;br /&gt;
&lt;br /&gt;
ora816 SamSQL :&amp;gt; Select * from Test_Table_A; X---------- 123&lt;br /&gt;
&lt;br /&gt;
ora816 SamSQL :&amp;gt; Select * from Test_Table_B; X---------- 1 &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Notice in above pl/sql COMMIT at line no 6 , commits the transaction at &lt;br /&gt;
line-no 5 and line-no 9. The Rollback at line-no 11 actually did nothing. &lt;br /&gt;
Commit/ROLLBACK at nested transactions will commit/rollback all other DML &lt;br /&gt;
transaction before that. PRAGMA AUTONOMOUS_TRANSACTION override this behavior. &lt;br /&gt;
Let us the see the following example with PRAGMA AUTONOMOUS_TRANSACTION. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;39.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/4662&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is difference between a PROCEDURE &amp;amp; FUNCTION ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial;&quot;&gt;A function always return a values while
procedure can return one or&amp;nbsp;more values through Parameters.&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;font-family: Arial;&quot;&gt;A function can call directly by sql
statement like select &quot;func_name&quot; from dual while procedure cannot.&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;40.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/16315&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Data Concarency and Consistency? &lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 13.5pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 13.5pt;&quot;&gt;Concurrency&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;How well can multiple sessions access the same data
simultaneously &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 13.5pt;&quot;&gt;Consistency&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;How consistent is the view of the data between and
within multiple sessions, transactions or statements &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;41.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/16735&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Talk about &quot;Exception Handling&quot; in PL/SQL?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;the exception are written to handle
the exceptions thrown by programs.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;we have user defined and system
exception.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;user defined exception are the
exception name&amp;nbsp;given by user (explicitly decalred and used) and they are
raised to handle the specific behaviour of program.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;system exceptions are raised due to
invalid data(you dont have to deaclre these). few examples are when
no_data_found, when others etc.&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;44.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/17598&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Can we use commit or rollback command in the exception part of PL/SQL
block?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;Yes, we can use the TCL
commands(commit/rollback) in the exception block of a stored
procedure/function. The code in this part of the&amp;nbsp;program gets executed
like those in the body without any restriction. You can include any business
functionality whenever a condition in main block(body of a proc/func) fails and
requires a follow-thru process to terminate the execution gracefully!&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;DECALRE&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;…..&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;…….&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;EXCEPTION &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;WHEN NO_DATA_FOUND THEN&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;INSERT
INTO err_log(&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1in; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;err_code, code_desc)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;&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;VALUES(‘1403’,
‘No data found’)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;COMMIT;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;RAISE;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;46.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/19687&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is bulk binding please explain me in brief ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;Bulk Binds (BULK COLLECT&amp;nbsp;,
FORALL ) are a PL/SQL technique where, instead of multiple individual SELECT,
INSERT, UPDATE or DELETE statements are executed to retrieve from, or store
data in, at table, all of the operations are carried out at once, in bulk. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;This avoids the context-switching
you get when the PL/SQL engine has to pass over to the SQL engine, then back to
the PL/SQL engine, and so on, when you individually access rows one at a time.
To do bulk binds with Insert, Update and&amp;nbsp;Delete statements, you enclose
the SQL statement within a PL/SQL&amp;nbsp;FORALL statement. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;To do bulk binds with Select
&amp;nbsp;statements, you include the Bulk Collect INTO a collection clause in the
SELECT&amp;nbsp;Statement instead of using Simply into .&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Collections, BULK COLLECT and
FORALL are the new features in Oracle 8i, 9i and 10g PL/SQL that can really
make a different to you PL/SQL performance&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Bulk Binding is used for avoiding
the context switching between the sql engine and pl/sql engine. If we use
simple For loop in pl/sql block it will do &lt;strong&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;context switching between sql and pl/sql
engine&lt;/span&gt;&lt;/strong&gt; for each row processing that degrades the performance of
pl/sql bloack.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;So that for avoiding the context
switching betn two engine we user FORALL keyword by using the collection pl/sql
tables for DML. forall is pl/sql keyword.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;It will provides good result and
performance increase.&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;47.Why Functions are used in oracle
?Can Functions Return more than 1 values?Why Procedures are used in oracle
?What are the Disadvantages of packages?What are the Global Variables in
Packages?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;The functions are used where we
can&#39;t used the procedure.i.e we can use a function the in select statments,in
the where clause of delete/update statments.But the procedure can&#39;t used like
that.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;It is true that function can return
only one value, but a function can be used to return more than one value,by
using out parameters and also by using ref cursors.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;There is no harm in using the out
parameter,when functins are used in the DML statements we can&#39;t used the out
parameter(as per rules).&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;49.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22485&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the restrictions on Functions ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;Function cannot have DML statemets
and we can use select statement in function&lt;br /&gt;
If you create function with DML statements we get message function will be
created&lt;br /&gt;
But if we use in select statement we get error&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;50.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22488&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What happens when a package is initialized ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;when a package is initialised that is
called for the first time the entire package is loaded into SGA and any
variable declared in the package is initialises.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;52.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22828&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is PL/SQL table?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;Pl/Sql table is a type of datatype in
procedural language Extension.It has two columns.One for the index,say Binary
index And another column for the datas,which might further extend to any number
of rows (not columns)in future.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;PL/SQL table is nothing but&amp;nbsp;one
dimensional array. It is used to hold similar type of data for temporary
storage.&amp;nbsp;Its is indexed&amp;nbsp;by binary integer.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;3.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22879&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;can i write plsql block inside expection&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Yes you can write PL/SQL block inside exception section. Suppose you
want to insert the exception detail into your error log table, that time you
can write insert into statement in exception part. To handle the exception
which may be raised in your exception part, you can write the PL/SQL code in
exception part. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;54.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22886&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Can e truncate some of the rows from the table instead of truncating the
full table.&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;You can truncate few rows from a table if
the table is partitioned. You can truncate a single partition and keep
remaining.&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;CREATE TABLE parttab (&lt;br /&gt;
state&amp;nbsp; VARCHAR2(2),&lt;br /&gt;
sales&amp;nbsp; NUMBER(10,2))&lt;br /&gt;
PARTITION BY LIST (state) (&lt;br /&gt;
PARTITION northwest VALUES (&#39;OR&#39;, &#39;WA&#39;)&lt;br /&gt;
&amp;nbsp;TABLESPACE uwdata,&lt;br /&gt;
PARTITION southwest VALUES (&#39;AZ&#39;, &#39;CA&#39;)&lt;br /&gt;
&amp;nbsp;TABLESPACE uwdata);&lt;br /&gt;
&lt;br /&gt;
INSERT INTO parttab VALUES (&#39;OR&#39;, 100000);&lt;br /&gt;
INSERT INTO parttab VALUES (&#39;WA&#39;, 200000);&lt;br /&gt;
INSERT INTO parttab VALUES (&#39;AZ&#39;, 300000);&lt;br /&gt;
INSERT INTO parttab VALUES (&#39;CA&#39;, 400000);&lt;br /&gt;
COMMIT;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM parttab;&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE parttab&lt;br /&gt;
TRUNCATE PARTITION southwest;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM parttab;&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;56.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22894&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is the difference between a reference cursor and normal cursor ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;REF cursors are different than your
typical, standard cursors. With standard cursors, you know the cursor&#39;s query
ahead of time. With REF cursors, you do not have to know the query ahead of
time. With REF Cursors, you can build the cursor on the fly&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Normal Cursor is a Static Cursor. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Refernce Cursor is used to create
dynamic cursor.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;There are two types of Ref Cursors:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1. Weak cursor and 2.Strong cursor&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&amp;nbsp;Type ref_name is Ref cursor
[return type]&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;[return type] means %Rowtype&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;if Return type is mentioned then it
is Strong cursor else weak cursor&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;The Reference cursor does not
support For update clause.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;Normal cursor is used to process
more than one record in plsql.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Refcusor is a type which is going
to hold set of records which can be sent out through the procedure or function
out variables.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;we can use Ref cursor as an IN OUT parameter
.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;58.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/22951&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Based on what conditions can we decide whether to use a table or a view or
a materialized view ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Table is the basic entity in any
RDBMS , so for storing data you need table .&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;for view - if you have complex
query from which you want to extract data again and again , moreover it is a
standard data which is required by many other user also for REPORTS generation
then create view . Avoid to insert / update / delete through view unless it is
essential. keep view as read only (FOR SHOWING REPORTS)&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;for materialized view - this view
ia mainly used in datawarehousing . if you have two databases and you want a
view in both databases , remember in datawarehousing we deal in GB or TB datasize
. So create a&amp;nbsp;summary table in a database and make the
replica(materialized view) in other database. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;when to create materialized view-&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;[1] if data is in bulk and you need
same data in more than one database then create summary table at one database
and replica in other databases&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;[2] if you have summary columns in
projection list of query.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;main advatages of materialized view
over simple view are -&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;[1] it save data in database
whether simple view&#39;s definition is saved in database&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;[2] can create parition or index on
materialize view to enhance the performance of view , but cannot on simple
view.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;59.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/23144&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is the difference between all_ and user_ tables ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;a href=&quot;&quot; name=&quot;1146899&quot;&gt;&lt;/a&gt;An &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;ALL_&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; view displays all the information accessible to
the current user, including information from the current user&#39;s schema as well
as information from objects in other schemas, if the current user has access to
those objects by way of grants of privileges or roles. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;While&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;&lt;a href=&quot;&quot; name=&quot;1146901&quot;&gt;&lt;/a&gt;A &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;USER_&lt;/span&gt;&lt;span&gt; view displays all the information from the
schema of the current user. No special privileges are required to query these
views.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;User_tables data dictionary
contains all the tables created by the users under&amp;nbsp;that schema.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;whereas All_tables stores all the
tables created in different schema. If any user id have the Grants for access
table of diff. schema then he can see that table through this dictionary.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;61.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/24088&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what is p-code and sourcecode ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;P-code is Pre-complied code stored
in Public cache memory&amp;nbsp;of System Global Area after the Oracle instance is
started, whereas sourcecode is a simple code of sp, package, trigger, functions
etc which are stored in Oracle system defined data dictionary. Every session of
oracle access the p-code which have the Execute permission on that objects. &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Source code stored in user_objects
data dictinary for user defined Store proc, Trigger, Package, Function.
DBA_object stores all the db objects in sp. DB. ALL_objects stores all the db
objects in sp. schema.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Source code: The code say a PLSQL
block that the user types for the exectionP-Code: The source code after -Syntax
check, Parse tree generation, Symantic check, and further execution of the
parse tree..giving the final P-code ready for data fetch or manipulation ...&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;63.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/24353&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Is there any limitation on no. of triggers that can be created on a table?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;There is no limit on number of
triggers on one table.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;you can write as many u want for
insert,update or delte by diff names.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;if table has got n columns. we can
create n triggers based on each column.&lt;/span&gt;&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;64.What happens when DML Statement fails?A.User
level rollbackB.Statement Level RollbackC.Sustem evel Rollback&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;When a DML statement&amp;nbsp;executes
(fails/sucess) an automatic Commit is executed. Eg :&amp;nbsp;Create a
table&amp;nbsp;t1. Insert a record in t1. Then again to create the same object
t1.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;65.What steps should a programmer
should follow for better tunning of the PL/SQL blocks?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SQL Queries – Best Practices&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;1.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Always use the where clause in your
select statement to narrow the number of rows returned. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;If we don’t use a where clause,
the Oracle performs a full table scan on our table and returns all of the rows.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;2.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use EXISTS clause instead of IN clause
as it is more efficient than IN and performs faster.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Ex:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Replace &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT * FROM DEPT WHERE DEPTNO
IN &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 3.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(SELECT DEPTNO FROM EMP E)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT * FROM DEPT D WHERE EXISTS &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;(SELECT 1 FROM EMP E WHERE D.DEPTNO = E.DEPTNO)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Note: IN checks all rows. Only
use IN if the table in the sub-query is extremely small.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;3.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;When you have a choice of using the IN
or the BETWEEN clauses in your SQL, use the BETWEEN clause as it is much more
efficient than IN.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;Depending on the range of numbers in
a BETWEEN, the optimizer will choose to do a full table scan or use the index.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;4.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Avoid WHERE clauses that are
non-sargable. Non-sargable search arguments in the WHERE clause, such as
&quot;IS NULL&quot;, &quot;OR&quot;, &quot;&amp;lt;&amp;gt;&quot;, &quot;!=&quot;,
&quot;!&amp;gt;&quot;, &quot;!&amp;lt;&quot;, &quot;NOT&quot;, &quot;NOT EXISTS&quot;,
&quot;NOT IN&quot;, &quot;NOT LIKE&quot;,&amp;nbsp;and &quot;LIKE %500&quot; can
prevent the query optimizer from using an index to perform a search. In
addition, expressions that include a function on a column, or expressions that
have the same column on both sides of the operator, are not sargable.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Convert multiple OR clauses to
UNION ALL.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;5.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use equijoins. It is better if you use
with indexed column joins.&lt;span&gt;&amp;nbsp; &lt;/span&gt;For maximum
performance when joining two or more tables, the indexes on the columns to be
joined should have the same data type.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;6.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Avoid a full-table scan if it is more
efficient to get the required rows through an index. It decides full table scan
if it has to read more than 5% of the table data (for large tables).&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;7. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Avoid using an index that fetches 10,000
rows from the driving table if you could instead use another index that fetches
100 rows and choose selective indexes.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;8. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Indexes can&#39;t be used when Oracle is
forced to perform implicit datatype conversion.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;9. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Choose the join order so you will join
fewer rows to tables later in the join order.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1.5in; text-align: justify; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
use smaller table as driving table&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 1.5in; text-align: justify; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
have first join discard most rows&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;10. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Set up the driving table to be the one
containing the filter condition that eliminates the highest percentage of the table.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;11. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;In a where clause (or having clause),
constants or bind variables should always be on the right hand side of the
operator.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;12. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Do not use SQL functions in predicate
clauses or WHERE clauses or on indexed columns, (e.g. concatenation, substr, decode,
rtrim, ltrim etc.) as this prevents the use of the index. Use function based
indexes where possible&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SELECT * FROM EMP WHERE SUBSTR (ENAME, 1,
3) = ‘KES’&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Use the LIKE function instead of
SUBSTR ()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;13. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;If you want the index used, don’t perform
an operation on the field.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Replace &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT * FROM EMPLOYEE WHERE
SALARY +1000 = :NEWSALARY&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT * FROM EMPLOYEE WHERE
SALARY = :NEWSALARY –1000&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;14. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;All SQL statements will be in mixed lower
and lower case.&lt;span&gt;&amp;nbsp; &lt;/span&gt;All reserve words will
be capitalized and all user-supplied objects will be lower case. (Standard)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;15.
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Minimize the use of DISTINCT because
it forces a sort operation.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;16.
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Try joins rather than sub-queries
which result in implicit joins&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Replace &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SELECT * FROM A WHERE A.CITY IN
(SELECT B.CITY FROM B)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SELECT A.* FROM A, B WHERE A.CITY =
B.CITY&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;17. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Replace Outer Join with Union
if both join columns have a unique index:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0.0001pt 0.5in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Replace &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT A.CITY, B.CITY FROM A, B
WHERE A.STATE=B.STATE (+)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT A.CITY, B.CITY FROM A, B&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WHERE A.STATE=B.STATE&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;UNION&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;SELECT NULL, B.CITY FROM B WHERE
NOT EXISTS&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;&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&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;(SELECT &#39;X&#39; FROM A.STATE=B.STATE)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;18. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use bind variables in queries passed from the application
(PL/SQL) so that the same query can be reused. This avoids parsing.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;19. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use Parallel Query and Parallel DML if your system has more
than 1 CPU.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;20. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Match SQL where possible. Applications should use the same SQL
statements wherever possible to take advantage of Oracle&#39;s Shared SQL Area. The
SQL must match exactly to take advantage of this. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;21. &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;No matter how many indexes are created, how much optimization
is done to queries or how many caches and buffers are tweaked and tuned if the
design of a database is faulty, the performance of the overall system suffers.
A good application starts with a good design.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;22.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;The following operations always require a sort:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;SELECT
DISTINCT&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;SELECT
UNIQUE&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;SELECT
....ORDER BY...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;SELECT....GROUP
BY...&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;CREATE
INDEX&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;CREATE
TABLE.... AS SELECT with primary key specification&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;Use
of INTERSECT, MINUS, and UNION set operators&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;Unindexed
table joins&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&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;Some
correlated sub-queries&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span&gt;Also the order in which the
conditions are given in the &#39;WHERE&#39; cluase are very important while performing
a &#39;Select&#39; query. The Performance Difference is unnoticed ifother wise&amp;nbsp;the
query is&amp;nbsp;run&amp;nbsp;on a Massive Database.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;For example for a select statement,&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span&gt;SELECT Emp_id FROM Emp_table
WHERE Last_Name = &#39;Smith&#39; AND Middle_Initial = &#39;K&#39;&amp;nbsp;AND Gender = &#39;Female&#39;;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;


&lt;span&gt;The look up for matches in the
table is performed by taking the conditions in the&amp;nbsp;WHERE cluase in the
reverse order i.e., first all the rows that match the criteria Gender =
&#39;Female&#39; are returned and in these returned rows, the conditon Last_Name =
&#39;Smith&#39; is looked up.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;There fore, the order of the
conditions in the WHERE clause must be in such a way that the last condition
gives minimum collection of potential match rows and the next condition must
pass on even little and so on. So, if we fine tune the above query, it should
look like,&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span&gt;SELECT Emp_id FROM Emp_table
WHERE Gender = &#39;Female&#39; AND Middle_Initial = &#39;K&#39;&amp;nbsp;AND Last_Name = &#39;Smith&#39; ;
&lt;/span&gt;&lt;/b&gt;&lt;span&gt;as Last_Name Smith would
return far more less number of rows than Gender = &#39;Female&#39; as in the former
case.&lt;/span&gt;&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;66.what is difference between varray and nested
table.can u explain in brief and clear my these concepts.also give a small and
sweet example of both these.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Varry and Nestead table both are
belongs to CollectionsThe Main difference is Varray has Upper bound, where as
Nestead table doesn&#39;t. It&#39;s size is unconstrained like any other database
tableNestead table can be stored in DatabaseSyntax of Nestead TableTYPE
nes_tabtype IS TABLE OF emp.empno%type;nes_tab nes_tabtype;Syntax of VarryTYPE
List_ints_t IS VARRAY(8) OF NUMBER(2);aList
List_ints_t:=List_ints_t(2,3,5,1,5,4);&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Nested table can be indexed where
as VArray can&#39;t.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;69.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/27005&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is PL/Sql tables?Is cursor variable store in PL/SQL table?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;pl/sql table is temparary table
which is used to store records temrparaily in PL/SQL Block, whenever block
completes execution, table is also finished.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;71.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/27374&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is the DATATYPE of PRIMARY KEY&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Binary Integer&lt;/span&gt;&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;72.What is the difference between User-level, Statement-level
and System-level Rollback? Can you please give me example of each?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1.&amp;nbsp;System - level or
transaction level&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Rollback the current transaction entirely on errors. This was the
unique&lt;br /&gt;
&amp;nbsp;&amp;nbsp; behavior of old drivers becauase PG has no savepoint functionality
until&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 8.0.&lt;br /&gt;
&lt;br /&gt;
2. Statement&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Rollback the current (ODBC) statement on errors (in case of 8.0 or
later&lt;br /&gt;
&amp;nbsp;&amp;nbsp; version servers). The driver calls a SAVEPOINT command just before
starting&lt;br /&gt;
&amp;nbsp;&amp;nbsp; each (ODBC) statement and automatically ROLLBACK to the savepoint
on errors&lt;br /&gt;
&amp;nbsp;&amp;nbsp; or RELEASE it on success. If you expect Oracle-like automatic per
statement&lt;br /&gt;
&amp;nbsp;&amp;nbsp; rollback, please use this level.&lt;br /&gt;
&lt;br /&gt;
3.&amp;nbsp;User&amp;nbsp;Level&lt;br /&gt;
&amp;nbsp;&amp;nbsp; You can(have to) call some SAVEPOINT commands and rollback to a
savepoint&lt;br /&gt;
&amp;nbsp;&amp;nbsp; on errors by yourself. Please note you have to rollback the
current&lt;br /&gt;
&amp;nbsp;&amp;nbsp; transcation or ROLLBACK to a savepoint on errors (by yourself) to
continue&lt;br /&gt;
&amp;nbsp;&amp;nbsp; the application&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;74.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/27898&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Details about FORCE VIEW why and we can use&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Generally we are not supposed to
create a view without base table. If you want to create any view without base
table that is called as Force View or invalid view.&lt;br /&gt;
Syntax: CREATE FORCE VIEW AS &amp;lt; SELECT STATMENT &amp;gt;;&lt;br /&gt;
That View will be created with the message&lt;br /&gt;
View created with compilation errors&lt;br /&gt;
Once you create the table that invalid view will become as valid one.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;75.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;1) Why it is recommonded to use INOUT instead of OUT
parameter type in a procedure?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;2) What happen if we will not assign anything in OUT parameter type in a
procedure?&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Hi,OUT parameter will be useful for
returning the value from subprogram, value can be assigned only once and this
variable cannot be assigned to another variable.IN OUT parameter will be used
to pass the value to subprogram and as well as it can be used to return the
value to caller of subprogram. It acts as explicitly declared variable.
Therefore it can be assigned value and its value can be assigned to another
variable.So IN OUT will be useful than OUT parameter.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;div style=&quot;margin-left: 0.5in; text-indent: -0.25in;&quot;&gt;
&lt;span&gt;&lt;span&gt;1)&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;IN OUT and OUT selection criteria depends
upon the program need.if u want to retain the value that is being passed then
use seperate (IN and OUT)otherwise u can go for IN OUT.2)If nothing is assigned
to a out parameter in a procedure then NULL will be returned for that parameter.&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;78.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/29086&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is autonomous Transaction? Where are they used?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Autonomous transaction is the
transaction which acts independantly from the calling part and could commit the
process done.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;example using prgma autonomous
incase of mutation problem happens in a trigger.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;79.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/29217&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How can I speed up the execution of query when number of rows in the tables
increased&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Standard practice is -&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1. Indexed the columns (Primary
key)&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;2. Use the indexed / Primary key
columns in the where clause&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;3. check the explain paln for the
query and avoid for the nested loops / full table scan (depending on the size
of data retrieved and / or master table with few rows)&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;80.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/29354&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is the purpose of FORCE while creating a VIEW&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;usually the views are created from
the basetable if only the basetable exists.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;The purpose of FORCE keyword is to
create a view if the underlying base table doesnot exists.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;ex : create or replace FORCE view
&amp;lt;viewname&amp;gt; as &amp;lt;query&amp;gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;while using the above syntax to
create a view the table used in the query statement doesnot necessary to exists
in the database&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;83.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/29578&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Mutation of a trigger? why and when does it oocur?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;A table is said to be a Mutating
table under the following three circumstances&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;1) When u try to do delete, update,
insert into a table through a trigger and at the same time u r trying to select
the same table.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;2) The same applies for a view&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;3) Apart from that, if u r deleting
(delete cascade),update,insert on the parent table and doing a select in the
child tableAll these happen only in a row level trigger&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;90.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/30740&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How to handle exception in Bulk collector?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;During bulk collect you can save
the exception and then you can process the exception.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Look at the below given example:&lt;/span&gt;&lt;br /&gt;


&lt;pre&gt;DECLARE&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;TYPE NumList IS TABLE OF NUMBER;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;num_tab NumList := NumList(10,0,11,12,30,0,20,199,2,0,9,1);&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;errors&lt;span&gt;&amp;nbsp; &lt;/span&gt;NUMBER;&lt;/pre&gt;
&lt;pre&gt;BEGIN&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;FORALL i IN num_tab.FIRST..num_tab.LAST &lt;/pre&gt;
&lt;pre&gt;&lt;b&gt;SAVE EXCEPTIONS&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;DELETE * FROM emp WHERE sal &amp;gt; 500000/num_tab(i);&lt;/pre&gt;
&lt;pre&gt;EXCEPTION WHEN OTHERS THEN&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;-- this is not in the doco, thanks to JL for pointing this out&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;errors := &lt;b&gt;SQL%BULK_EXCEPTIONS.COUNT;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;dbms_output.put_line(&#39;Number of errors is &#39; || errors);&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;FOR i IN 1..errors LOOP&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;-- Iteration is &lt;b&gt;SQL%BULK_EXCEPTIONS(i).ERROR_INDEX;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;-- Error code is &lt;b&gt;SQL%BULK_EXCEPTIONS(i).ERROR_CODE;&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;END LOOP;END;&lt;/pre&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;91.#1 What are the advantages and disadvantages of
using PL/SQL or JAVA as the primary programming tool for database automation.&lt;br /&gt;
&lt;br /&gt;
#2 Will JAVA replace PL/SQL?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Internally the Oracle database supports two
procedural languages, namely PL/SQL and Java. This leads to questions like
&quot;Which of the two is the best?&quot; and &quot;Will Oracle ever desupport
PL/SQL in favour of Java?&quot;. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Many Oracle applications are based on PL/SQL and it would be difficult
of Oracle to ever desupport PL/SQL. In fact, all indications are that PL/SQL
still has a bright future ahead of it. Many enhancements are still being made
to PL/SQL. For example, Oracle 9iDB supports native compilation of Pl/SQL code
to binaries. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PL/SQL and Java appeal to different people in different job roles. The
following table briefly describes the difference between these two language
environments: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;PL/SQL:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Data centric and tightly integrated into the database &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Proprietary to Oracle and difficult to port to other database systems &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Data manipulation is slightly faster in PL/SQL than in Java &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Easier to use than Java (depending on your background) &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Java:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Open standard, not proprietary to Oracle &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Incurs some data conversion overhead between the Database and Java type
systems &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;span&gt;&amp;nbsp;
&lt;/span&gt;Java is more difficult to use (depending on your background)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;110.&lt;b&gt;&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;1.What is bulk collect?&lt;br /&gt;
2.What is instead trigger&lt;br /&gt;
3.What is the difference between Oracle table &amp;amp; PL/SQL table?&lt;br /&gt;
4.What R built in Packages in Oracle?&lt;br /&gt;
5.what is the difference between row migration &amp;amp; row changing?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;1&lt;/span&gt;&lt;span&gt;.What is bulk collect?&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Bulk collect is part of PLSQL
collection where data is stored/ poped up into a variable.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;example:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;declare&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;type sal_rec is table of number;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;v_sal sal_rec;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;begin&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;select sal bulk collect into v_sal
from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;for r in 1.. v_sal.count loop&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;dbms_output.put_line(v_sal(r));&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end loop;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;end;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;br /&gt;
2.What is instead trigger&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;instead triggers are used for
views.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;3.What is the difference between
Oracle table &amp;amp; PL/SQL table?&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Table is logical entity which holds
the data in dat file permanently .&amp;nbsp; where as scope of plsql table is
limited to the particular block / procedure .&amp;nbsp; refer above example&amp;nbsp;
sal_rec table will hold data only till programme is reaching to end;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;br /&gt;
4.What R built in Packages in Oracle?&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;There R more then 1000 oracle
builtin packges like:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Dbms_output,&amp;nbsp;
dbms_utility&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms_pipe .............&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;5.what is the difference between
row migration &amp;amp; row &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;changing?&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;Migration:&lt;/b&gt;&lt;span&gt; The data is
stored in blocks whic use Pctfree 40%&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;and pctused 60% (
normally).&amp;nbsp;The 40% space is used for update and delete statements .&amp;nbsp;
when a condition may arise that update/delete statement takes more then pctfree
then it takes the space from anther block.&amp;nbsp; this is called migration.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;RowChaining:&lt;/b&gt;&lt;span&gt; while inserting
the data if data of one row takes more then one block then this row is stored
in two blocks and rows are chained.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;insted of triggers: They provide a
transparent way of modifying view that can&#39;t be modified directly through
SQL,DML statement.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;111.Can anyone tell me the difference between instead
of trigger, database trigger, and schema trigger?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;INSTEAD OF Trigger control
operation on view , not table. They can be used to make non-updateable views
updateable and to override the behvior of view that are updateable.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Database triggers fire whenever the
database startup or is shutdown, whenever a user logs on or log off, and
whenever an oracle error occurs. these tigger provide a means of tracking
activity in the database&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;if we have created a view that is
based on join codition then its not possibe to apply dml operations like
insert, update and delete on that view. So what we can do is we can create
instead off trigger and perform dml operations on the view.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;131.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/36659&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;HI,What is Flashback query in Oracle9i...?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Flahsback is used to take your
database at old state like a system restore in windows. No DDL and DML is
allowed when database is in flashback condition.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;user should have execute permission
on dbms_flashback package&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;for example:&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;at 1030 am&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;from scott user : delete from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;commit;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;at 1040 am I want all my data from
emp table then ?&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;&amp;nbsp; declare&lt;br /&gt;
&amp;nbsp; cursor c1 is select * from emp;&lt;br /&gt;
&amp;nbsp; emp_cur emp%rowtype;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; begin&lt;br /&gt;
&amp;nbsp;&amp;nbsp; dbms_flashback.enable_at_time(sysdate - 15/1440);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; open c1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; dbms_flashback.disable;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; loop&lt;br /&gt;
&amp;nbsp; fetch c1 into emp_cur;&lt;br /&gt;
&amp;nbsp;exit when c1%notfound;&lt;br /&gt;
&amp;nbsp; insert into emp values(emp_cur.empno, emp_cur.ename, emp_cur.job, &lt;br /&gt;
&amp;nbsp; emp_cur.mgr,emp_cur.hiredate, emp_cur.sal, emp_cur.comm,&lt;br /&gt;
&amp;nbsp; emp_cur.deptno);&lt;br /&gt;
&amp;nbsp; end loop;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;commit;&lt;br /&gt;
&amp;nbsp;end;&lt;br /&gt;
&amp;nbsp;/&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;select * from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;14 rows selected&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;132.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/36883&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what is the difference between database server and data dictionary&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Database server&amp;nbsp;&amp;nbsp;is&amp;nbsp;
collection of all objects of oracle &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Data Dictionary contains the
information of&amp;nbsp;for all the objects like when&amp;nbsp;created, who created
etc.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Database server is a server on
which the instance of oracle as server runs..whereas datadictionary is the
collection of information about all those objects like tables indexes views
triggers etc in a database..&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;134.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/38154&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Mention the differences between aggregate functions and analytical
functions clearly with examples?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Aggregate functions are sum(),
count(), avg(), max(), min()&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;like:&amp;nbsp; &lt;/span&gt;&lt;br /&gt;


&lt;span&gt;select sum(sal) , count(*) ,
avg(sal) , max(sal) , min(sal) from emp;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;analytical fuction differ from
aggregate function&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;some of examples:&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span&gt;SELECT ename &quot;Ename&quot;,
deptno &quot;Deptno&quot;, sal &quot;Sal&quot;,&lt;br /&gt;
&amp;nbsp; SUM(sal)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; OVER (ORDER BY deptno, ename) &quot;Running Total&quot;,&lt;br /&gt;
&amp;nbsp; SUM(SAL)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; OVER (PARTITION BY deptno&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY ename)
&quot;Dept Total&quot;,&lt;br /&gt;
&amp;nbsp; ROW_NUMBER()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; OVER (PARTITION BY deptno&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY ENAME)
&quot;Seq&quot;&lt;br /&gt;
FROM emp&lt;br /&gt;
ORDER BY deptno, ename&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;b&gt;&lt;span&gt;SELECT * FROM (&lt;br /&gt;
&amp;nbsp; SELECT deptno, ename, sal, ROW_NUMBER()&lt;br /&gt;
&amp;nbsp; OVER (&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION BY deptno ORDER BY sal DESC&lt;br /&gt;
&amp;nbsp; ) Top3 FROM emp&lt;br /&gt;
)&lt;br /&gt;
WHERE Top3 &amp;lt;= 3&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;136.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/38752&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what are the advantages &amp;amp; disadvantages of packages ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Modularity,Easier Application
Design,Information Hiding,Added Functionality,Better Performance,&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Disadvantages of Package - More
memory may be required on the Oracle database server when using Oracle PL/SQL
packages as the whole package is loaded into memory as soon as any object in
the package is accessed.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Disadvantages: Updating one of the
functions/procedures will invalid other objects which use different
functions/procedures since whole package is needed to be compiled.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;we cant pass parameters to packages&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;137.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39416&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is a NOCOPY parameter? Where it is used?&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;NOCOPY Parameter Option&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;br /&gt;
Prior to Oracle 8i there were three types of parameter-passing options to
procedures and functions: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 10pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;IN:
parameters are passed by reference &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 10pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;OUT:
parameters are implemented as copy-out &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in 5pt 0.5in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 10pt;&quot;&gt;&lt;span&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;IN OUT:
parameters are implemented as copy-in/copy-out &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;The technique of OUT and IN OUT
parameters was designed to protect original values of them in case exceptions
were raised, so that changes could be rolled back. Because a copy of the
parameter set was made, rollback could be done. However, this method imposed
significant CPU and memory overhead when the parameters were large data
collections—for example, PL/SQL Table or VARRAY types. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;With the new NOCOPY option, OUT and IN OUT parameters are passed by
reference, which avoids copy overhead. However, parameter set copy is not
created and, in case of an exception rollback, cannot be performed and the
original values of parameters cannot be restored. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Here is an example of using the NOCOPY parameter option: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;TYPE Note IS RECORD(&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Title VARCHAR2(15),&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Created_By VARCHAR2(20),&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Created_When DATE,&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Memo VARCHAR2(2000));TYPE Notebook IS
VARRAY(2000) OF Note;CREATE OR REPLACE PROCEDURE Update_Notes(Customer_Notes IN
OUT NOCOPY Notebook) ISBEGIN&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;...END;&lt;/span&gt;&lt;/div&gt;
&lt;span&gt;NOCOPY is a hint given to the
compiler, indicating that the parameter is passed as a reference and hence
actual value should not be copied in to the block and vice versa. The
processing will be done accessing data from the original variable. (Which other
wise, oracle copies the data from the parameter variable into the block and
then copies it back to the variable after processing. This would put extra
burdon on the server if the parameters are of large collections/sizes)&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;For better understanding of NOCOPY
parameter, I will suggest u to run the following code and see the result.&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;DECLARE&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12570&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; n NUMBER := 10;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12571&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; PROCEDURE do_something (&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12572&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n1 IN NUMBER,&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12573&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n2 IN OUT NUMBER,&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12574&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n3 IN OUT NOCOPY NUMBER) IS&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12575&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; BEGIN&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12576&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n2 := 20;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12577&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
DBMS_OUTPUT.PUT_LINE(n1);&amp;nbsp; -- prints 10&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12578&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n3 := 30;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12579&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
DBMS_OUTPUT.PUT_LINE(n1);&amp;nbsp; -- prints 30&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12580&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; END;&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12581&quot;&gt;&lt;/a&gt;BEGIN&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12583&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; do_something(n, n, n);&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12584&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; DBMS_OUTPUT.PUT_LINE(n);&amp;nbsp; -- prints 20&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;12585&quot;&gt;&lt;/a&gt;END;&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;138.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39802&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How to get the 25th row of a table.&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #0000f0;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;color: #0000f0;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;from&lt;/span&gt;&amp;nbsp;Emp
&lt;span style=&quot;color: #0000f0;&quot;&gt;where&lt;/span&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;rownum&lt;/span&gt;
&lt;span style=&quot;color: #0000f0;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: maroon;&quot;&gt;26&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;color: #0000f0; font-size: 10pt; line-height: 115%;&quot;&gt;minus&lt;/span&gt;&lt;br /&gt;


&lt;span style=&quot;color: #0000f0;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;from&lt;/span&gt;&amp;nbsp;Emp
&lt;span style=&quot;color: #0000f0;&quot;&gt;where&lt;/span&gt; &lt;span style=&quot;color: #0000f0;&quot;&gt;rownum&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;25&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;SELECT * FROM EMP A WHERE
25=(SELECT COUNT(*) FROM EMP BWHERE A.EMPNO&amp;gt;B.EMPNO);&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;139.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39803&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is Atomic transaction?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;An atomic transaction is a database
transaction or a hardware transaction which either completely occurs, or
completely fails to occur. A prosaic example is pregnancy - you can&#39;t be
&quot;halfway pregnant&quot;; you either are or you aren&#39;t&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;140.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39804&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is materialized view?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;A materialized view is a database
object that contains the results of a query. They are local copies of data
located remotely, or are used to create summary tables based on aggregations of
a table&#39;s data. Materialized views, which store data based on remote tables are
also, know as snapshots.A materialized view can query tables, views, and other
materialized views. Collectively these are called master tables (a replication
term) or detail tables (a data warehouse term).&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;141.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39805&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How to change owner of a table?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Owner of a table is the schema name
which holds the table. To change the owner just recreate the table in the new
schema and drop the previous table&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;142.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/39806&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How can i see the time of execution of a sql statement?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;sqlplus &amp;gt;set time on &lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;144.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/40665&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what happens when commit is given in executable section and an error occurs
?please tell me what ha&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Whenever the exception is raised
..all the transaction made before will be commited. If the exception is not
raised then all the transaction will be rolled back.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;145.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/41160&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Wheather a Cursor is a Pointer or Reference?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;cursor is basically a pointer as
it&#39;s like a address of virtual memory which is being used storage related to
sql query &amp;amp; is made free after the values from this memory is being used&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;146.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/41382&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What will happen to an anonymus block,if there is no statement inside the
block?eg:-declarebeginend&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;We cant have&lt;br /&gt;
declare&lt;br /&gt;
begin&lt;br /&gt;
end&lt;br /&gt;
we must have something between the begin and the end keywords&lt;br /&gt;
otherwise a compilation error will be raised.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;147.Can we have same trigger with different names for
a table?&lt;br /&gt;
&lt;br /&gt;
eg: create trigger trig1&lt;br /&gt;
after insert on tab1;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
eg: create trigger trig2&lt;br /&gt;
after insert on tab1;&lt;br /&gt;
&lt;br /&gt;
If yes,which trigger executes first.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;The triggers will be fired on the
basis of TimeStamp of their creation in Data Dictionary. The trigger with
latest timestamp will be fired at last.&lt;/span&gt;&lt;br /&gt;


&lt;span class=&quot;MsoHyperlink&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 9pt; line-height: 115%;&quot;&gt;148.creating a table, what is the difference between
VARCHAR2(80) and VARCHAR2(80 BYTE)?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Historically database columns which
hold alphanumeric data have been defined using the number of bytes they store.
This approach was fine as the number of bytes equated to the number of
characters when using single-byte character sets. With the increasing use of
multibyte character sets to support globalized databases comes the problem of bytes
no longer equating to characters.Suppose we had a requirement for a table with
an id and description column, where the description must hold up to a maximum
of 20 characters.We then decide to make a multilingual version of our
application and use the same table definition in a new instance with a
multibyte character set. Everything works fine until we try of fill the column
with 20 two-byte characters. All of a sudden the column is trying to store
twice the data it was before and we have a problem.Oracle9i has solved this
problem with the introduction of character and byte length semantics. When
defining an alphanumeric column it is now possible to specify the length in 3
different ways: 1. VARCHAR2(20) 2. VARCHAR2(20 BYTE) 3. VARCHAR2(20 CHAR)Option
1 uses the default length semantics defined by the NLS_LENGTH_SEMANTICS
parameter which defaults to BYTE. Option 2 allows only the specified number of
bytes to be stored in the column, regardless of how many characters this
represents. Option 3 allows the specified number of characters to be stored in
the column regardless of the number of bytes this equates to.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;151.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/42760&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;how to insert a music file into the database&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;LOB datatypes can be used to store
blocks of unstructured data like graphic images, video, audio, etc&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;152.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/42866&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what is diff between strong and weak ref cursors&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;A&amp;nbsp;strong REF CURSOR type
definition specifies a return type, but a weak definition does not.&lt;br /&gt;
DECLARE&lt;br /&gt;
&lt;a href=&quot;&quot; name=&quot;38996&quot;&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp; TYPE EmpCurTyp IS REF CURSOR RETURN
emp%ROWTYPE;&amp;nbsp; -- strong&lt;br /&gt;
&amp;nbsp;&amp;nbsp; TYPE GenericCurTyp IS REF CURSOR;&amp;nbsp; -- weak&lt;br /&gt;
&amp;nbsp;in a strong cursor structure is predetermined --so we cannot query
having&amp;nbsp;different structure other than emp%rowtype&lt;br /&gt;
in weak cursor structure is not predetermined -- so we can query with any
structure&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;Strong Ref cursor type is less
Error prone, because oracle already knows what type you are going to return as
compare to weak ref type.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;154.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/43311&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Explain, Is it possible to have same name for package and the procedure in
that package. &lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Yes, its possible to have same name
for package and the procedure in that package.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;159.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/43549&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Without closing the cursor, If you want to open it what will happen. If
error, get what is the erro&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;r&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;If you reopen a cursor without
closing it first,PL/SQL raises the predefined exception CURSOR_ALREADY_OPEN.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;161.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/43559&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is PRAGMA RESTRICT_REFERENCES:&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;By using pragma_restrict_references
we can&amp;nbsp; give the different status to functions,Like WNDB(WRITE NO DATA
BASE),RNDB(read no data base),Write no package state,read no packge state.W&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;164.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/43772&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What is difference between PL/SQL tables and arrays?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;array is set of values of same
datatype.. where as tables can store values of diff datatypes.. also tables has
no upper limit where as arrays has.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;168.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/44306&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;How do you set table for read only access ?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;If you update or delete the records
in the table, at the same time, no body can update or delete the same records
which you updated or deleted because oracle lock the data which u updated or
deleted.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;span&gt;Select for update&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;169.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/44349&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;What are the disadvantages of Packages and triggers??&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt; line-height: 115%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Disadvantages of Packages:&lt;br /&gt;
1. You cannot reference remote packaged variables directly or indirectly..&lt;br /&gt;
2. Inside package you cannot reference host variable..&lt;br /&gt;
3. We are not able to grant a procedure in package.. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Disadvantages of Trigger:&lt;br /&gt;
1. Writing more number of codes..&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;170.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/44376&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;How to
disable a trigger for a particular table ?&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;alter trigger
&amp;lt;trigger_name&amp;gt; disable&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;172.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/44696&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;how can we
avoid duplicate rows. without using distinct command&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Using Self join like :&lt;br /&gt;
&amp;nbsp; select dup.column from tab a,tab b where a.dup.column=b.dup.column and
a.rowid&amp;lt;&amp;gt;b.rowid&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;This query will return the first row for each
unique&amp;nbsp;id in the table. This query could be used as part of a delete
statement to remove duplicates if needed.&lt;br /&gt;
&lt;br /&gt;
SELECT &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;FROM func t1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt;WHERE &lt;/span&gt;&lt;span style=&quot;color: red; font-family: Courier; font-size: 10pt;&quot;&gt;ROWID&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;(SELECT&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;MIN&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt;ROWID&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&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;
FROM&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;
func&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;
WHERE&lt;/span&gt;&lt;span style=&quot;font-family: Courier; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;font-family: Courier; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Courier; font-size: 10pt;&quot;&gt; t1&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;.ID)&lt;br /&gt;
&lt;br /&gt;
Also: You can use a group by without a summary function&lt;br /&gt;
SELECT &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Courier; font-size: 10pt;&quot;&gt;ID &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: Verdana; font-size: 9pt;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 9pt;&quot;&gt; func t1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;GROUP BY id&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;173.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/45008&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt;&quot;&gt;Why we use
instead of trigger. what is the basic structure of the instead of trigger.
Explain speci&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 30pt 0in 12pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Conceptually, INSTEAD OF triggers are very simple. You write code that
the Oracle server will execute when a program performs a DML operation on the
view. Unlike a conventional BEFORE or AFTER trigger, an INSTEAD OF trigger &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;takes the
place of&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;, rather than supplements,
Oracle&#39;s usual DML behavior. (And in case you&#39;re wondering, you cannot use
BEFORE/AFTER triggers on any type of view, even if you have defined an INSTEAD
OF trigger on the view.) &lt;br /&gt;
CREATE OR REPLACE TRIGGER images_v_insert&lt;br /&gt;
&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;INSTEAD
OF INSERT ON images_v&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;&lt;br /&gt;
FOR EACH ROW&lt;br /&gt;
BEGIN&lt;br /&gt;
&amp;nbsp;&amp;nbsp; /* This will fail with DUP_VAL_ON_INDEX if the images table&lt;br /&gt;
&amp;nbsp;&amp;nbsp; || already contains a record with the new image_id.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp; INSERT INTO images&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUES (:NEW.image_id, :NEW.file_name,
:NEW.file_type,&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;&amp;nbsp;
:NEW.bytes);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; IF :NEW.keywords IS NOT NULL THEN&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Note: apparent bug prevents
use of :NEW.keywords.LAST.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || The workaround is to store
:NEW.keywords as a local&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; || variable (in this case
keywords_holder.)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keywords_holder Keyword_tab_t
:= :NEW.keywords;&lt;br /&gt;
&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; FOR the_keyword IN
1..keywords_holder.LAST&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;&amp;nbsp; INSERT INTO
keywords&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; VALUES
(:NEW.image_id, keywords_holder(the_keyword));&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;&amp;nbsp;&amp;nbsp; END;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; END IF;&lt;br /&gt;
END;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Once we&#39;ve created this INSTEAD OF trigger, we can insert a record into
this object view (and hence into &lt;i&gt;both&lt;/i&gt; underlying tables) quite easily
using: &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;INSERT
INTO images_v VALUES (Image_t(41265, &#39;pigpic.jpg&#39;, &#39;JPG&#39;, 824,&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Keyword_tab_t(&#39;PIG&#39;, &#39;BOVINE&#39;, &#39;FARM
ANIMAL&#39;)));&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;This statement causes the INSTEAD OF trigger to fire, and as long as the
primary key value (image_id = 41265) does not already exist, the trigger will
insert the data into the appropriate tables. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 5pt 0in;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 9pt;&quot;&gt;Similarly, we can write additional triggers that handle updates and
deletes. These triggers use the predictable clauses INSTEAD OF UPDATE and
INSTEAD OF DELETE. &lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;180.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/47223&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;what is the difference between database trigger and application trigger?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Database triggers are backend
triggeres and perform as any event occurs on databse level (ex.
Inset,update,Delete e.t.c)&amp;nbsp;wheras application triggers are froentend
triggers and perform as any&amp;nbsp;event taken on application level (Ex. Button
Pressed, New Form Instance e.t.c)&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;185.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/49294&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Compare EXISTS and IN Usage with advantages and disadvantages. &lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;exist is faster than IN Command&lt;br /&gt;
&lt;br /&gt;
exist do full table scan...so it is faster than IN&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Use Exists whenever possible.
EXISTS only checks the existence of records (True/False),Â&amp;nbsp;andÂ&amp;nbsp;in
the case ofÂ&amp;nbsp;IN each andÂ&amp;nbsp;every records willÂ&amp;nbsp;be
checked.Â&amp;nbsp;Â&amp;nbsp;performace wiseÂ&amp;nbsp;EXISTS is better.&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;189.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/52401&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Which type of binding does PL/SQL use?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;it uses latebinding so only we
cannot use ddl staments directly&lt;br /&gt;
it uses dynamicbinding&lt;/span&gt;&lt;br /&gt;


&lt;b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;191.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.geekinterview.com/question_details/52835&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: 9pt; line-height: 115%;&quot;&gt;Why DUAL table is not visible?&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;span&gt;Because its a dummy table.&lt;/span&gt;&lt;br /&gt;


&lt;br /&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/5214602828704989731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/plsql-interview-questions.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5214602828704989731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5214602828704989731'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/plsql-interview-questions.html' title='PL/SQL Interview Questions'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4758846885014782254.post-5291766533983375781</id><published>2011-12-19T19:47:00.001+05:30</published><updated>2011-12-19T19:47:31.246+05:30</updated><title type='text'>How do you identify existing rows of data in the target table using lookup transformation?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 10pt;&quot;&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;&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;&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;&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&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;How do
you identify existing rows of data in the target table using lookup
transformation?&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue; font-family: Cambria; font-size: 11pt;&quot;&gt;Solution:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;There are
two ways to lookup the target table to verify a row exists or not:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;1. Use
connect dynamic cache lookup and then check the values of NewLookuprow Output
port to decide whether the incoming record already exists in the table / cache
or not.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Cambria; font-size: 11pt;&quot;&gt;2. Use
Unconnected lookup and call it from an expression transformation and check the
Lookup condition port value (Null/ Not Null) to decide whether the incoming
record already exists in the table or not.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none double; border-width: medium medium 2.25pt; padding: 0in 0in 1pt;&quot;&gt;


&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://informaticasolutios.blogspot.com/feeds/5291766533983375781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-do-you-identify-existing-rows-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5291766533983375781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4758846885014782254/posts/default/5291766533983375781'/><link rel='alternate' type='text/html' href='http://informaticasolutios.blogspot.com/2011/12/how-do-you-identify-existing-rows-of.html' title='How do you identify existing rows of data in the target table using lookup transformation?'/><author><name>Prafull Dangore</name><uri>http://www.blogger.com/profile/16478822012475013852</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGoaKGlC7u9gfKBSmpZiW8r4XnIkHjTeGQIPZ-Y0V1BY1iuNTE2ol-KfnJRzClHr61MY9hqeuLPY7g52S_xacnGaWEFYzmCICY4y_NYFBYcCqaHyuZM-iUjiGsgke-wQ/s220/173685_100000811314903_259741_q.jpg'/></author><thr:total>0</thr:total></entry></feed>