<?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-1184758576751747672</id><updated>2025-08-04T12:28:29.691-07:00</updated><title type='text'>Technical Blog</title><subtitle type='html'>Hello Everybody........&#xa;With this blog, you can find solutions to some frequently faced technical issues mostly in C#.NET, ASP.NET, Oracle, SQL, PL/SQL, Java and Database&#xa;Also this blog contains cute articles, tutorials, and some contributions which may be helpful.... &#xa;Happy Reading :-)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-6143958604542672898</id><published>2012-02-22T22:39:00.000-08:00</published><updated>2012-03-10T22:08:33.806-08:00</updated><title type='text'>Oracle: Display Multiple Records in One Row....</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;Trebuchet MS&#39;; font-size: 11px; line-height: 15px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;font: normal normal normal 18px/normal Arial, Tahoma, Helvetica, FreeSans, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; position: relative;&quot;&gt;
&lt;a href=&quot;http://prasadaknair.blogspot.com/2012/02/display-multiple-records-in-one-row-in.html&quot; style=&quot;color: #336699; font-family: &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;; font-size: 12px; font-weight: bold; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;Oracle: Display Multiple Records in One Row&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;color: #999999; line-height: 1.6; margin-bottom: 1.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-6143958604542672898&quot; style=&quot;font-size: 12px; line-height: 1.4; position: relative; width: 548px;&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;Solutions for “&lt;/span&gt;&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;i&gt;ORA-01427: single-row subquery returns more than one row&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;”&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Recently I got the oracle exception “&lt;i&gt;ORA-01427: single-row subquery returns more than one row&lt;/i&gt;”, when I tried to execute one of my SQL queries in Oracle which contains another sub query. After googling the root cause and possible ways, I was able to figure out the culprit rows that makes this error.&amp;nbsp; The solutions I found are described below;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Actually,&amp;nbsp;&lt;b&gt;this is also a solution to display multiple records in one row in Oracle…..&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Let us first reproduce the above error with simple example; say, I have two tables with the following details;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;


&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableLightGridAccent5&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid #4BACC6 1.0pt; mso-border-themecolor: accent5; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;mso-yfti-firstrow: yes; mso-yfti-irow: -1;&quot;&gt;
  &lt;td style=&quot;border-bottom: solid #4BACC6 2.25pt; border: solid #4BACC6 1.0pt; mso-border-bottom-themecolor: accent5; mso-border-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;&quot; valign=&quot;top&quot; width=&quot;148&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 5; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #943634; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;TableName&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #4BACC6 2.25pt; border-left: none; border-right: solid #4BACC6 1.0pt; border-top: solid #4BACC6 1.0pt; mso-border-bottom-themecolor: accent5; mso-border-left-alt: solid #4BACC6 1.0pt; mso-border-left-themecolor: accent5; mso-border-right-themecolor: accent5; mso-border-top-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 2.5in;&quot; valign=&quot;top&quot; width=&quot;240&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 1; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #943634; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;ColumnNames&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;background: #D2EAF1; border-top: none; border: solid #4BACC6 1.0pt; mso-background-themecolor: accent5; mso-background-themetint: 63; mso-border-themecolor: accent5; mso-border-top-alt: solid #4BACC6 1.0pt; mso-border-top-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;&quot; valign=&quot;top&quot; width=&quot;148&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 68; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span courier=&quot;&quot; new&#39;&quot;,&quot;serif&quot;;mso-fareast-font-family:=&quot;&quot; new=&quot;&quot; roman&quot;;color:navy&#39;=&quot;&quot; roman&quot;;mso-bidi-font-family:&quot;times=&quot;&quot; style=&quot;font-family: &amp;quot;; font-size: 10.0pt;&quot; times=&quot;&quot;&gt;tblStudent&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #D2EAF1; border-bottom: solid #4BACC6 1.0pt; border-left: none; border-right: solid #4BACC6 1.0pt; border-top: none; mso-background-themecolor: accent5; mso-background-themetint: 63; mso-border-bottom-themecolor: accent5; mso-border-left-alt: solid #4BACC6 1.0pt; mso-border-left-themecolor: accent5; mso-border-right-themecolor: accent5; mso-border-top-alt: solid #4BACC6 1.0pt; mso-border-top-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 2.5in;&quot; valign=&quot;top&quot; width=&quot;240&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 64; text-align: center;&quot;&gt;
