tag:blogger.com,1999:blog-23568707539290064272024-03-08T00:50:58.347-06:00ArpitArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.comBlogger59125tag:blogger.com,1999:blog-2356870753929006427.post-89063286977544263532013-08-28T17:56:00.005-05:002013-08-28T17:56:53.030-05:00Unix sed: Modify xml file or move characters around<span style="font-family: Arial, Helvetica, sans-serif;">Following example can be used when we want to move characters around in the file based on xml tags or other character prefixes.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I wanted to remove sequencenumber tag along with value within tags from following line. I also wanted to move tags salary and suffix to first position after begin.</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><begin><sequencenumber>101886122</sequencenumber><prefix></prefix><firstname>arpit</firstname><id>23452345</id><last>shah</last><salary>116056</salary><suffix>III</suffix></begin></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Following script can help:</span><br />
<span style="font-family: Courier New, Courier, monospace;">$ sed 's:\(<begin>\)\(<sequencenumber>.*</sequencenumber>\)\(<prefix>.*last>\)\(<salary>.*suffix>\)\(.*\):\1\4\3\5:' a</salary></prefix></begin></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><begin><salary>116056</salary><suffix>III</suffix><prefix></prefix><firstname>arpit</firstname><id>23452345</id><last>shah</last></begin> </span>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-49141446555346208132013-01-11T11:34:00.003-06:002013-01-11T11:34:28.695-06:00<br />
<header class="entry-header" style="-webkit-hyphens: auto; background-color: white; color: #404040; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 22px; word-wrap: break-word;"><h1 class="entry-title" style="border: 0px; clear: both; font-family: inherit; font-size: 22px; font-style: inherit; margin: 20px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
My (Arpit's) Art of Living Experience in Initial Days</h1>
</header><div class="entry-content" style="-webkit-hyphens: auto; background-color: white; border: 0px; color: #404040; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 22px; margin: 1.5em 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;">
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://aolbama.files.wordpress.com/2013/01/resisting.gif" style="border: 0px; color: #26ade4; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><img alt="Image" class="size-full wp-image" id="i-24" src="http://aolbama.files.wordpress.com/2013/01/resisting.gif?w=369" style="border: 0px; height: auto; max-width: 100%;" /></a></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A lucky break (or, really, drag)</strong></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
What’s incredible about my story is that my friend dragged me along to this course, which I had no intention of attending, but then, somehow, I liked it. And he…didn’t. Fast forward to now, and I have no idea what my life would be like without it had he not done that that day. What an unrepayable debt I owe to him!! I’m actually not sure if he’s done it yet or not – I will have to check and make him do it soon : ).</div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://aolbama.files.wordpress.com/2013/01/sneezing.gif" style="border: 0px; color: #26ade4; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><img alt="Image" class="size-full wp-image" id="i-28" src="http://aolbama.files.wordpress.com/2013/01/sneezing.gif?w=580" style="border: 0px; height: auto; max-width: 100%;" /></a></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Pray, don’t spray</strong></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
All was well — for a while. The course was going fine, but when I started doing that vigorous breathing exercise (what did they call it?), snot came flying out of my nose in ridiculous quantities. I was worried!!! What would the people around me think? It is actually a miracle, in retrospect, that I stuck with it through all that. But, I guess with the power of the Kriya and pranayams, don’t you know it, in a couple of months, it went away!!!</div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<a href="http://aolbama.files.wordpress.com/2013/01/nervous.jpg" style="border: 0px; color: #26ade4; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><img alt="Image" class="size-full wp-image" id="i-33" src="http://aolbama.files.wordpress.com/2013/01/nervous.jpg?w=297" style="border: 0px; height: auto; max-width: 100%;" /></a></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Tongue (and body)-tied</strong></div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
One thing that I noticed after the course was that I was able to speak. Not that I wasn’t able to speak before – I’m talking about <i>giving speeches</i>. When I used to do it, I would shake like crazy, jumble up my words like I didn’t know my own language, and rush through it, barely enunciating and hardly giving anyone a chance to hear or think. But somehow, after some simple body-breath-coordination exercises, it was gone – not completely, but a lot. Before, when I would give presentations for whatever reason in school, I would always rank near the bottom – I don’t even know how low, they didn’t tell me (probably good, to save my feelings). But the first time I spoke after the course, I got third out of a large group!!!! AMAZING!!!!</div>
<div style="border: 0px; font-family: inherit; font-style: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
Above mentioned is true. I had help of Great writer Sanjay Kapoor in writing and adding images. Thanks Sanjay!</div>
</div>
Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com2tag:blogger.com,1999:blog-2356870753929006427.post-27832292290950158262012-10-01T10:26:00.000-05:002012-10-01T10:26:04.682-05:00My Aunt Polly Game<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; mso-border-alt: solid #DDDDDD .75pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr>
<td style="border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Likes<o:p></o:p></span></div>
</td>
<td style="border-left: none; border: solid #DDDDDD 1.0pt; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Dislikes<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Soccer,
Football<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Cricket<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Nashville<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Mt
Juliet<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Trees<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Plants<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Moon<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Stars<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Speed<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Fast<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Food<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Eat<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Tennessee<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Kentucky<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Jeff,
Willie<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Everybody
else<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Glass<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Window<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid #DDDDDD 1.0pt; mso-border-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Beer<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid #DDDDDD 1.0pt; border-left: none; border-right: solid #DDDDDD 1.0pt; border-top: none; min-width: 0.6em; mso-border-alt: solid #DDDDDD .75pt; mso-border-left-alt: solid #DDDDDD .75pt; mso-border-top-alt: solid #DDDDDD .75pt; padding: 3.75pt 5.25pt 3.75pt 5.25pt;" valign="top">
<div class="MsoNormal">
<span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">Wine<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<br />
For secret of the game, please scroll down.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
My aunt Polly like each word with double letters.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-37467306595354796962012-05-01T16:41:00.003-05:002012-05-01T16:41:56.904-05:00Query to find unused (not referenced in other DB packages, procedures, function) packageFollowing query can be used to find unused (not referenced in other DB packages, procedures, function) packages. Packages can still be used in DBMS Jobs / Scheduler Jobs / Application
select distinct owner || '.' || name
from dba_DEPENDENCIES
where name in (
select referenced_name
from dba_DEPENDENCIES
where type != 'SYNONYM'
and owner in ('SCOTT', 'SCOTT2')
group by referenced_name
having count(*) = 1)
and owner in ('SCOTT', 'SCOTT2')
and type in ('PACKAGE BODY', 'PACKAGE')
order by 1Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-50961522560492981002012-04-27T18:51:00.001-05:002012-05-07T13:52:45.984-05:00Oracle ACL Error Resolution:ORA-24247: network access denied by access control list (ACL)<br />
We were often seeing following network ACL error.<br />
<br />
ORA-24247: network access denied by access control list (ACL)<br />
<br />
Query to check for existing ACLs.<br />
SELECT NACL.ACLID,ACL, PRINCIPAL<br />
FROM DBA_NETWORK_ACLS NACL, XDS_ACE ACE<br />
WHERE NACL.ACLID = ACE.ACLID ;<br />
<br />
We had to run following steps to resolve the issue.<br />
<br />
<br />
EXEC DBMS_NETWORK_ACL_ADMIN.DROP_ACL(acl => 'mails.xml' );<br />
<br />
<br />
EXEC DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl => 'mails.xml', description => 'Mail ACL', principal => 'SCOTT', is_grant => TRUE, PRIVILEGE => 'connect');<br />
Principal ==> says which schema will primarily own the ACL<br />
is_grant => TRUE will allow other schema in DB to access this ACL (this line needs verification)<br />
<br />
BEGIN<br />
DBMS_NETWORK_ACL_ADMIN.add_privilege (acl => 'mails.xml',<br />
principal => 'SCOTT', --Schema name<br />
is_grant => TRUE, --same as above<br />
PRIVILEGE => 'connect',<br />
position => NULL,<br />
start_date => SYSTIMESTAMP,<br />
end_date => NULL);<br />
<br />
COMMIT;<br />
END;<br />
/<br />
<br />
<br />
EXEC DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL ( acl => 'mails.xml', HOST => 'mailhost', lower_port => 21, upper_port => 30);<br />
<br />
BEGIN<br />
DBMS_NETWORK_ACL_ADMIN.add_privilege (acl => 'mails.xml',<br />
principal => 'SCHEMA2',<br />
is_grant => TRUE,<br />
PRIVILEGE => 'connect',<br />
position => NULL,<br />
start_date => SYSTIMESTAMP,<br />
end_date => NULL);<br />
<br />
COMMIT;<br />
END;<br />
/<br />
<br />
For more details: http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htmArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-13211535472799456042012-04-27T18:39:00.000-05:002012-04-27T18:39:14.857-05:00Parallel HintSELECT /*+ PARALLEL(a) */ COUNT(*) FROM ABCD a ;
<br />
<br />Parallel Hint makes operation faster. It does so by providing more threads to the current SQL statement. Not advisable to run in Production Environment during Peak Hours.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-49620889003337695182012-01-25T17:03:00.002-06:002012-01-25T17:09:01.622-06:00Oracle Unique Constraint sys.i_procedure1 violated while creating packageRecently I faced issue in Oracle 11g, where after dropping a package, I was not able to recreate it. Recreating package was giving error, Unique Constraint (sys.i_procedure1) violated.<br /><br />It was an issue with Oracle Dictionary table not getting updated while dropping package.<br /><br />DBAs had to take following steps to resolve the issue.<br /><br />select * from obj$ where name = 'PACK1' ;<br /><br />select * from user$ where name = 'ABC' ; --This query is to get owner#, which can be joined with obj$<br /><br />After getting obj#, we had to delete that object from 3 tables.<br /><br />procedure$, source$ and obj$.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com1tag:blogger.com,1999:blog-2356870753929006427.post-58433084936743176752011-12-08T15:07:00.001-06:002011-12-08T15:08:24.201-06:00Oracle XML to TABLE using XMLTABLEQuery:<br /> SELECT seq<br /> , ID<br /> , NAME<br /> FROM XMLTABLE('/xml/emp'<br /> PASSING XMLTYPE('<xml><emp id="3"><name>Arpit</name></emp><emp id="4"><name>Venkat</name></emp></xml>')<br /> COLUMNS seq FOR ORDINALITY<br /> , ID VARCHAR2(3) PATH '@id'<br /> , NAME varchar2(10) path 'name'<br /> ) AS tbl<br /><br />Output:<br /> SEQ ID NAME<br />---------- --- ----------<br /> 1 3 Arpit<br /> 2 4 VenkatArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-72669328158791288062011-01-28T13:12:00.002-06:002011-01-28T13:15:32.740-06:00Escape / (Forward Slash) in Oracle SQL*PlusEscape / (Forward Slash) in Oracle SQL*Plus <br /><br /><span style="font-weight:bold;">Problem:</span><br />I am running following anonymous block and it's giving error. It's because SQL Plus is considering forward slash (/) in variable "a" assignment as block terminator. How to escape that? The use of following block is to store test case in Database. This is simple example real test cases are complex and involve print after /.<br />DECLARE<br /> A varchar2(1024) := NULL;<br />BEGIN<br /> A := 'set serveroutput on;<br />BEGIN<br /> INSERT INTO table_name<br /> VALUES (5067);<br />END ;<br />/ <br /> <br />' ;<br /> INSERT INTO x VALUES (A) ;<br /> <br /> COMMIT ;<br />END ;<br />/ <br /><br />Output<br />SQL> DECLARE<br /> 2 A varchar2(1024) := NULL;<br /> 3 BEGIN<br /> 4 A := 'set serveroutput on;<br /> 5 BEGIN<br /> 6 INSERT INTO table_name<br /> 7 VALUES (5067);<br /> 8 END ;<br /> 9 / <br />ERROR:<br />ORA-01756: quoted string not properly terminated<br /> <br /> <br />SQL> <br />SQL> ' ;<br />SP2-0042: unknown command "' " - rest of line ignored.<br />SQL> INSERT INTO x VALUES (A) ;<br /> INSERT INTO x VALUES (A)<br /> *<br />ERROR at line 1:<br />ORA-00984: column not allowed here<br /> <br /> <br />SQL> <br />SQL> COMMIT ;<br /> <br />Commit complete.<br /> <br />SQL> END ;<br />SP2-0042: unknown command "END " - rest of line ignored.<br />SQL> / <br /> <br />Commit complete.<br /> <br />SQL> <br /><br />Running same block from Toad works fine.<br /><br /><span style="font-weight:bold;">Solution</span><br />DECLARE<br /> A varchar2(1024) := NULL;<br />BEGIN<br /> A := 'set serveroutput on;<br />BEGIN<br /> INSERT INTO table_name<br /> VALUES (5067);<br />END ;' || '<br />/' || '<br /> <br /> <br />' ;<br /> INSERT INTO x VALUES (A) ;<br /> <br /> COMMIT ;<br />END ;<br />/Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com1tag:blogger.com,1999:blog-2356870753929006427.post-14928374679633743142010-10-06T15:23:00.001-05:002010-10-06T15:24:41.695-05:00Query to run Dynamic SQL Using XML on SQL> promptQuery to run Dynamic SQL Using XML on SQL> prompt<br /><br />SELECT table_name, extractvalue(dbms_xmlgen.getxmltype('select count(*) from ' || table_name),'//text()')<br />FROM user_Tables<br />WHERE table_name LIKE 'A%'<br /><br />The query above is just sample. Put your query in getxmltype and you are all set.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-52866528570941898442010-08-03T14:03:00.000-05:002010-08-03T14:04:09.012-05:00vi ... How to Refresh Already Open FileRefresh file from version on disk:<br />:e!Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-27240855491078639032010-06-30T14:08:00.002-05:002010-06-30T14:31:23.849-05:00Awk Script to Find Start Time End Time and Diff[0]/ely =>cat f<br />awk '/Started Lighting for / { bid = toupper(substr($4, 1, 10)) ; start_time[bid] = $6}<br /> /Lighting Successful at|Failed at / { bid = toupper(substr($1, 1, 10)) <br /> split(start_time[bid], st, ":")<br /> if ($3 ~ "Successful")<br /> {<br /> end_time[bid] = $5<br /> success_fail = "Success"<br /> }<br /> else<br /> {<br /> end_time[bid] = $4<br /> success_fail = "Failed "<br /> }<br /> split(end_time[bid], et, ":")<br /> start_sec = st[3] + st[2] * 60 + st[1] * 60 * 60<br /> end_sec = et[3] + et[2] * 60 + et[1] * 60 * 60<br /> total_time = end_sec - start_sec<br /> hh = int(total_time / 3600)<br /> rm = total_time % 3600 <br /> mm = int(rm / 60)<br /> ss = rm % 60 <br /> printf("Bid: %s Start Time: %s %s at: %s Total Time: %02s:%02s:%02s \n", bid, start_time[bid], success_fail, end_time[bid], hh, mm, ss)<br />}' bb<br /><br />[0]/ely =>cat bb<br />Started Lighting for x440019981O.iad at 16:33:31 (x440019981)<br />x440019981O Failed at 16:33:54 (Domestic)<br /><br />Started Lighting for x250020161O.iad at 16:35:01 (x250020161)<br />x250020161O Lighting Successful at 16:35:43 (Domestic)<br /><br />Started Lighting for x750016701O.iad at 16:38:12 (x750016701)<br />x750016701O Lighting Successful at 16:38:21 (Domestic)<br /><br />Started Lighting for x260019961O.iad at 16:38:23 (x260019961)<br />x260019961O Lighting Successful at 16:38:50 (Domestic)<br /><br />Started Lighting for x650019976O.iad at 16:40:05 (x650019976)<br />x650019976O Lighting Successful at 16:40:21 (Domestic)<br /><br />Started Lighting for x360019763O.iad at 16:41:46 (x360019763)<br />x360019763O Lighting Successful at 16:42:26 (Domestic)<br /><br />Started Lighting for x440019981O.iad at 16:44:27 (x440019981)<br />x440019981O Failed at 16:44:29 (Domestic)<br /><br />Started Lighting for x370020017O.iad at 16:45:47 (x370020017)<br />x370020017O Lighting Successful at 16:46:06 (Domestic)<br /><br />Started Lighting for x260019961O.iad at 16:46:48 (x260019961)<br />x260019961O Lighting Successful at 16:47:14 (Domestic)<br /><br />Started Lighting for x920020035O.iad at 16:48:48 (x920020035)<br />x920020035O Lighting Successful at 16:49:09 (Domestic)<br /><br />Started Lighting for x560019917O.iad at 16:53:20 (x560019917)<br />x560019917O Lighting Successful at 16:54:06 (Domestic)<br /><br />Started Lighting for x030020010O.iad at 16:54:40 (x030020010)<br />x030020010O Lighting Successful at 16:55:38 (Domestic)<br /><br />Started Lighting for x260019961O.iad at 16:55:41 (x260019961)<br />x260019961O Lighting Successful at 16:56:08 (Domestic)<br /><br />Started Lighting for x460019558O.iad at 16:57:31 (x460019558)<br />x460019558O Lighting Successful at 16:57:43 (Domestic)<br /><br />[0]/ely =>./f<br />Bid: X440019981 Start Time: 16:33:31 Failed at: 16:33:54 Total Time: 00:00:23 <br />Bid: X250020161 Start Time: 16:35:01 Success at: 16:35:43 Total Time: 00:00:42 <br />Bid: X750016701 Start Time: 16:38:12 Success at: 16:38:21 Total Time: 00:00:09 <br />Bid: X260019961 Start Time: 16:38:23 Success at: 16:38:50 Total Time: 00:00:27 <br />Bid: X650019976 Start Time: 16:40:05 Success at: 16:40:21 Total Time: 00:00:16 <br />Bid: X360019763 Start Time: 16:41:46 Success at: 16:42:26 Total Time: 00:00:40 <br />Bid: X440019981 Start Time: 16:44:27 Failed at: 16:44:29 Total Time: 00:00:02 <br />Bid: X370020017 Start Time: 16:45:47 Success at: 16:46:06 Total Time: 00:00:19 <br />Bid: X260019961 Start Time: 16:46:48 Success at: 16:47:14 Total Time: 00:00:26 <br />Bid: X920020035 Start Time: 16:48:48 Success at: 16:49:09 Total Time: 00:00:21 <br />Bid: X560019917 Start Time: 16:53:20 Success at: 16:54:06 Total Time: 00:00:46 <br />Bid: X030020010 Start Time: 16:54:40 Success at: 16:55:38 Total Time: 00:00:58 <br />Bid: X260019961 Start Time: 16:55:41 Success at: 16:56:08 Total Time: 00:00:27 <br />Bid: X460019558 Start Time: 16:57:31 Success at: 16:57:43 Total Time: 00:00:12Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-33424272064285846542010-06-22T16:00:00.001-05:002010-06-22T16:01:47.950-05:00PartitioningPartitioning<br />Local Indexes<br />Index is partitioned for each partition. So one Index Partition will store index keys for only one partition<br />Global Partitioned Indexes<br />Partitioning Key for Index is independent of Partitioning Key for table. It can be applied to Regular table, Index Organized Tables, Partitioned Tables<br />Global Non Partitioned Indexes<br />It's regular non Partitioned Index. And can be applied to any table<br /><br />Three Types of Basic Partitioning:<br />----------------------------------<br />Range : Partition For Feb 2010, Mar 2010, ...<br />List : Partition For say America, India, US, Russia<br />Hash : Partition using Hash Algorithm (I guess Oracle does not publish the algorithm)<br /><br /><br />Single Level Partitioning: Only one set of partitions<br />-------------------------<br />Composite Partitioning: Two level of partitions and can be combination of 3 basic<br />---------------------- <br />paritioning type. Available composite partitioning techniques are range-hash, range-list,<br />range-range, list-range, list-list, and list-hash.<br /><br />Partitioning Extension in Oracle 11g:<br />------------------------------------<br />Interval Partitioning: Define Interval and first partition. Oracle will create new partition when data is inserted for first time in new partition<br /><br />REF Partitioning: Parent-Child Relationship: Child partitions will be created automatically based on parents partition and will have same charecteristics as parent partitions. In Child partitions, Oracle will not store index keys as data<br /><br />Virtual Column Based Partitioning:<br />Paritioning based on metadata instead of column data. Let's say account number has first three digit as branch code, then we can have partitions for branch and account level data will go in respective branch partitionsArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-21141728595800321992009-11-04T16:27:00.000-06:002009-11-04T16:28:44.354-06:00Parallel HintSELECT /*+ PARALLEL(a) */ COUNT(*) FROM ABCD a ;<br /><br />Parallel Hint makes operation faster. It does so by providing more threads to the current SQL statement. Not advisable to run in Production Environment during Peak Hours.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-49932320534013853932009-08-05T08:41:00.001-05:002009-08-05T08:41:37.481-05:00When We are Joyful<div style="font-family:verdana, helvetica, sans-serif;font-size:10pt;color:#4040ff;"><STRONG><FONT face=Arial></FONT></STRONG> <P align=center>WHEN WE ARE JOYFUL</P> <P> </P> <P>When we are joyful, we don't look for perfection. If you are looking for perfection then you are not at the source of joy. Joy is the realization that there is no vacation from wisdom. The world appears imperfect on the surface but underneath, all is perfect. Perfection hides; imperfection shows off. </P> <P> </P> <P>The wise will not stay on the surface but will probe into the depth. Things are not blurred; your vision is blurred. Infinite actions prevail in the wholeness of consciousness. And yet the consciousness remains perfect, untouched. As Satsangees, realize this now and be at Home.</P> <DIV></DIV> <DIV><BR> </DIV> <P><FONT face=Arial color=#333399 size=4><FONT size=2><STRONG>Regards,</STRONG></FONT><BR>Arpit Shah</FONT><BR><FONT face=Verdana color=#000080><FONT size=1></P></FONT></FONT> <DIV></DIV></div><br> <!--3--><hr size=1></hr> See the Web's breaking stories, chosen by people like you. Check out <a href="http://in.rd.yahoo.com/tagline_buzz_1/*http://in.buzz.yahoo.com/" target="_blank"> Yahoo! Buzz</a>.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-17285898643452852062009-07-10T09:51:00.002-05:002009-07-10T09:59:36.476-05:00Smart Choice for Cursor ProcessingIt's nice article desribing when to use <br />CURSOR FOR Loops <br /> Avoid using it<br />SELECT INTO<br /> Use when query can return atmost one row. Also put SELECT statements in seperate PROCEDURES/FUNCTION. Which can be optimized/cached in Oracle 11g.<br />CURSOR BULK COLLECT VARRAY [Fixed number of rows or less]<br /> Use when SELECT query will return multiple rows but you know upper limit. If upper limit is very high say 10000, you may want to go for next approach. As it will consume lots of memory.<br />CURSOR BULK COLLECT NESTED ARRAY with LIMITS<br /> Use when SELECT query will fetch multiple rows and you don't know the upper limit or you know the upper limit but it is very high.<br /><br />More Detail with examples at:<br />http://www.oracle.com/technology/oramag/oracle/08-nov/o68plsql.htmlArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-5674156597069238512009-07-06T10:29:00.005-05:002009-07-06T10:40:03.129-05:00Unix to Dos [How to write Control Character in Unix File]Suppose following is your file. If you move the file from Windows to Unix, you will see Control M (^M) character at the end of each line. <br />File in Windows:<br />export USERNAME<br />export PASSWORD<br />export CTLPATH<br /><br />Same File when you move it to Unix<br />export USERNAME^M<br />export PASSWORD^M<br />export CTLPATH^M<br />^M<br /><br />You can see the special characters because Windows has [Carriage Return Line Feed] CRLF (\r\n) as line terminating sequence. Where as Unix has only [Line Feed] LF (\n) as line terminator.<br /><br />So, when we move file from Dos (Windows) to Unix, we need some kind of special processing which will convert CRLF into LF.<br /><br />One is to open the file and replace Control M character visible in file to blank. To replace Control M character one should know how to create Control M character in Unix.<br /><br />Folloing is the way to create Control M character in Unix.<br /><br />Open File in vi editor.<br /><br />Come in Instert mode by pressing Esc i<br />Press Control V<br />Then Press Control M<br />Then Esc.<br /><br />It will generate Control M.<br /><br />Whatever control character you want to generate, first press Control + V and then Control + <required character><br /><br />So convert file from Dos to Unix follow the steps mentioned below:<br /><br />Open file in vi.<br />Type following command.<br />:0,$s/^M//<br /><br />The above command will remove Control M (^M) character from entire file.<br /><br />I will mention other utilities to convert from Dos to Unix sometime later.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com1tag:blogger.com,1999:blog-2356870753929006427.post-15284113084715504062009-05-27T17:20:00.001-05:002009-05-27T17:20:19.703-05:00SQL Report Formatting Using HTML<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>See the magic. Following block of code will format the report in tabular format. The best way to generate SQL Report. Using it, you can view it in Browser. You can open it in Excel. <br /><br /><br />SET MARKUP HTML ON SPOOL ON HEAD "<TITLE>SQL*Plus Report</title> -<br /><STYLE TYPE='TEXT/CSS'><!--BODY {background: ffffc6} --></STYLE>"<br />SET ECHO OFF<br />SPOOL employee.htm<br />SELECT FIRST_NAME, LAST_NAME, SALARY<br />FROM EMP_DETAILS_VIEW<br />WHERE SALARY>12000;<br />SPOOL OFF<br />SET MARKUP HTML OFF<br />SET ECHO ON<br /><br /></code></pre>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-39002181803623179532009-05-05T16:11:00.001-05:002009-05-05T16:11:04.945-05:00Fw: Love - The Question of an answer<div style="font-family:tahoma, new york, times, serif;font-size:10pt"><DIV></DIV> <DIV> </DIV> <DIV style="FONT-SIZE: 10pt; FONT-FAMILY: tahoma, new york, times, serif"> <DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"> <DIV style="FONT-SIZE: 10pt; COLOR: #0000ff; FONT-FAMILY: tahoma, new york, times, serif"> <DIV></DIV> <DIV> <H3 class="post-title entry-title"><A href="http://wisdomfromsrisri.blogspot.com/2009/05/love-question-of-answer.html" target=_blank rel=nofollow>Love - The Question of an answer</A> </H3> <DIV class=post-header-line-1></DIV> <DIV class="post-body entry-content"><SPAN style="FONT-FAMILY: arial">In a congregation, Sri Sri asked, "How many of you feel strong?" Many people raised their hands.<BR>Sri Sri then asked, "Why?"<BR>"Because you are with us," they answered.<BR>"Only those who feel weak can surrender," Sri Sri responded.<BR>All those who were feeling strong were taken aback; they suddenly felt weak!<BR><BR>If you are in love, you feel weak because love makes you weak. Yet there is no power stronger than love. Love is strength. Yet love is the greatest power on earth. You feel absolutely powerful when you are with the Divine.<BR><BR>Someone asked: But why do we keep alternating between strength and weakness?<BR>Sri Sri: That is the fluctuation in life.<BR>When you feel weak - surrender.<BR>When you feel strong - do seva.</SPAN><BR> </DIV></DIV> <P><FONT face=Arial color=#333399 size=4><FONT size=2><STRONG>Regards,</STRONG></FONT><BR>Arpit Shah</FONT><BR><FONT face=Verdana color=#000080><FONT size=1><FONT color=#000000><FONT face="verdana, helvetica, sans-serif"><FONT color=#0000bf>"Celebrate Life. Care for others and share whatever you have with those less fortunate than you. Broaden your vision, for the whole world belongs to you."<BR>- Sri Sri Ravi Shankar, Founder, Art</FONT><FONT color=#0000bf> of Living Foundation, <A href="http://www.artofliving.org/" target=_blank rel=nofollow>www.artofliving.org</A></FONT></FONT></FONT></FONT></FONT></P> <P><FONT face=Verdana color=#000080><FONT size=1><BR></P></FONT></FONT></DIV></DIV></DIV></div><br> <!--1--><hr size=1></hr> Bollywood news, movie reviews, film trailers and more! <a href="http://in.rd.yahoo.com/tagline_movies_1/*http://in.movies.yahoo.com/?wm=n/"> Click here.</a>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-50858398945667943442009-04-17T09:23:00.001-05:002009-04-17T09:23:15.016-05:00Intelligent people celebrate diversity<div style="font-family:tahoma, new york, times, serif;font-size:10pt;color:#0000ff;"><DIV></DIV> <DIV><STRONG>Intelligent people celebrate diversity</STRONG> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><?XML:NAMESPACE PREFIX = O /><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">Bangalore (India), April 16 (Thursday), 8:10 pm: The 2,000-strong crowd in the Vishalakshi Mantap Hall at the Art of Living Centre sat rapt in attention as Sri Sri answered many questions at the satsang this evening.</SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">Q. What is the science of relativity? How does it work in life?<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">A.: You go on the internet. There is so much on it. Volumes and volumes. Everything is related: if you've slept well, you see everything better. If not, then things are blurred.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The observer and the observed vary. That is why it is said that different states of consciousness understand different knowledge. <BR></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">Have you heard the Japanese story?<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">In Japan, there is a rule that a motel-owner must give free boarding and lodging to monks. <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">To test if a monk is genuine, the owner would ask a knowledge question. If the question is answered, monk can then stay. If the owner gives the right answer, then the monk will go further.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">There was a motel run by two brothers. The elder one was very intelligent. The younger one was dull. The elder brother used to manage affairs such that he did not have to give free rooms to the monks. If the elder brother had to go away, he would tell the younger one: 'If any monk comes here, act dumb. If you're silent, the monk will not stay here."</SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">As soon as the elder brother left, a group of monks arrived. They said: 'Come we will argue.' <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The younger brother gestured: 'I am in silence.'<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The monks: 'We will have a dialogue in silence.' They showed the forefinger to indicate 'one'.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The younger brother had only one eye. The other eye was bandaged. He showed two fingers.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The monks then showed three fingers.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The brother then showed a fist.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The monks became very happy and left.</SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">When the elder brother came, the younger one explained what happened: <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">'They told me that you have only one eye.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><SPAN></SPAN>So I said, 'You have two.' <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">They then said: The dialogue is between three eyes. <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">So I said: I will punch you.'</SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">Later the monks returned and told the elder brother that the younger one had shared the highest knowledge in silence.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The monks narrated:<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">'We asked: What is the one truth?<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">He said: Not one, there are two: Buddham and Dhammam.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">We said: There are three things: – Buddham, Dhammam, and Sangham.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">He said: They are all one!'<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">It was such a mind-blowing realization! <BR></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">This story shows that different levels of consciousness can interpret different things, differently.<O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">Fools always create conflicts over nothing. And die for it. The intelligent will celebrate diversity. Fools can't tolerate diversity. <BR></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">The ancient sages in the <I>Rig Veda</I> have said: 'Accept even the atheist and they have included them in prayers: Those who call You as no God and think there is no Divinity, I bow down. Those who say, You are not there, I offer my obeisance.'</SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><BR></SPAN><SPAN style="FONT-SIZE: 85%"><O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%">One accepts even atheism. That is true wisdom: You have broad vision which accepts people and differences. <O:P></O:P></SPAN></P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><SPAN style="FONT-SIZE: 85%"><I>Intelligent people celebrate diversity, fools fight over diversity.</I></SPAN></P><SPAN style="FONT-SIZE: 85%"><EM></EM></SPAN></DIV> <DIV><SPAN style="FONT-SIZE: 85%"></SPAN> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"><BR>More at: <A href="http://www.artofliving.org/intl/wisdomblog/tabid/183/Default.aspx">http://www.artofliving.org/intl/wisdomblog/tabid/183/Default.aspx</A> </P> <P class=MsoNormal style="MARGIN-BOTTOM: 0pt; FONT-FAMILY: arial"> </P></DIV> <P><FONT face=Arial><FONT size=4><FONT color=#333399><STRONG>Regards,</STRONG><BR>AOL Parsippany</FONT></FONT></FONT><BR><FONT face=Verdana color=#000080><FONT size=1><FONT color=#000000><FONT face="verdana, helvetica, sans-serif"><FONT color=#0000bf>"Celebrate Life. Care for others and share whatever you have with those less fortunate than you. Broaden your vision, for the whole world belongs to you."<BR>- Sri Sri Ravi Shankar, Founder, Art</FONT><FONT color=#0000bf> of Living Foundation, <A href="http://www.artofliving.org/" target=_blank rel=nofollow>www.artofliving.org</A></FONT></FONT></FONT></FONT></FONT></P> <P><FONT face=Verdana color=#000080><FONT size=1><BR> </P></FONT></FONT> <DIV></DIV></div><br> <!--6--><hr size=1></hr> Add more friends to your messenger and enjoy! <a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"> Invite them now.</a>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-47293830137978020782009-04-13T10:10:00.001-05:002009-04-13T10:10:22.680-05:00KNOW UR CHAKRAS by Sri Sri<div style="font-family:tahoma, new york, times, serif;font-size:10pt;color:#0000ff;"><DIV></DIV> <DIV>KNOW UR CHAKRAS<BR>-<BR>Know yourself better by knowing the Colour of Chakras<BR>-<BR>You possess chakras, every human does and they do have a color.<BR>Why you are elated when you see green?<BR>Why is red violent?<BR>Why indigo soothes and relaxes your mind?<BR>The reason lies in the color of the respective chakra<BR><BR>A human body has seven major chakras, namely, Crown , <SPAN class=yshortcuts id=lw_1239463472_13>Third Eye</SPAN> , Throat,<BR>Heart, <SPAN class=yshortcuts id=lw_1239463472_14 style="CURSOR: pointer; BORDER-BOTTOM: medium none">Solar Plexus</SPAN>, Hara and finally the Root chakra with the colors in the<BR>sequence of VIBGYOR (Violet, Indigo, Blue, Green, Yellow, Orange, Red<BR>)respectively.<BR><BR>This is the reason why cardiac patients are advised to eat green vegetables<BR>and asked to walk on green grass as the former not only give nutrients but<BR>also soothes the heart chakra. The more you see green the more you feel<BR>green (good at heart)<BR>So for the heart patients the basic mantra is go green!!!<BR>Exercise each color to strengthen your respective chakra and feel the<BR>difference<BR> </DIV> <P><FONT face=Arial><FONT size=4><FONT color=#333399><STRONG>Regards,</STRONG><BR></FONT></FONT></FONT><FONT face=Verdana color=#000080><FONT size=1><FONT color=#000000><FONT face="verdana, helvetica, sans-serif"><FONT color=#0000bf><FONT face=Arial color=#333399 size=4>AOL Parsippany</FONT></FONT></FONT></FONT></FONT></FONT></P> <P><FONT face=Verdana color=#000080><FONT size=1><FONT color=#000000><FONT face="verdana, helvetica, sans-serif"><FONT color=#0000bf>"Celebrate Life. Care for others and share whatever you have with those less fortunate than you. Broaden your vision, for the whole world belongs to you."<BR>- Sri Sri Ravi Shankar, Founder, Art</FONT><FONT color=#0000bf> of Living Foundation, <A href="http://www.artofliving.org/" target=_blank rel=nofollow>www.artofliving.org</A></FONT></FONT></FONT></FONT></FONT></P> <P><FONT face=Verdana color=#000080><FONT size=1><BR> </P></FONT></FONT> <DIV></DIV></div><br> <!--6--><hr size=1></hr> Add more friends to your messenger and enjoy! <a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"> Invite them now.</a>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-53068427854329569172009-04-13T10:08:00.001-05:002009-04-13T10:08:17.007-05:00A very nice perspective - "Money has no memory. Experience has"<div style="font-family:tahoma, new york, times, serif;font-size:10pt"><DIV></DIV> <DIV><BR> <TABLE cellSpacing=0 cellPadding=0 border=0> <TBODY> <TR> <TD vAlign=top><FONT face=Arial size=2> <DIV>Money has no memory. Experience has. You will never know what was the total cost of your education, but for a lifetime you will recall and relive the memories of schools and colleges. Few years from now, you will forget the amount you paid to settle the hospitalization bill, but will ever cherish having saved your mother's life or the life you get to live with the just born. You won't remember the cost of your honeymoon, but to the last breath remember the experiences of the bliss of togetherness. Money has no memory. Experience has. </DIV> <DIV>Good times and bad times, times of prosperity and times of poverty, times when the future looked so secure and times when you didn't know from where the tomorrow will come… life has been in one way or the other a roller-coaster ride for everyone. Beyond all that abundance and beyond all that deprivation, what remains is the memory of experiences. Sometimes the wallet was full… sometimes even the pocket was empty. There was enough and you still had reasons to frown. There wasn't enough and you still had reasons to smile. Today, you can look back with tears of gratitude for all the times you had laughed together, and also look back with a smile at all the times you cried alone. All in all, life filled you with experiences to create a history of your own self, and you alone can remember them all.</DIV> <DIV>The first time you balanced yourself on your cycle without support… </DIV> <DIV>The first time she said 'yes' and it was two years since you proposed… </DIV> <DIV>The first cry… the first steps… the first word… the first kiss… all of your child… </DIV> <DIV>The first gift you bought for your parents and the first gift your daughter gave you… </DIV> <DIV>The first award… the first public appreciation… the first stage performance… </DIV> <DIV>And the list is endless… Experiences, with timeless memory… </DIV> <DIV>Not denying that anything that's material cost money, but the fact remains the cost of the experience will be forgotten, but the experience never. </DIV> <DIV>So, what if it's economic recession? Let it be, but let there not be a recession to the quality of your life. You can still take your parents, if not on a pilgrimage, at least to the local temple. You can still play with your children, if not on an international holiday, at least in the local park. It doesn't cost money to lie down or to take a loved one onto your lap. Nice time to train the employees, create leadership availability and be ready for the wonderful times when they arrive. Hey! Aspects like your health, knowledge development and spiritual growth are not economy dependent.</DIV> <DIV>Time will pass… economy will revive… currency will soon be in current… and in all this, I don't want you to look back and realize you did nothing but stayed in gloom. Recession can make you lose out on money. Let it not make you lose out on experiences… If you are not happy with what you have, no matter how much more you have, you will still not be happy. </DIV> <DIV>Make a statement with the way you live your life: How I feel has nothing to do with how much I have. </DIV></FONT></TD></TR></TBODY></TABLE></DIV></div><br> <!--6--><hr size=1></hr> Add more friends to your messenger and enjoy! <a href="http://in.rd.yahoo.com/tagline_messenger_6/*http://messenger.yahoo.com/invite/"> Invite them now.</a>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-78262564258561886202009-01-30T10:10:00.002-06:002009-01-30T13:09:44.928-06:00Cursor with variable in an "IN CLAUSE"SQL> with t as<br />(SELECT ',001,002,003,004,005,006,007,008,ALL,' sList<br />FROM dual)<br />SELECT LEVEL, SUBSTR(sList, INSTR(sList, ',', 1, LEVEL) + 1, <br /> INSTR(sList, ',', 1, LEVEL + 1) - INSTR(sList, ',', 1, LEVEL) - 1)<br /> 2 3 4 5 6 FROM t<br />CONNECT BY LEVEL <= LENGTH(sList) - LENGTH(REPLACE(sList,',')) - 1 7 ;<br /><br /> LEVEL SUBSTR(SLIST,INSTR(SLIST,',',1,LEVEL)<br />---------- -------------------------------------<br /> 1 001<br /> 2 002<br /> 3 003<br /> 4 004<br /> 5 005<br /> 6 006<br /> 7 007<br /> 8 008<br /> 9 ALL<br /><br />9 rows selected.<br /><br />SQL> <br /><br />SQL> with t as<br />(SELECT q'!('001','002','003','004','005','006','007','008','ALL')!' sList<br />FROM dual)<br />SELECT LEVEL, SUBSTR(sList, 3 + 6*(LEVEL - 1), 3)<br />FROM t<br />CONNECT BY LEVEL <= LENGTH(sList) - LENGTH(REPLACE( 2 3 4 5 sList, ',')) + 1<br /> 6 7 ;<br /><br /> LEVEL SUB<br />---------- ---<br /> 1 001<br /> 2 002<br /> 3 003<br /> 4 004<br /> 5 005<br /> 6 006<br /> 7 007<br /> 8 008<br /> 9 ALL<br /><br />9 rows selected.<br /><br /><br />SQL> with t as<br />(SELECT ',001,002,003,004,005,006,007,008,ALL,' sList<br />FROM dual)<br />SELECT LEVEL, SUBSTR(sList, INSTR(sList, ',', 1, LEVEL) + 1, 3)<br />FROM t<br />CONNECT BY LEVEL <= LENGTH(sList) - LENGTH(REPLACE(s 2 3 4 5 6 List,',')) - 1;<br /><br /> LEVEL SUB<br />---------- ---<br /> 1 001<br /> 2 002<br /> 3 003<br /> 4 004<br /> 5 005<br /> 6 006<br /> 7 007<br /> 8 008<br /> 9 ALL<br /><br />9 rows selected.<br /><br />SQL>Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-91725756830360875732008-10-28T16:06:00.000-05:002008-10-28T16:07:48.636-05:00Using the FOR Clause in Pro*C (Oracle)Using the FOR Clause<br /><br />You can use the optional embedded SQL FOR clause to set the number of array elements processed by any of the following SQL statements:<br /><br />DELETE<br />EXECUTE<br />FETCH<br />INSERT<br />OPEN<br />UPDATE<br /><br /><strong>The FOR clause is especially useful in UPDATE, INSERT, and DELETE statements. With these statements you might not want to use the entire array. The FOR clause lets you limit the elements used to just the number you need,</strong> as the following example shows:<br /><br />char emp_name[100][20];<br />float salary[100];<br />int rows_to_insert;<br /><br />/* populate the host arrays */<br />rows_to_insert = 25; /* set FOR-clause variable */<br />EXEC SQL FOR :rows_to_insert /* will process only 25 rows */<br /> INSERT INTO emp (ename, sal)<br /> VALUES (:emp_name, :salary);<br />The FOR clause can use an integer host variable to count array elements, or an integer literal. A complex C expression that resolves to an integer cannot be used. For example, the following statement that uses an integer expression is illegal:<br /><br /><br />EXEC SQL FOR :rows_to_insert + 5 /* illegal */<br /> INSERT INTO emp (ename, empno, sal)<br /> VALUES (:emp_name, :emp_number, :salary);<br />The FOR clause variable specifies the number of array elements to be processed. Make sure the number is not larger than the smallest array dimension. Also, the number must be positive. If it is negative or zero, no rows are processed and Oracle issues an error message.<br /><br /><br />Restrictions<br />Two restrictions keep FOR clause semantics clear. You cannot use the FOR clause in a SELECT statement or with the CURRENT OF clause.<br /><br />In a SELECT Statement<br />If you use the FOR clause in a SELECT statement, you get the following error message:<br /><br />PCC-E-0056: FOR clause not allowed on SELECT statement at ...<br />The FOR clause is not allowed in SELECT statements because its meaning is unclear. Does it mean "execute this SELECT statement n times"? Or, does it mean "execute this SELECT statement once, but return n rows"? The problem in the former case is that each execution might return multiple rows. In the latter case, it is better to declare a cursor and use the FOR clause in a FETCH statement, as follows:<br /><br /><br />http://www.lsbu.ac.uk/oracle/oracle7/api/doc/PC_22/ch10.htmArpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com0tag:blogger.com,1999:blog-2356870753929006427.post-89324662703285357772008-10-28T16:01:00.002-05:002008-10-28T16:04:13.469-05:00Oracle Trigger: Mutating TableA mutating table is a table that is being modified by an UPDATE, DELETE, or INSERT statement, or a table that might be updated by the effects of a DELETE CASCADE constraint.<br />The session that issued the triggering statement cannot query or modify a mutating table. This restriction prevents a trigger from seeing an inconsistent set of data.<br /><br />This restriction applies to all triggers that use the FOR EACH ROW clause. Views being modified in INSTEAD OF triggers are not considered mutating.<br />When a trigger encounters a mutating table, a runtime error occurs, the effects of the trigger body and triggering statement are rolled back, and control is returned to the user or application.<br /><br />Consider the following trigger:<br />CREATE OR REPLACE TRIGGER Emp_count<br />AFTER DELETE ON Emp_tab<br />FOR EACH ROW<br />DECLARE <br /> n INTEGER;<br />BEGIN <br /> SELECT COUNT(*)<br /> INTO n FROM Emp_tab; <br /> DBMS_OUTPUT.PUT_LINE(' There are now ' n ' employees.');<br />END;<br /><br />If the following SQL statement is entered:<br /><br />DELETE FROM Emp_tab WHERE Empno = 7499;<br /><br />An error is returned because the table is mutating when the row is deleted:<br /><br />ORA-04091: table SCOTT.Emp_tab is mutating, trigger/function may not see it<br /><br />If you delete the line "FOR EACH ROW" from the trigger, it becomes a statement trigger which is not subject to this restriction, and the trigger.<br /><br /><strong>If you need to update a mutating table, you could bypass these restrictions by using a temporary table, a PL/SQL table, or a package variable. For example, in place of a single AFTER row trigger that updates the original table, resulting in a mutating table error, you might use two triggers--an AFTER row trigger that updates a temporary table, and an AFTER statement trigger that updates the original table with the values from the temporary table.<br /></strong>Declarative integrity constraints are checked at various times with respect to row triggers.<br />See Also: Oracle Database Concepts for information about the interaction of triggers and integrity constraints<br />Because declarative referential integrity constraints are not supported between tables on different nodes of a distributed database, the mutating table restrictions do not apply to triggers that access remote nodes. These restrictions are also not enforced among tables in the same database that are connected by loop-back database links. A loop-back database link makes a local table appear remote by defining an Oracle Net path back to the database that contains the link.Arpithttp://www.blogger.com/profile/00513425552394091055noreply@blogger.com1