&lt;span courier=&quot;&quot; new&#39;&quot;,&quot;serif&quot;;mso-fareast-font-family:=&quot;&quot; new=&quot;&quot; roman&quot;;color:navy&#39;=&quot;&quot; roman&quot;;mso-bidi-font-family:&quot;times=&quot;&quot; style=&quot;font-family: &amp;quot;; font-size: 10.0pt;&quot; times=&quot;&quot;&gt;studentid,studentname,studentage&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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;border-top: none; border: solid #4BACC6 1.0pt; mso-border-themecolor: accent5; mso-border-top-alt: solid #4BACC6 1.0pt; mso-border-top-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 110.7pt;&quot; valign=&quot;top&quot; width=&quot;148&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 132; text-align: center;&quot;&gt;
&lt;b&gt;&lt;span background:white&#39;=&quot;&quot; courier=&quot;&quot; new&#39;&quot;,&quot;serif&quot;;mso-fareast-font-family:=&quot;&quot; new=&quot;&quot; roman&quot;;color:navy;=&quot;&quot; roman&quot;;mso-bidi-font-family:&quot;times=&quot;&quot; style=&quot;font-family: &amp;quot;; font-size: 10.0pt;&quot; times=&quot;&quot;&gt;tblCourse&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;border-bottom: solid #4BACC6 1.0pt; border-left: none; border-right: solid #4BACC6 1.0pt; border-top: none; mso-border-bottom-themecolor: accent5; mso-border-left-alt: solid #4BACC6 1.0pt; mso-border-left-themecolor: accent5; mso-border-right-themecolor: accent5; mso-border-top-alt: solid #4BACC6 1.0pt; mso-border-top-themecolor: accent5; padding: 0in 5.4pt 0in 5.4pt; width: 2.5in;&quot; valign=&quot;top&quot; width=&quot;240&quot;&gt;
  &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-yfti-cnfc: 128; text-align: center;&quot;&gt;
&lt;span courier=&quot;&quot; new&#39;&quot;,&quot;serif&quot;;mso-fareast-font-family:=&quot;&quot; new=&quot;&quot; roman&quot;;color:navy&#39;=&quot;&quot; roman&quot;;mso-bidi-font-family:&quot;times=&quot;&quot; style=&quot;font-family: &amp;quot;; font-size: 10.0pt;&quot; times=&quot;&quot;&gt;studentid,coursename&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;The simple select query from the above table’s&amp;nbsp;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 14px;&quot;&gt;tblStudent&amp;nbsp;&lt;/span&gt;and&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 14px;&quot;&gt;&amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-color: white; background-image: initial;&quot;&gt;tblCourse&lt;/span&gt;&lt;/span&gt;&amp;nbsp;will result;&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableMediumGrid2Accent1&quot; style=&quot;background-attachment: initial; background-color: #b8cce4; background-image: initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; width: 527px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 395.55pt;&quot; valign=&quot;top&quot; width=&quot;527&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 34.9pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -34.9pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SQL&amp;gt; select t1.studentid, t1.studentname, t1.studentage from &amp;nbsp;tblStudent t1;&lt;o:p&gt;&lt;/o:p&gt;&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; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;STUDENTID &amp;nbsp;&amp;nbsp;STUDENTNAME&amp;nbsp;&amp;nbsp; STUDENTAGE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;--------- &amp;nbsp;&amp;nbsp;-----------&amp;nbsp;&amp;nbsp; ----------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;STUDENT:10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;o:p&gt;&lt;/o:p&gt;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;10 rows selected&lt;o:p&gt;&lt;/o:p&gt;&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 395.55pt;&quot; valign=&quot;top&quot; width=&quot;527&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SQL&amp;gt; select t2.studentid, t2.coursename from tblCourse t2;&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; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;STUDENTID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSENAME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;---------&amp;nbsp;&amp;nbsp;&amp;nbsp; -----------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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; COURSE:1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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; COURSE:2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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; COURSE:3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&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; COURSE:4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;COURSE:5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSE:6&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSE:7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSE:8&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSE:9&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 45pt; margin-right: 0in; margin-top: 0in; text-align: justify; text-indent: -13.5pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COURSE:10&lt;o:p&gt;&lt;/o:p&gt;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;10 rows selected&lt;o:p&gt;&lt;/o:p&gt;&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;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;Now if I want to retrieve information of particular “Course” for the students within certain criteria, I will throw the below query.&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;LightShading-Accent1&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #b8cce4; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-style: solid; border-bottom-width: 1pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: rgb(79, 129, 189); border-top-style: solid; border-top-width: 1pt; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 405.15pt;&quot; valign=&quot;top&quot; width=&quot;540&quot;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;select studentId as Student_Id,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;studentname as Student_Name,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;select t2.coursename from tblCourse t2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; where t2.studentid = studentid&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;) as Student_Course&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;from&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; select t1.studentid, t1.studentname, t1.studentage&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp;from tblStudent t1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;where t1.studentid &amp;lt;= 5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&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;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;Here we are using the sub-query “&lt;span style=&quot;background-attachment: initial; background-color: white; background-image: initial; color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;select t2.coursename from tblCourse t2 where t2.studentid = studentid”&lt;/span&gt;&amp;nbsp;to find out the course details.&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;a name=&#39;more&#39;&gt;&lt;/a&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;text-align: justify;&quot;&gt;
As you already know, this sub-query to will result in returning multiple rows. So on executing the above query, the oracle exception “&lt;b&gt;&lt;i&gt;ORA-01427”&amp;nbsp;&lt;/i&gt;&lt;/b&gt;will be returned&lt;b&gt;&lt;i&gt;.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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/AVvXsEir19JgasuXgGf2FQLEnLoFkDZzw9JtGcu4u-0ImOwV6VoDkKERVtNnFYEV1ubyS6AhPuxMJQV7Y6SQ8RNUAWveQXbdp2ceQTmFlaSccetU4TDbi-61tcvlUAOAQtb008wC2LJCDLj7khQZ/s1600/ORA-01427.png&quot; imageanchor=&quot;1&quot; style=&quot;color: #336699; font-family: &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;; font-size: 12px; font-weight: bold; margin-left: 1em; margin-right: 1em; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir19JgasuXgGf2FQLEnLoFkDZzw9JtGcu4u-0ImOwV6VoDkKERVtNnFYEV1ubyS6AhPuxMJQV7Y6SQ8RNUAWveQXbdp2ceQTmFlaSccetU4TDbi-61tcvlUAOAQtb008wC2LJCDLj7khQZ/s1600/ORA-01427.png&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial; position: relative;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
As a fix, I can use the condition “&lt;span style=&quot;background-attachment: initial; background-color: white; background-image: initial; color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 14px;&quot;&gt;and rownum = 1&lt;/span&gt;” to meet my requirement. But if suppose I want to know/display all the students with their course name from that sub-query… then?????&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Yes. It’s possible to display multiple records in row with the following approaches.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;Approach 1: Using WM_CAT in Workspace manager&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
In oracle 10g onwards, WM_SYS schema package uses STRAGG for work space management (&lt;a href=&quot;http://docs.oracle.com/cd/B19306_01/appdev.102/b14253/long_intro.htm&quot; style=&quot;color: #336699; font-family: &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;; font-size: 12px; font-weight: bold; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;http://docs.oracle.com/cd/B19306_01/appdev.102/b14253/long_intro.htm&lt;/a&gt;&amp;nbsp;).&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
We can use “WM_CAT” utility to concat the student details with course name in the above sub query. That is;&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;LightShading-Accent1&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #b8cce4; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 89.9pt;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-style: solid; border-bottom-width: 1pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: rgb(79, 129, 189); border-top-style: solid; border-top-width: 1pt; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; height: 89.9pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 385.95pt;&quot; valign=&quot;top&quot; width=&quot;515&quot;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SQL&amp;gt; select wmsys.wm_concat(t2.coursename) from tblCourse t2 ;&lt;o:p&gt;&lt;/o:p&gt;&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;WMSYS.WM_CONCAT(T2.COURSENAME)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;-------------------------------------------------------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;COURSE:1,COURSE:2,COURSE:3,COURSE:4,COURSE:5,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;COURSE:6,COURSE:7,COURSE:8&lt;o:p&gt;&lt;/o:p&gt;&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;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;u&gt;Approach 2: Using the analytical function ROW_NUMBER()&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
ROW_NUMBER is an analytic function. It assigns a unique number to each row to which it is applied (either each row in the partition or each row returned by the query), in the ordered sequence of rows specified in the order_by_clause, beginning with 1. Refer oracle site&lt;a href=&quot;http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions137.htm&quot; style=&quot;color: #336699; font-family: &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;; font-size: 12px; font-weight: bold; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;&lt;b&gt;http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions137.htm&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;u&gt;&amp;nbsp;&lt;/u&gt;&lt;/b&gt;for more details.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
This approach is explained below with an example;&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;LightShading-Accent1&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #b8cce4; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-style: solid; border-bottom-width: 1pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: rgb(79, 129, 189); border-top-style: solid; border-top-width: 1pt; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 394.2pt;&quot; valign=&quot;top&quot; width=&quot;526&quot;&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;&quot;&gt;
&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid,&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;LTRIM&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(SYS_CONNECT_BY_PATH(coursename,&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; 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: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;(&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SELECT&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid,&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;coursename,&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: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ROW_NUMBER()&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;OVER&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;PARTITION&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;ORDER BY&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; 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;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;coursename )&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;seq&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: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FROM&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;tblCourse&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;o:p&gt;&lt;/o:p&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: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;connect_by_isleaf =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&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: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CONNECT&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;seq =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;PRIOR&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;seq +&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;PRIOR&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;START&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;seq =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;color: #365f91;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&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;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;u&gt;Approach 3: Using the AGGREAGE function XMLAgg ()&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
XMLAgg is an aggregate function provided by oracle in connection with XML related operations. Please refer&amp;nbsp;&lt;a href=&quot;http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions215.htm&quot; style=&quot;color: #336699; font-family: &#39;Lucida Grande&#39;, &#39;Trebuchet MS&#39;; font-size: 12px; font-weight: bold; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions215.htm&lt;/a&gt;&amp;nbsp;for more details. The original query can be rewritten with “XMLAgg” in the following way;&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;LightShading-Accent1&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: #b8cce4; background-image: initial; background-position: initial initial; background-repeat: initial; border-bottom-style: none; border-collapse: collapse; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-style: solid; border-bottom-width: 1pt; border-left-color: initial; border-left-style: none; border-left-width: initial; border-right-color: initial; border-right-style: none; border-right-width: initial; border-top-color: rgb(79, 129, 189); border-top-style: solid; border-top-width: 1pt; font-family: &#39;Trebuchet MS&#39;, Verdana, &#39;Book Antiqua&#39;, Georgia; font-size: 12px; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; text-align: justify; width: 401.85pt;&quot; valign=&quot;top&quot; width=&quot;536&quot;&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;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid&lt;o:p&gt;&lt;/o:p&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: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;RTRIM&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&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: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;XMLAGG&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;XMLELEMENT&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;(ele, coursename ||&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&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: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;ORDER BY&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;coursename).extract (&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&#39;//text()&#39;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&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: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&#39;,&#39;&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;CourseNames&lt;o:p&gt;&lt;/o:p&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: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;tblCourse&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&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;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GROUP&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;color: navy; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;studentid;&lt;o:p&gt;&lt;/o:p&gt;&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;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
With these alternatives we can show multiple results in a single row with oracle.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/6143958604542672898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/02/display-multiple-records-in-one-row-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/6143958604542672898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/6143958604542672898'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/02/display-multiple-records-in-one-row-in.html' title='Oracle: Display Multiple Records in One Row....'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir19JgasuXgGf2FQLEnLoFkDZzw9JtGcu4u-0ImOwV6VoDkKERVtNnFYEV1ubyS6AhPuxMJQV7Y6SQ8RNUAWveQXbdp2ceQTmFlaSccetU4TDbi-61tcvlUAOAQtb008wC2LJCDLj7khQZ/s72-c/ORA-01427.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-4639570293398436569</id><published>2012-01-24T02:41:00.001-08:00</published><updated>2012-03-18T00:29:10.138-07:00</updated><title type='text'>Weak Hash Map Example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Please find one simple example of usage of Weak Hash Map.&lt;br /&gt;
&lt;br /&gt;
import java.lang.ref.WeakReference;&lt;br /&gt;
import java.util.Iterator;&lt;br /&gt;
import java.util.Map;&lt;br /&gt;
import java.util.WeakHashMap;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
public class WeakHashMapExample {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;public static void main(String args[]) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;final Map&amp;lt;String, String&amp;gt; map = new WeakHashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;map.put(new String(&quot;A&quot;), &quot;B&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;Runnable runner = new Runnable() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void run() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while (map.containsKey(&quot;A&quot;)) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(&quot;map contains key A&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Thread.sleep(500);}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;catch (InterruptedException ignored) {}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//System.gc();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.keralamatrimony.com/register/registerform.php?aff=prasadaknair&quot; target=&quot;_blank&quot; border=&quot;0&quot;&gt;&lt;img src=&quot;http://imgs.bharatmatrimony.com/matrimoney/matrimoneybanners/banner110.gif&quot; border=0&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;Iterator it = map.keySet().iterator();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;while (it.hasNext()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Object key = it.next();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Object weakValue = map.get(key);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (weakValue == null) {System.out.println(&quot;Value has been garbage-collected&quot;);}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;else {System.out.println(&quot;Get value:&quot; + weakValue);} &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;Thread t = new Thread(runner);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;t.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;try {t.join();}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;catch (InterruptedException ignored) {}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/4639570293398436569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/weak-hash-map-exampl.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/4639570293398436569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/4639570293398436569'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/weak-hash-map-exampl.html' title='Weak Hash Map Example'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-8396620554117442758</id><published>2012-01-24T02:38:00.001-08:00</published><updated>2012-03-18T00:30:56.263-07:00</updated><title type='text'>Writing JDBC Applications with MySQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Please find one simple example of using JDBC with MySQL in java.&lt;br /&gt;
&lt;br /&gt;
import java.sql.Connection;&lt;br /&gt;
import java.sql.DriverManager;&lt;br /&gt;
import java.sql.PreparedStatement;&lt;br /&gt;
import java.sql.ResultSet;&lt;br /&gt;
import java.sql.SQLException;&lt;br /&gt;
import java.sql.Statement;&lt;br /&gt;
import java.util.Date;&lt;br /&gt;
&lt;br /&gt;
public class MySQLAccess {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private Connection connect = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private Statement statement = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private PreparedStatement preparedStatement = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private ResultSet resultSet = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//=====================================================&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void ReadDataBase() throws Exception {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// This will load the MySQL driver, each DB has its own driver&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Class.forName(&quot;com.mysql.jdbc.Driver&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Setup the connection with the DB&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;connect = DriverManager.getConnection(&quot;jdbc:mysql://localhost/testdb?&quot; + &amp;nbsp;user=user&amp;amp;password=pwd&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Statements allow to issue SQL queries to the database&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;statement = connect.createStatement();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Result set get the result of the SQL query&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;resultSet = statement.executeQuery(&quot;select * from testdb.testtable&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PrintResultSet(resultSet);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// PreparedStatements can use variables and are more efficient&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement = connect.prepareStatement(&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;                                                                       &lt;/span&gt; &amp;nbsp;insert into testtable values ( ?, ?, ?, ? , ?, ?)&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// Parameters start with 1&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.setString(1, &quot;va1ue1&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.setString(2, &quot;va1ue2&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.setString(3, &quot;value3&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.setDate(4, new java.sql.Date(2011, 01, 01));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.setString(5, &quot;value4&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement.executeUpdate();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;preparedStatement = connect.prepareStatement(&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;                                                            &lt;/span&gt;SELECT col1, col2, col3, col4 from testtable &quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;resultSet = preparedStatement.executeQuery();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PrintResultSet(resultSet);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; }catch (Exception e) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;throw e; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;finally { close();}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
private void PrintMetaData(ResultSet resultSet) throws SQLException {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// Result set get the result of the SQL query&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(&quot;The columns in the table are: &quot;);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(&quot;Table: &quot; + resultSet.getMetaData().getTableName(1));&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for &amp;nbsp;(int i = 1; i&amp;lt;= resultSet.getMetaData().getColumnCount();i++){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;System.out.println(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp;&quot;Column &quot; + i &amp;nbsp;+ &quot; &quot; + resultSet.getMetaData().getColumnName(i));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//=======================================================================&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;80&quot; scrolling=&quot;no&quot; src=&quot;http://profile.bharatmatrimony.com/matrimoney/searchwedget.php?creativeid=137&amp;amp;aff=prasadaknair&quot; width=&quot;488&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;
private void PrintResultSet(ResultSet resultSet) throws SQLException {&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp;// ResultSet is initially before the first data set&lt;br /&gt;
&amp;nbsp; &amp;nbsp; while (resultSet.next()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// It is possible to get the columns via name&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// also possible to get the columns via the column number&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// which starts at 1&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// e.g. resultSet.getSTring(2);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String val1 &amp;nbsp; &amp;nbsp;= resultSet.getString(1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String website = resultSet.getString(2);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String summery = resultSet.getString(3);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Date date &amp;nbsp; &amp;nbsp; &amp;nbsp;= resultSet.getDate(4);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String comment = resultSet.getString(5);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;val1: &quot; &amp;nbsp; &amp;nbsp;+ val1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;val2: &quot; + val2);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;val3: &quot; + val3);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;val4: &quot; &amp;nbsp; &amp;nbsp;+ val4);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
//=======================================================================&lt;br /&gt;
&lt;br /&gt;
// You need to close the result Set&lt;br /&gt;
private void close() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (resultSet != null) {resultSet.close();}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (statement != null) {statement.close();}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (connect != null) &amp;nbsp; {connect.close();}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/8396620554117442758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/writing-jdbc-applications-with-mysql.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/8396620554117442758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/8396620554117442758'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/writing-jdbc-applications-with-mysql.html' title='Writing JDBC Applications with MySQL'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-8444035087859942779</id><published>2012-01-20T19:02:00.001-08:00</published><updated>2012-01-22T09:51:47.518-08:00</updated><title type='text'>Using a DataReader Against an Oracle Stored Procedure</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Book Antiqua&#39;; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table74&quot; style=&quot;width: 530px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table84&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table bgcolor=&quot;#FFFFFF&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table88&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#FFFFFF&quot; style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table89&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; id=&quot;table90&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;Following code snippet uses the DataReader object to retrieve data from an Oracle stored procedure. You can use the DataReader to retrieve a read-only, forward-only stream of data from a database.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;subBlog&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Georgia, &#39;lucida console&#39;; font-size: 12px;&quot;&gt;
&lt;br /&gt;
Using the DataReader can increase application performance and reduce system overhead because only one row is ever in memory.&lt;/div&gt;
&lt;table style=&quot;background-color: #eeeeee;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;subCode&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 11pt; text-align: left; white-space: normal;&quot;&gt;&lt;code style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: initial; background-image: url(http://prasadaknair.100webspace.net/images/checkbox.gif); background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(60, 179, 113); border-bottom-width: 1px; border-left-color: rgb(60, 179, 113); border-left-width: 1px; border-right-color: rgb(60, 179, 113); border-right-width: 1px; border-style: initial; border-top-color: rgb(60, 179, 113); border-top-width: 1px; clear: both; color: darkblue; display: block; font-family: &#39;Trebuchet MS&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 9pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: nowrap; width: 480px;&quot;&gt;&lt;br /&gt;using(OracleConnection conn = new OracleConnection&lt;br /&gt;(@&quot;DataSource=source;User Id=username;Password=password;&quot;))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleCommand cmd = new OracleCommand();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Connection = conn;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandType = CommandType.StoredProcedure;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandText = &quot;StoredProcedureName&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Parameters.Add(&quot;Result&quot;,OracleType.Cursor).Direction =&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ParameterDirection.Output;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;conn.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleDataReader dataReader = cmd.ExecuteReader();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(dataReader .Read())&lt;br /&gt;&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;// do your logic here&lt;br /&gt;&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;conn.Close();&lt;br /&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/8444035087859942779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/using-datareader-against-oracle-stored.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/8444035087859942779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/8444035087859942779'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/using-datareader-against-oracle-stored.html' title='Using a DataReader Against an Oracle Stored Procedure'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-1679839350976439213</id><published>2012-01-20T19:01:00.000-08:00</published><updated>2012-02-15T20:56:36.999-08:00</updated><title type='text'>Populating OracleDataReader From REF CURSOR</title><content type='html'>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
    &lt;title&gt;Populating&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
        &lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table74&quot; style=&quot;width: 530px;&quot;&gt;
            &lt;tbody&gt;
                &lt;tr&gt;
                    &lt;td&gt;
                        &lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; id=&quot;table90&quot;&gt;
                            &lt;tbody&gt;
                                &lt;tr&gt;
                                    &lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;
                                        &lt;div class=&quot;subBlog&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Georgia, &#39;lucida console&#39;;
                                            font-size: 12px;&quot;&gt;
                                            A REF CURSOR data type can be obtained as an OracleDataReader object by calling
                                            theExecuteReader method of the OracleCommand object. The output parameter with the
                                            OracleDbType property set is bound to OracleDbType.RefCursor. None of the output
                                            parameters of type OracleDbType.RefCursor is populated after the ExecuteReader method
                                            is invoked.&lt;br /&gt;
                                            &lt;br /&gt;
                                            If there are multiple output REF CURSOR parameters, use the NextResult method of
                                            the OracleDataReader object to access the next REF CURSOR data type. The OracleDataReader
                                            NextResult method provides sequential access to the REF CURSOR data types; only
                                            one REF CURSOR data type can be accessed at a given time.&lt;br /&gt;
                                            &lt;br /&gt;
                                            The order in which OracleDataReader objects are created for the corresponding REF
                                            CURSOR data types depends on the order in which the parameters are bound. If a PL/SQL
                                            stored function returns a REF CURSOR data type, then it becomes the first OracleDataReader
                                            object and all the output REF CURSOR data types follow the order in which the parameters
                                            are bound.&lt;br /&gt;
                                            &lt;br /&gt;
                                            The following sample code will illustrate the usage.&lt;/div&gt;
                                        &lt;table style=&quot;background-color: #eeeeee;&quot;&gt;
                                            &lt;tbody&gt;
                                                &lt;tr&gt;
                                                    &lt;td class=&quot;subCode&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 11pt; text-align: left;
                                                        white-space: normal;&quot;&gt;
                                                        &lt;code&gt;using(OracleConnection conn = new OracleConnection(@&quot;DataSource = source;
                                                            User Id = username;Password = password;&quot;))&lt;br /&gt; {&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleCommand cmd = new OracleCommand();&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Connection = conn;&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandType = CommandType.StoredProcedure;&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandText = &quot;StoredProcedureName&quot;;&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Parameters.Add(&quot;REF_CURSOR_SAMPLE&quot;,
                                                            OracleType.RefCursor).Direction =&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ParameterDirection.Output;&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;conn.Open();&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleDataReader reader = cmd.ExecuteReader();&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;do&lt;br /&gt;
                                                            &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;while (oracleDataReader.Read())&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; for
                                                            (int i = 0; i &amp;lt; oracleDataReader.FieldCount; i++)&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; {&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;Console.WriteLine(&quot;Value is {0}&quot;, oracleDataReader.GetValue(i));&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; }&lt;br /&gt;
                                                            &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;}while (oracleDataReader.NextResult());&lt;br /&gt;
                                                            &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;conn.Close();&lt;br /&gt;
                                                            }&lt;/code&gt;&lt;/td&gt;
                                                &lt;/tr&gt;
                                            &lt;/tbody&gt;
                                        &lt;/table&gt;
                                    &lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/tbody&gt;
                        &lt;/table&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/1679839350976439213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/populating-oracledatareader-from-ref.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/1679839350976439213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/1679839350976439213'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/populating-oracledatareader-from-ref.html' title='Populating OracleDataReader From REF CURSOR'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-1127645075745091892</id><published>2012-01-20T18:58:00.001-08:00</published><updated>2012-03-18T00:36:00.595-07:00</updated><title type='text'>ODP.NET : Using Fetch Size against Ref Cursors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Book Antiqua&#39;; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;subHeader&quot; style=&quot;border-bottom-color: rgb(0, 74, 102); border-bottom-style: solid; border-bottom-width: 1px; color: #004a66; font-family: Arial; font-size: 18px; font-weight: bold; letter-spacing: 1px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;&quot;&gt;
&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table74&quot; style=&quot;width: 530px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table84&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table85&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table86&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table87&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table91&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;div align=&quot;left&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table92&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table bgcolor=&quot;#FFFFFF&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table88&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#FFFFFF&quot; style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table89&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; id=&quot;table90&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;We can increase the performance of our ODP.NET applications by controlling the fetch size of either OracleCommand or OracleDataReader. By controlling the fetch size (i.e. the amount of data fetched during each round-trip to the database) you can dramatically decrease (or increase!) the amount of time taken to fetch the data.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;subBlog&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Georgia, &#39;lucida console&#39;; font-size: 12px;&quot;&gt;
&lt;br /&gt;
However, if you are working with Ref Cursors rather than &quot;plain&quot; SQL statements, the ability to control the fetch size is not readily available. This is because the RowSize property of an OracleCommand object is set to 0 (zero) when working with PL/SQL code, as would be the case with Ref Cursor data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, if you have ever examined the members of the OracleDataReader in the debug window within Visual Studio, you may have noticed that the OracleDataReader does have a particularly non-public member named &quot;m_rowSize&quot; which just happens to represent the row size. If only you could access that value you could then easily set the FetchSize property on the OracleDataReader to a specific (meaningful) value rather than be forced to accept the default of 64KB (65536).&lt;br /&gt;
&lt;br /&gt;
As &quot;m_rowSize&quot; is a Non-Public member, you can’t just reference &quot;m_rowSize&quot; in your application code to retrieve this value. However, using the &quot;reflection&quot; capabilities of the .NET Framework, you can access this value. Once you have done that, you can set the value of the FetchSize property to whatever value is appropriate for your application.&lt;br /&gt;
&lt;br /&gt;
Please note that this technique is not a good coding approach, and, of course, if the &quot;m_rowSize&quot; member name should change, it would break any code using this technique.&lt;br /&gt;
&lt;br /&gt;
The following sample code will illustrate the use of fetchsize in the case of Ref Cursors.&lt;/div&gt;
&lt;table style=&quot;background-color: #eeeeee;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;subCode&quot; style=&quot;font-family: &#39;Courier New&#39;; font-size: 11pt; text-align: left; white-space: normal;&quot;&gt;&lt;code style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: initial; background-image: url(http://prasadaknair.100webspace.net/images/checkbox.gif); background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(60, 179, 113); border-bottom-width: 1px; border-left-color: rgb(60, 179, 113); border-left-width: 1px; border-right-color: rgb(60, 179, 113); border-right-width: 1px; border-style: initial; border-top-color: rgb(60, 179, 113); border-top-width: 1px; clear: both; color: darkblue; display: block; font-family: &#39;Trebuchet MS&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 9pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: nowrap; width: 480px;&quot;&gt;using(OracleConnection conn = new OracleConnection&lt;br /&gt;(@&quot;DataSource=source;User Id=username;Password=password;&quot;))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleCommand cmd = new OracleCommand();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Connection = conn;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandType = CommandType.StoredProcedure;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.CommandText = &quot;StoredProcedureName&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cmd.Parameters.Add(&quot;REF_CURSOR_SAMPLE&quot;,OracleType.RefCursor).Direction =&amp;nbsp;&amp;nbsp;ParameterDirection.Output;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;conn.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OracleDataReader reader = cmd.ExecuteReader();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FieldInfo fieldInfo = reader.GetType().GetField(&quot;m_rowSize&quot;, BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int cmdRowSize = (int)fieldInfo.GetValue(reader);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;reader.FetchSize = cmdRowSize * noOfRowsExpected;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while(reader.Read())&lt;br /&gt;&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; // do your logic here&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;conn.Close();&lt;br /&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/1127645075745091892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/odpnet-ref-cursors-and-fetch-size.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/1127645075745091892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/1127645075745091892'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/odpnet-ref-cursors-and-fetch-size.html' title='ODP.NET : Using Fetch Size against Ref Cursors'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1184758576751747672.post-6329653384266375479</id><published>2012-01-20T18:48:00.001-08:00</published><updated>2012-02-15T20:40:32.727-08:00</updated><title type='text'>How to Change Color of Tab Control in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div align=&quot;center&quot; style=&quot;text-align: auto;&quot;&gt;
&lt;div align=&quot;left&quot; class=&quot;subHeader&quot; style=&quot;border-bottom-color: rgb(0, 74, 102); border-bottom-style: solid; border-bottom-width: 1px; color: #004a66; font-family: Arial; font-size: 18px; font-weight: bold; letter-spacing: 1px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 10px;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table74&quot; style=&quot;width: 530px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; id=&quot;table84&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table bgcolor=&quot;#FFFFFF&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table88&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#FFFFFF&quot; style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot; width=&quot;100%&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; id=&quot;table89&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; id=&quot;table90&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: &#39;Book Antiqua&#39;, Georgia; font-size: 12px; text-align: justify;&quot;&gt;&lt;div class=&quot;subBlog&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Georgia, &#39;lucida console&#39;; font-size: 12px;&quot;&gt;
As there is no properties to change foreground and back ground color of tab control, it can be done by overriding the DrawItem event of the control.&lt;br /&gt;
Following are the steps involved to do the same.&lt;br /&gt;
&lt;br /&gt;
1. Set the TabControl&#39;s DrawMode to OwnerDrawMode&lt;br /&gt;
2. Handle the DrawItem event to draw things.&lt;br /&gt;
&lt;br /&gt;
Please see the following example;&lt;br /&gt;
&lt;br /&gt;
&lt;code style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-color: initial; background-image: url(http://prasadaknair.100webspace.net/images/checkbox.gif); background-position: initial initial; background-repeat: initial; border-bottom-color: rgb(60, 179, 113); border-bottom-width: 1px; border-left-color: rgb(60, 179, 113); border-left-width: 1px; border-right-color: rgb(60, 179, 113); border-right-width: 1px; border-style: initial; border-top-color: rgb(60, 179, 113); border-top-width: 1px; clear: both; color: darkblue; display: block; font-family: &#39;Trebuchet MS&#39;, &#39;Courier New&#39;, monospace, sans-serif; font-size: 9pt; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; text-align: left; white-space: nowrap; width: 480px;&quot;&gt;private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)&lt;br /&gt;{&lt;br /&gt;//get tabpage&lt;br /&gt;TabPage tabPages = tabControl1.TabPages[e.Index];&lt;br /&gt;Graphics graphics = e.Graphics;&lt;br /&gt;Brush textBrush = new SolidBrush(Color.Green); //fore color brush&lt;br /&gt;Rectangle tabBounds = tabControl1.GetTabRect(e.Index);&lt;br /&gt;if (e.State == DrawItemState.Selected)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; graphics.FillRectangle(Brushes.SkyBlue, e.Bounds); //fill background color&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;textBrush = new System.Drawing.SolidBrush(e.ForeColor);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.DrawBackground();&lt;br /&gt;}&lt;br /&gt;Font tabFont = new Font(&quot;Book Antiqua&quot;, 12, FontStyle.Italic | FontStyle.Bold, GraphicsUnit.Pixel);&lt;br /&gt;StringFormat strFormat = new StringFormat();&lt;br /&gt;strFormat.Alignment = StringAlignment.Near;&lt;br /&gt;strFormat.LineAlignment = StringAlignment.Near;&lt;br /&gt;// draw text&lt;br /&gt;graphics.DrawString(tabPages.Text, tabFont, textBrush, tabBounds, new StringFormat(strFormat));&lt;br /&gt;graphics.Dispose();&lt;br /&gt;textBrush.Dispose();&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadaknair.blogspot.com/feeds/6329653384266375479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/how-to-change-color-of-tab-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/6329653384266375479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1184758576751747672/posts/default/6329653384266375479'/><link rel='alternate' type='text/html' href='http://prasadaknair.blogspot.com/2012/01/how-to-change-color-of-tab-control.html' title='How to Change Color of Tab Control in C#'/><author><name>Prasad</name><uri>http://www.blogger.com/profile/00436616476691884250</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>