<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8707999212699764452</id><updated>2012-01-30T13:14:12.427-08:00</updated><category term='Development Tools'/><category term='Gadgets'/><category term='Firefox'/><category term='Peoplesoft'/><category term='Joomla'/><category term='Oracle/SQL'/><category term='Unix/Shell'/><category term='Greasemonkey'/><title type='text'>Blue Spur - my online notepad</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bluespur.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-9083574221749703907</id><published>2012-01-19T08:56:00.000-08:00</published><updated>2012-01-19T09:30:25.442-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Files related....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;fuser:  &lt;/span&gt;Identifies processes using a file or file structure&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;whodo:&lt;/span&gt; Lists the jobs being performed by users on the system.&lt;br /&gt;&lt;strong&gt;procfiles&lt;/strong&gt;:list symbols from object files      &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ar:&lt;/span&gt; list library contents (&lt;span style="font-weight: bold;"&gt;.a&lt;/span&gt;)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nm:&lt;/span&gt; list symbols from object files         (&lt;span style="font-weight: bold;"&gt;.a, .so&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;.o&lt;/span&gt;)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ldd:&lt;/span&gt; Lists dynamic dependencies (XCOFF) ($LD_LIBRARY_PATH&lt;span style="font-weight: bold;"&gt;)&lt;br /&gt;what:&lt;/span&gt; Displays identifying information in files.         (&lt;span style="font-weight: bold;"&gt;.a, .so&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;.o&lt;/span&gt;, XCOFF), work with GET/SCCS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-9083574221749703907?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/9083574221749703907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/9083574221749703907'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2012/01/files-related.html' title=''/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2827741594198886426</id><published>2011-12-02T10:01:00.000-08:00</published><updated>2011-12-08T08:19:46.583-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Find out web server port number</title><content type='html'>select substr(CONNURL,regexp_instr(CONNURL,':',1,2,2),4),CONNURL from PSGATEWAY&lt;br /&gt;&lt;br /&gt;if same as report server:&lt;br /&gt;&lt;br /&gt;select substr(URL,regexp_instr(URL,':',1,2,2),4) from PS_CDM_DIST_NODE&lt;br /&gt;&lt;br /&gt;useful if single sign-on on same server to multiple dbs, just change url on address bar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2827741594198886426?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2827741594198886426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2827741594198886426'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/12/find-out-web-server-port-number.html' title='Find out web server port number'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-7741204867193832707</id><published>2011-09-29T08:45:00.001-07:00</published><updated>2011-09-29T08:46:17.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>Regular Expressions</title><content type='html'>http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html&lt;br /&gt;&lt;br /&gt;&lt;table summary="Regular expression constructs, and what they match" border="0" cellpadding="1" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr align="left"&gt;&lt;th id="construct" align="left" bgcolor="#ccccff"&gt;Construct&lt;/th&gt;  &lt;th id="matches" align="left" bgcolor="#ccccff"&gt;Matches&lt;/th&gt;  &lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="characters"&gt;Characters&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;i&gt;x&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character &lt;i&gt;x&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\\&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The backslash character&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\0&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character with octal value &lt;tt&gt;0&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;          (0 &lt;tt&gt;&amp;lt;=&lt;/tt&gt; &lt;i&gt;n&lt;/i&gt; &lt;tt&gt;&amp;lt;=&lt;/tt&gt; 7)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\0&lt;/tt&gt;&lt;i&gt;nn&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character with octal value &lt;tt&gt;0&lt;/tt&gt;&lt;i&gt;nn&lt;/i&gt;          (0 &lt;tt&gt;&amp;lt;=&lt;/tt&gt; &lt;i&gt;n&lt;/i&gt; &lt;tt&gt;&amp;lt;=&lt;/tt&gt; 7)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\0&lt;/tt&gt;&lt;i&gt;mnn&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character with octal value &lt;tt&gt;0&lt;/tt&gt;&lt;i&gt;mnn&lt;/i&gt;          (0 &lt;tt&gt;&amp;lt;=&lt;/tt&gt; &lt;i&gt;m&lt;/i&gt; &lt;tt&gt;&amp;lt;=&lt;/tt&gt; 3,          0 &lt;tt&gt;&amp;lt;=&lt;/tt&gt; &lt;i&gt;n&lt;/i&gt; &lt;tt&gt;&amp;lt;=&lt;/tt&gt; 7)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\x&lt;/tt&gt;&lt;i&gt;hh&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character with hexadecimal value &lt;tt&gt;0x&lt;/tt&gt;&lt;i&gt;hh&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\u&lt;/tt&gt;&lt;i&gt;hhhh&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The character with hexadecimal value &lt;tt&gt;0x&lt;/tt&gt;&lt;i&gt;hhhh&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="matches" valign="top"&gt;&lt;tt&gt;\t&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The tab character (&lt;tt&gt;'\u0009'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\n&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The newline (line feed) character (&lt;tt&gt;'\u000A'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\r&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The carriage-return character (&lt;tt&gt;'\u000D'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\f&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The form-feed character (&lt;tt&gt;'\u000C'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\a&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The alert (bell) character (&lt;tt&gt;'\u0007'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\e&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The escape character (&lt;tt&gt;'\u001B'&lt;/tt&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct characters" valign="top"&gt;&lt;tt&gt;\c&lt;/tt&gt;&lt;i&gt;x&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The control character corresponding to &lt;i&gt;x&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="classes"&gt;Character classes&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[abc]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;a&lt;/tt&gt;, &lt;tt&gt;b&lt;/tt&gt;, or &lt;tt&gt;c&lt;/tt&gt; (simple class)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[^abc]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Any character except &lt;tt&gt;a&lt;/tt&gt;, &lt;tt&gt;b&lt;/tt&gt;, or &lt;tt&gt;c&lt;/tt&gt; (negation)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[a-zA-Z]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;a&lt;/tt&gt; through &lt;tt&gt;z&lt;/tt&gt;          or &lt;tt&gt;A&lt;/tt&gt; through &lt;tt&gt;Z&lt;/tt&gt;, inclusive (range)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[a-d[m-p]]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;a&lt;/tt&gt; through &lt;tt&gt;d&lt;/tt&gt;,       or &lt;tt&gt;m&lt;/tt&gt; through &lt;tt&gt;p&lt;/tt&gt;: &lt;tt&gt;[a-dm-p]&lt;/tt&gt; (union)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[a-z&amp;amp;&amp;amp;[def]]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;d&lt;/tt&gt;, &lt;tt&gt;e&lt;/tt&gt;, or &lt;tt&gt;f&lt;/tt&gt; (intersection)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[a-z&amp;amp;&amp;amp;[^bc]]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;a&lt;/tt&gt; through &lt;tt&gt;z&lt;/tt&gt;,          except for &lt;tt&gt;b&lt;/tt&gt; and &lt;tt&gt;c&lt;/tt&gt;: &lt;tt&gt;[ad-z]&lt;/tt&gt; (subtraction)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct classes" valign="top"&gt;&lt;tt&gt;[a-z&amp;amp;&amp;amp;[^m-p]]&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;tt&gt;a&lt;/tt&gt; through &lt;tt&gt;z&lt;/tt&gt;,           and not &lt;tt&gt;m&lt;/tt&gt; through &lt;tt&gt;p&lt;/tt&gt;: &lt;tt&gt;[a-lq-z]&lt;/tt&gt;(subtraction)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;   &lt;tr align="left"&gt;&lt;th colspan="2" id="predef"&gt;Predefined character classes&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;.&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Any character (may or may not match &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#lt"&gt;line terminators&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\d&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A digit: &lt;tt&gt;[0-9]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\D&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A non-digit: &lt;tt&gt;[^0-9]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\s&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A whitespace character: &lt;tt&gt;[ \t\n\x0B\f\r]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\S&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A non-whitespace character: &lt;tt&gt;[^\s]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\w&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A word character: &lt;tt&gt;[a-zA-Z_0-9]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct predef" valign="top"&gt;&lt;tt&gt;\W&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A non-word character: &lt;tt&gt;[^\w]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="posix"&gt;POSIX character classes (US-ASCII only)&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Lower}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A lower-case alphabetic character: &lt;tt&gt;[a-z]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Upper}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;An upper-case alphabetic character:&lt;tt&gt;[A-Z]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{ASCII}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;All ASCII:&lt;tt&gt;[\x00-\x7F]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Alpha}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;An alphabetic character:&lt;tt&gt;[\p{Lower}\p{Upper}]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Digit}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A decimal digit: &lt;tt&gt;[0-9]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Alnum}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;An alphanumeric character:&lt;tt&gt;[\p{Alpha}\p{Digit}]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Punct}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Punctuation: One of &lt;tt&gt;!"#$%&amp;amp;'()*+,-./:;&amp;lt;=&amp;gt;?@[\]^_`{|}~&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;        &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Graph}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A visible character: &lt;tt&gt;[\p{Alnum}\p{Punct}]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Print}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A printable character: &lt;tt&gt;[\p{Graph}]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Blank}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A space or a tab: &lt;tt&gt;[ \t]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Cntrl}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A control character: &lt;tt&gt;[\x00-\x1F\x7F]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{XDigit}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A hexadecimal digit: &lt;tt&gt;[0-9a-fA-F]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct posix" valign="top"&gt;&lt;tt&gt;\p{Space}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A whitespace character: &lt;tt&gt;[ \t\n\x0B\f\r]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="unicode"&gt;Classes for Unicode blocks and categories&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct unicode" valign="top"&gt;&lt;tt&gt;\p{InGreek}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A character in the Greek block (simple &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#ubc"&gt;block&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct unicode" valign="top"&gt;&lt;tt&gt;\p{Lu}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;An uppercase letter (simple &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#ubc"&gt;category&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct unicode" valign="top"&gt;&lt;tt&gt;\p{Sc}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A currency symbol&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct unicode" valign="top"&gt;&lt;tt&gt;\P{InGreek}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Any character except one in the Greek block (negation)&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct unicode" valign="top"&gt;&lt;tt&gt;[\p{L}&amp;amp;&amp;amp;[^\p{Lu}]] &lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Any letter except an uppercase letter (subtraction)&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="bounds"&gt;Boundary matchers&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;^&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The beginning of a line&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;$&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The end of a line&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\b&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A word boundary&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\B&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;A non-word boundary&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\A&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The beginning of the input&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\G&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The end of the previous match&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\Z&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The end of the input but for the final          &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#lt"&gt;terminator&lt;/a&gt;, if any&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct bounds" valign="top"&gt;&lt;tt&gt;\z&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;The end of the input&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="greedy"&gt;Greedy quantifiers&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, once or not at all&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;*&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, zero or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, one or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, exactly &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct greedy" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,&lt;/tt&gt;&lt;i&gt;m&lt;/i&gt;&lt;tt&gt;}&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; but not more than &lt;i&gt;m&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="reluc"&gt;Reluctant quantifiers&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;??&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, once or not at all&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;*?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, zero or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;+?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, one or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;}?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, exactly &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,}?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct reluc" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,&lt;/tt&gt;&lt;i&gt;m&lt;/i&gt;&lt;tt&gt;}?&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; but not more than &lt;i&gt;m&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="poss"&gt;Possessive quantifiers&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;?+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, once or not at all&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;*+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, zero or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;++&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, one or more times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;}+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, exactly &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,}+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct poss" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;{&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;tt&gt;,&lt;/tt&gt;&lt;i&gt;m&lt;/i&gt;&lt;tt&gt;}+&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, at least &lt;i&gt;n&lt;/i&gt; but not more than &lt;i&gt;m&lt;/i&gt; times&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="logical"&gt;Logical operators&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct logical" valign="top"&gt;&lt;i&gt;XY&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt; followed by &lt;i&gt;Y&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct logical" valign="top"&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;|&lt;/tt&gt;&lt;i&gt;Y&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Either &lt;i&gt;X&lt;/i&gt; or &lt;i&gt;Y&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct logical" valign="top"&gt;&lt;tt&gt;(&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;X, as a &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#cg"&gt;capturing group&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="backref"&gt;Back references&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct backref" valign="bottom"&gt;&lt;tt&gt;\&lt;/tt&gt;&lt;i&gt;n&lt;/i&gt;&lt;/td&gt;      &lt;td headers="matches" valign="bottom"&gt;Whatever the &lt;i&gt;n&lt;/i&gt;&lt;sup&gt;th&lt;/sup&gt;      &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#cg"&gt;capturing group&lt;/a&gt; matched&lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="quot"&gt;Quotation&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct quot" valign="top"&gt;&lt;tt&gt;\&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Nothing, but quotes the following character&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct quot" valign="top"&gt;&lt;tt&gt;\Q&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Nothing, but quotes all characters until &lt;tt&gt;\E&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct quot" valign="top"&gt;&lt;tt&gt;\E&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Nothing, but ends quoting started by &lt;tt&gt;\Q&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;         &lt;tr&gt;&lt;th&gt;&lt;br /&gt;&lt;/th&gt;&lt;/tr&gt;  &lt;tr align="left"&gt;&lt;th colspan="2" id="special"&gt;Special constructs (non-capturing)&lt;/th&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?:&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, as a non-capturing group&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?idmsux-idmsux) &lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;Nothing, but turns match flags on - off&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?idmsux-idmsux:&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;  &lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, as a &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#cg"&gt;non-capturing group&lt;/a&gt; with the          given flags on - off&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?=&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, via zero-width positive lookahead&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?!&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, via zero-width negative lookahead&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?&amp;lt;=&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, via zero-width positive lookbehind&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?&lt;!--&lt;/tt--&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, via zero-width negative lookbehind&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;td headers="construct special" valign="top"&gt;&lt;tt&gt;(?&amp;gt;&lt;/tt&gt;&lt;i&gt;X&lt;/i&gt;&lt;tt&gt;)&lt;/tt&gt;&lt;/td&gt;      &lt;td headers="matches"&gt;&lt;i&gt;X&lt;/i&gt;, as an independent, non-capturing group&lt;/td&gt;&lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;a name="sum"&gt; &lt;/a&gt;&lt;hr /&gt;   &lt;a name="sum"&gt; &lt;/a&gt;&lt;a name="bs"&gt;  &lt;/a&gt;&lt;h4&gt;&lt;a name="bs"&gt; Backslashes, escapes, and quoting &lt;/a&gt;&lt;/h4&gt;  &lt;a name="bs"&gt; &lt;/a&gt;&lt;p&gt;&lt;a name="bs"&gt; The backslash character (&lt;tt&gt;'\'&lt;/tt&gt;) serves to introduce escaped  constructs, as defined in the table above, as well as to quote characters  that otherwise would be interpreted as unescaped constructs.  Thus the  expression &lt;tt&gt;\\&lt;/tt&gt; matches a single backslash and &lt;tt&gt;\{&lt;/tt&gt; matches a  left brace.   &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="bs"&gt; It is an error to use a backslash prior to any alphabetic character that  does not denote an escaped construct; these are reserved for future  extensions to the regular-expression language.  A backslash may be used  prior to a non-alphabetic character regardless of whether that character is  part of an unescaped construct.   &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="bs"&gt; Backslashes within string literals in Java source code are interpreted  as required by the &lt;/a&gt;&lt;a href="http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html"&gt;Java Language  Specification&lt;/a&gt; as either &lt;a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100850"&gt;Unicode  escapes&lt;/a&gt; or other &lt;a href="http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101089"&gt;character  escapes&lt;/a&gt;.  It is therefore necessary to double backslashes in string  literals that represent regular expressions to protect them from  interpretation by the Java bytecode compiler.  The string literal  &lt;tt&gt;"\b"&lt;/tt&gt;, for example, matches a single backspace character when  interpreted as a regular expression, while &lt;tt&gt;"\\b"&lt;/tt&gt; matches a  word boundary.  The string literal &lt;tt&gt;"\(hello\)"&lt;/tt&gt; is illegal  and leads to a compile-time error; in order to match the string  &lt;tt&gt;(hello)&lt;/tt&gt; the string literal &lt;tt&gt;"\\(hello\\)"&lt;/tt&gt;  must be used.   &lt;a name="cc"&gt;  &lt;/a&gt;&lt;/p&gt;&lt;h4&gt;&lt;a name="cc"&gt; Character Classes &lt;/a&gt;&lt;/h4&gt;  &lt;a name="cc"&gt;    &lt;/a&gt;&lt;p&gt;&lt;a name="cc"&gt; Character classes may appear within other character classes, and     may be composed by the union operator (implicit) and the intersection     operator (&lt;tt&gt;&amp;amp;&amp;amp;&lt;/tt&gt;).     The union operator denotes a class that contains every character that is     in at least one of its operand classes.  The intersection operator     denotes a class that contains every character that is in both of its     operand classes.      &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="cc"&gt; The precedence of character-class operators is as follows, from     highest to lowest:      &lt;/a&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;table summary="Precedence of character class operators." border="0" cellpadding="1" cellspacing="0"&gt;       &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;1    &lt;/th&gt;    &lt;td&gt;Literal escape    &lt;/td&gt;    &lt;td&gt;&lt;tt&gt;\x&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;th&gt;2    &lt;/th&gt;    &lt;td&gt;Grouping&lt;/td&gt;    &lt;td&gt;&lt;tt&gt;[...]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;      &lt;tr&gt;&lt;th&gt;3    &lt;/th&gt;    &lt;td&gt;Range&lt;/td&gt;    &lt;td&gt;&lt;tt&gt;a-z&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;       &lt;tr&gt;&lt;th&gt;4    &lt;/th&gt;    &lt;td&gt;Union&lt;/td&gt;    &lt;td&gt;&lt;tt&gt;[a-e][i-u]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;       &lt;tr&gt;&lt;th&gt;5    &lt;/th&gt;    &lt;td&gt;Intersection&lt;/td&gt;    &lt;td&gt;&lt;tt&gt;[a-z&amp;amp;&amp;amp;[aeiou]]&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;&lt;/blockquote&gt;  &lt;a name="cc"&gt;    &lt;/a&gt;&lt;p&gt;&lt;a name="cc"&gt; Note that a different set of metacharacters are in effect inside     a character class than outside a character class. For instance, the     regular expression &lt;tt&gt;.&lt;/tt&gt; loses its special meaning inside a     character class, while the expression &lt;tt&gt;-&lt;/tt&gt; becomes a range     forming metacharacter.   &lt;/a&gt;&lt;a name="lt"&gt;  &lt;/a&gt;&lt;/p&gt;&lt;h4&gt;&lt;a name="lt"&gt; Line terminators &lt;/a&gt;&lt;/h4&gt;  &lt;a name="lt"&gt; &lt;/a&gt;&lt;p&gt;&lt;a name="lt"&gt; A &lt;i&gt;line terminator&lt;/i&gt; is a one- or two-character sequence that marks  the end of a line of the input character sequence.  The following are  recognized as line terminators:   &lt;/a&gt;&lt;/p&gt;&lt;ul&gt;&lt;a name="lt"&gt;   &lt;/a&gt;&lt;li&gt;&lt;a name="lt"&gt; A newline (line feed) character (&lt;tt&gt;'\n'&lt;/tt&gt;),     &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a name="lt"&gt; A carriage-return character followed immediately by a newline    character (&lt;tt&gt;"\r\n"&lt;/tt&gt;),     &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a name="lt"&gt; A standalone carriage-return character (&lt;tt&gt;'\r'&lt;/tt&gt;),     &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a name="lt"&gt; A next-line character (&lt;tt&gt;'\u0085'&lt;/tt&gt;),     &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a name="lt"&gt; A line-separator character (&lt;tt&gt;'\u2028'&lt;/tt&gt;), or     &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a name="lt"&gt; A paragraph-separator character (&lt;tt&gt;'\u2029&lt;/tt&gt;).   &lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;a name="lt"&gt; &lt;/a&gt;&lt;p&gt;&lt;a name="lt"&gt;If &lt;/a&gt;&lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#UNIX_LINES"&gt;&lt;code&gt;UNIX_LINES&lt;/code&gt;&lt;/a&gt; mode is activated, then the only line terminators  recognized are newline characters.   &lt;/p&gt;&lt;p&gt; The regular expression &lt;tt&gt;.&lt;/tt&gt; matches any character except a line  terminator unless the &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#DOTALL"&gt;&lt;code&gt;DOTALL&lt;/code&gt;&lt;/a&gt; flag is specified.   &lt;/p&gt;&lt;p&gt; By default, the regular expressions &lt;tt&gt;^&lt;/tt&gt; and &lt;tt&gt;$&lt;/tt&gt; ignore  line terminators and only match at the beginning and the end, respectively,  of the entire input sequence. If &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#MULTILINE"&gt;&lt;code&gt;MULTILINE&lt;/code&gt;&lt;/a&gt; mode is activated then  &lt;tt&gt;^&lt;/tt&gt; matches at the beginning of input and after any line terminator  except at the end of input. When in &lt;a href="http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html#MULTILINE"&gt;&lt;code&gt;MULTILINE&lt;/code&gt;&lt;/a&gt; mode &lt;tt&gt;$&lt;/tt&gt;  matches just before a line terminator or the end of the input sequence.   &lt;a name="cg"&gt;  &lt;/a&gt;&lt;/p&gt;&lt;h4&gt;&lt;a name="cg"&gt; Groups and capturing &lt;/a&gt;&lt;/h4&gt;  &lt;a name="cg"&gt; &lt;/a&gt;&lt;p&gt;&lt;a name="cg"&gt; Capturing groups are numbered by counting their opening parentheses from  left to right.  In the expression &lt;tt&gt;((A)(B(C)))&lt;/tt&gt;, for example, there  are four such groups: &lt;/a&gt;&lt;/p&gt;  &lt;a name="cg"&gt; &lt;/a&gt;&lt;blockquote&gt;&lt;table summary="Capturing group numberings" cellpadding="1" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;th&gt;1    &lt;/th&gt;      &lt;td&gt;&lt;tt&gt;((A)(B(C)))&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;th&gt;2    &lt;/th&gt;      &lt;td&gt;&lt;tt&gt;(A)&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;th&gt;3    &lt;/th&gt;      &lt;td&gt;&lt;tt&gt;(B(C))&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;&lt;th&gt;4    &lt;/th&gt;      &lt;td&gt;&lt;tt&gt;(C)&lt;/tt&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;/blockquote&gt;  &lt;a name="cg"&gt; &lt;/a&gt;&lt;p&gt;&lt;a name="cg"&gt; Group zero always stands for the entire expression.   &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="cg"&gt; Capturing groups are so named because, during a match, each subsequence  of the input sequence that matches such a group is saved.  The captured  subsequence may be used later in the expression, via a back reference, and  may also be retrieved from the matcher once the match operation is complete.   &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="cg"&gt; The captured input associated with a group is always the subsequence  that the group most recently matched.  If a group is evaluated a second time  because of quantification then its previously-captured value, if any, will  be retained if the second evaluation fails.  Matching the string  &lt;tt&gt;"aba"&lt;/tt&gt; against the expression &lt;tt&gt;(a(b)?)+&lt;/tt&gt;, for example, leaves  group two set to &lt;tt&gt;"b"&lt;/tt&gt;.  All captured input is discarded at the  beginning of each match.   &lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a name="cg"&gt; Groups beginning with &lt;tt&gt;(?&lt;/tt&gt; are pure, &lt;i&gt;non-capturing&lt;/i&gt; groups  that do not capture text and do not count towards the group total.    &lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-7741204867193832707?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7741204867193832707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7741204867193832707'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/09/regular-expressions.html' title='Regular Expressions'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-3988112915052344213</id><published>2011-09-28T15:13:00.000-07:00</published><updated>2011-09-28T15:15:02.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Change Firefox icon</title><content type='html'>http://www.aqua-soft.org/forum/topic/28029-help-change-firefox-taskbar-icon/&lt;br /&gt;&lt;br /&gt;"There's another way to do this;&lt;br /&gt;&lt;br /&gt;1.  Go to the folder you installed Firefox in (e.g. C:Program FilesMozilla Firefox) and then go to the subfolder chrome.&lt;br /&gt;2. While in chrome folder, create a new subfolder called ''icons'', then  go to that folder and create yet another subfolder called ''default''.  The full path to this folder could be C:Program FilesMozilla  Firefoxchromeiconsdefault.&lt;br /&gt;3. Choose the icon you want to use and place it in the ''default''  folder and rename the icon to ''main-window', e.g. main-window.ico on  Windows and main-window.xpm on Linux.&lt;br /&gt;&lt;br /&gt;In addition to the main window, you can also change the icon on the  Bookmark Manager and JavaScript Console. The icon names are  ''bookmark-window''.[ext] and ''jsconsoleWindow''.[ext], respectively.&lt;br /&gt;&lt;br /&gt;After this is done, restart Firefox and you should be able to see your chosen icon in the title of the browser windows."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-3988112915052344213?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3988112915052344213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3988112915052344213'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/09/change-firefox-icon.html' title='Change Firefox icon'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-6989097929737708625</id><published>2011-08-27T13:33:00.000-07:00</published><updated>2011-09-02T13:34:31.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Greasemonkey'/><title type='text'>Change Yahoo Mail links 2</title><content type='html'>Another round of YM changes -&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-6989097929737708625?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6989097929737708625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6989097929737708625'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/08/change-yahoo-mail-links-2.html' title='Change Yahoo Mail links 2'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2731134856169232973</id><published>2011-07-20T08:41:00.000-07:00</published><updated>2011-07-20T09:23:08.748-07:00</updated><title type='text'>EDI File Parser</title><content type='html'>A utility to quickly parse EDI file. Support for direct file path or EC Run Control.&lt;br /&gt;This example uses delivered VCHR definition.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2731134856169232973?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2731134856169232973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2731134856169232973'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/07/edi-file-parser.html' title='EDI File Parser'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-5549781110418082902</id><published>2011-06-09T09:38:00.000-07:00</published><updated>2011-07-08T15:10:34.962-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'>Network Monitoring, packet analysis tool</title><content type='html'>&lt;a href="http://www.wireshark.org/download.html"&gt;http://www.wireshark.org/download.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-5549781110418082902?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5549781110418082902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5549781110418082902'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/06/email-with-sender-reply-to-attachemnt.html' title='Network Monitoring, packet analysis tool'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-7680574776356626396</id><published>2011-05-24T13:55:00.000-07:00</published><updated>2011-09-16T14:17:35.834-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>Oracle tools for SQL Optimizer and Execution Plans</title><content type='html'>&lt;span style="font-size:100%;"&gt; &lt;span style="font-size:100%;"&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Oracle SQL Optimizer and Execution Plan details:&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;span style="font-size:100%;"&gt;&lt;li&gt;&lt;p class="MsoNormal"&gt;SQL Trace 10046&lt;/p&gt;&lt;/li&gt;  &lt;li&gt;  &lt;p class="MsoNormal"&gt;SQL*Plus "set autotrace"&lt;/p&gt;&lt;/li&gt;  &lt;li&gt;  &lt;p class="MsoNormal"&gt;Extended execution plan statistics (v$sql_workarea)&lt;/p&gt;  &lt;/li&gt;  &lt;li&gt;  &lt;p class="MsoNormal"&gt;The gather_plan_statistics hint (or   statistics_level=all)&lt;/p&gt;&lt;/li&gt;Select /*+ gather_plan_statistics */&lt;br /&gt;* From xxx where....&lt;br /&gt;&lt;br /&gt;Select * From v$sql Order By last_active_time desc&lt;br /&gt;&lt;br /&gt;Select * From Table(dbms_xplan.display_cursor('77w1cgpppqu79','0','allstats  +peeked_binds'))&lt;br /&gt;&lt;br /&gt;Select * From Table(dbms_xplan.display_cursor(Null, Null, 'ALLSTATS LAST'));&lt;br /&gt;&lt;br /&gt;Oracle Ref: http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams044.htm#REFRN10028&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="MsgBodyText"&gt;&lt;pre&gt;alter session set events 'immediate trace name flush_cache';&lt;/pre&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;pre&gt;alter system flush buffer_cache;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;alter system flush shared_pool;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;ALTER TABLESPACE &lt;tablespace_name&gt; OFFLINE;&lt;/tablespace_name&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;ALTER TABLESPACE &lt;tablespace_name&gt; ONLINE;&lt;/tablespace_name&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;v$sql_optimizer_env - cursor in the SGA&lt;/li&gt;&lt;li&gt;v$ses_optimizer_env - session&lt;/li&gt;&lt;li&gt;v$sys_optimizer_env - system&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;pre&gt;select level n from dual connect by level &amp;lt;= 10000;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Great explanation about Consistent Gets &amp;amp; DB Block Gets:  http://mwidlake.wordpress.com/2009/06/02/what-are-consistent-gets/&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-7680574776356626396?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7680574776356626396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7680574776356626396'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/05/oracle-tools-for-sql-optimizer-and.html' title='Oracle tools for SQL Optimizer and Execution Plans'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-841456153141425997</id><published>2011-01-07T20:52:00.000-08:00</published><updated>2011-01-07T21:00:05.919-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Joomla'/><title type='text'>Joomla</title><content type='html'>Using the technique described below you can add a Super Administrator if you have access to Joomla DB:&lt;br /&gt;&lt;a href="http://www.instantphp.com/news/37-tips-and-tricks/76-recover-super-administrator-password-of-joomla-10x-and-15x.html" target="_new"&gt;&lt;br /&gt;http://www.instantphp.com/news/37-tips-and-tricks/76-recover-super-administrator-password-of-joomla-10x-and-15x.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-841456153141425997?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/841456153141425997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/841456153141425997'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2011/01/joomla.html' title='Joomla'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2931349374794652103</id><published>2010-12-16T10:13:00.000-08:00</published><updated>2011-05-25T08:37:47.721-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Greasemonkey'/><title type='text'>Change Yahoo Mail links</title><content type='html'>Recently Yahoo Mail replaced the My Yahoo link with Games on its home screen:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Q9BiCRdiMDI/TQ_Ny61ThQI/AAAAAAAABDI/h9kvCbss6QE/s1600/ym_link.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 30px;" src="http://4.bp.blogspot.com/_Q9BiCRdiMDI/TQ_Ny61ThQI/AAAAAAAABDI/h9kvCbss6QE/s400/ym_link.JPG" alt="" id="BLOGGER_PHOTO_ID_5552883140241097986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is a headache because I dont play any web Games &amp;amp; had a lot of links under My Yahoo. Using Greasemonkey on my Firefox to tweak it back and put up a host of the most oft-used links there.  Thanks YM for the idea - now the Mail screen is my time-saving launch pad:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Q9BiCRdiMDI/TREl3G16ELI/AAAAAAAABDQ/50OBAjpDfBw/s1600/ym_link2.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 25px;" src="http://2.bp.blogspot.com/_Q9BiCRdiMDI/TREl3G16ELI/AAAAAAAABDQ/50OBAjpDfBw/s400/ym_link2.JPG" alt="" id="BLOGGER_PHOTO_ID_5553261444184281266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Code:&lt;br /&gt;// ********************************** 12/16/10 - changed Games link back to My Yahoo&lt;br /&gt;var xx=document.getElementById("_test_my_yahoo");&lt;br /&gt;if (xx != null)&lt;br /&gt;{&lt;br /&gt;xx.setAttribute("href","http://my.yahoo.com/");&lt;br /&gt;xx.innerHTML="My Yahoo!";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ********************************** 12/16/10 - added extra links&lt;br /&gt;var xx=document.getElementById("networklinkscx");&lt;br /&gt;if (xx != null)&lt;br /&gt;{&lt;br /&gt;xx.innerHTML=xx.innerHTML +&lt;br /&gt;' | &lt;a href="https://mail.google.com/" target="_blank" class="textLink" title="GMail"&gt;Gmail&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://news.google.com/news/section?pz=1&amp;amp;cf=all&amp;amp;topic=t" target="_blank" class="textLink" title="Mews"&gt;News&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://.../stat/action/listerview" target="_blank" class="textLink" title="STAT"&gt;STAT&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="https://oltx.fidelity.com/ftgw/fbc/ofsummary/summary" target="_blank" class="textLink" title="Fidelity"&gt;Fidelity&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://blog.mysanantonio.com/spursnation/" target="_blank" class="textLink" title="SASpurs"&gt;Spurs&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://forum.archosfans.com/viewforum.php?f=74" target="_blank" class="textLink" title="Archos 101"&gt;A101&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://www.consumerreports.org/cro/index.htm" target="_blank" class="textLink" title="Consumer Reports"&gt;CR&lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="https://www.logmein.com/" target="_blank" class="textLink" title="LogMeIn"&gt;LogMeIn &lt;/a&gt;' +&lt;br /&gt;' | &lt;a href="http://www.bluespur.blogspot.com/" target="_blank" class="textLink" title="Blog"&gt;Blog &lt;/a&gt;' ;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2931349374794652103?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2931349374794652103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2931349374794652103'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/12/change-yahoo-mail-links.html' title='Change Yahoo Mail links'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Q9BiCRdiMDI/TQ_Ny61ThQI/AAAAAAAABDI/h9kvCbss6QE/s72-c/ym_link.JPG' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-4768529659749218204</id><published>2010-10-28T15:04:00.000-07:00</published><updated>2011-11-30T08:22:56.840-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Update Object Property</title><content type='html'>The General tab of object property can be used to store description, change documentations, etc.  Often times I find myself not doing this until the end...  It can take a while to go back and open each object to add the description. The following script automates the process by using the Project info for all objects in the project.&lt;br /&gt;&lt;br /&gt;Tools v8.49.12.&lt;br /&gt;&lt;pre&gt;--Update DESCR and DESCRLONG of Project Objects.&lt;br /&gt;-- 1. set LASTUPDDTTM, LASTUPDOPRID To The same As Project&lt;br /&gt;-- 2. append DESCRLONG&lt;br /&gt;-- 3. set DESCR To Project If blank&lt;br /&gt;---------------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;PS has 80+ object types, not all of them are listed here. Look for 'Unknown Object Type: ' and add a section for the object. Trace to see what objects PSIDE is accessing.&lt;br /&gt;A nice &amp;amp; quick tracer app: &lt;a href="http://www.aboves.com/downloads/"&gt;Statement Tracer for Oracle&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-4768529659749218204?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/4768529659749218204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/4768529659749218204'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/10/update-object-property.html' title='Update Object Property'/><author><name>ddjen11</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-3252924650341523557</id><published>2010-06-30T13:31:00.001-07:00</published><updated>2010-06-30T13:31:57.975-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplesoft Project XML Parser</title><content type='html'>Parse Peoplesoft Project XML file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-3252924650341523557?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3252924650341523557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3252924650341523557'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/06/peoplesoft-project-xml-parser.html' title='Peoplesoft Project XML Parser'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2157130575803596899</id><published>2010-05-27T07:37:00.000-07:00</published><updated>2010-07-20T08:52:10.102-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Find Portal Menu Navigation Path</title><content type='html'>PORTAL_OBJNAME is the key -&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If a few page heading text are known, whether at Folder or Content level, use this sql to get PORTAL_OBJNAME:&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Select * From psprsmdefn Where portal_name ='???????' And upper(DESCR254) Like upper('%fuzzy header%') -- find correct PORTAL_OBJNAME&lt;br /&gt;&lt;br /&gt;Use this sql with the PORTAL_OBJNAME:&lt;br /&gt;&lt;br /&gt;With psnav As&lt;br /&gt;(Select RTRIM(Reverse(sys_connect_by_path(Reverse(portal_label),    ' &gt;----- ')),    ' &gt;----- ') navpath,  Level lvl&lt;br /&gt;From psprsmdefn A&lt;br /&gt;Where portal_name = '????????'&lt;br /&gt;START With PORTAL_OBJNAME = 'MY_PORTAL_OBJNAME'&lt;br /&gt;CONNECT By PORTAL_OBJNAME =  Prior PORTAL_PRNTOBJNAME)&lt;br /&gt;Select  navpath From psnav Where lvl=(Select max(lvl) From psnav)&lt;br /&gt;&lt;br /&gt;This traverses from the Portal root down to the queried object.  To go from queried object down:&lt;br /&gt;&lt;br /&gt;Select LTRIM((sys_connect_by_path(portal_label,    ' =====&gt; ')),'=====&gt; '    ) path,  Level lvl&lt;br /&gt;From psprsmdefn A&lt;br /&gt;Where portal_name = '???????'&lt;br /&gt;START With PORTAL_OBJNAME = 'EPGL_IMPORT_JOURNALS'&lt;br /&gt;CONNECT By PORTAL_PRNTOBJNAME = Prior PORTAL_OBJNAME&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If  RECNAME is known:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Select * From ps_XREF_PANEL_VW  Where recname='MY_RECNAME'     -- get PNLNAME&lt;br /&gt;&lt;br /&gt;Select * From ps_PNLGROUP_VW Where PNLNAME='MY_PNLNAME'     -- get PNLGRPNAME&lt;br /&gt;&lt;br /&gt;Select * From psprsmdefn Where PORTAL_NAME = '???????'   And PORTAL_URI_SEG2 = 'MY_PNLGRPNAME'  -- find PORTAL_OBJNAME&lt;br /&gt;&lt;br /&gt;Use above sqls to find navigation up and down from the PORTAL_OBJNAME.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If a few field label texts are known:&lt;/li&gt;&lt;/ul&gt;Select * From pspnlfield Where upper(lbltext) Like upper('%??????%')  --- find page name&lt;br /&gt;&lt;br /&gt;use above sqls to find navigation up and down from the PORTAL_OBJNAME.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2157130575803596899?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2157130575803596899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2157130575803596899'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/05/find-portal-menu-navigation-path.html' title='Find Portal Menu Navigation Path'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-855457601476942745</id><published>2010-05-21T13:16:00.001-07:00</published><updated>2010-05-21T13:26:55.996-07:00</updated><title type='text'>My Quick PL/SQL</title><content type='html'>Read a File:&lt;br /&gt;&lt;br /&gt;Create Directory TMP_DIR As 'xxxxxxxx';&lt;br /&gt;&lt;br /&gt;Declare&lt;br /&gt; input_file   utl_file.file_type;&lt;br /&gt; input_buffer varchar2(98);&lt;br /&gt;pos        NUMBER := 0;&lt;br /&gt;&lt;br /&gt;Begin&lt;br /&gt;input_file := utl_file.fopen ('TMP_DIR','aaaa.bbb', 'R');&lt;br /&gt;&lt;br /&gt;If utl_file.is_open(input_file) Then&lt;br /&gt;   Loop&lt;br /&gt;     Begin&lt;br /&gt;       utl_file.get_line(input_file, input_buffer);&lt;br /&gt;&lt;br /&gt;       If input_buffer Is Null Then&lt;br /&gt;         EXIT;&lt;br /&gt;       End If;&lt;br /&gt;&lt;br /&gt;       Select instr(input_buffer, 'NUMBER OF ROWS FETCHED') Into pos From dual;&lt;br /&gt;&lt;br /&gt;       If pos &gt; 0&lt;br /&gt;       Then&lt;br /&gt;           Select to_number(substr(input_buffer, 92,7)) Into inrcgl_cnt From dual;&lt;br /&gt;           dbms_output.put_line('INRCGL:'|| inrcgl_cnt);&lt;br /&gt;       End If;&lt;br /&gt;&lt;br /&gt;     Exception&lt;br /&gt;       When NO_DATA_FOUND Then&lt;br /&gt;         EXIT;&lt;br /&gt;     End;&lt;br /&gt;   End Loop;&lt;br /&gt;&lt;br /&gt;End If;&lt;br /&gt;&lt;br /&gt;utl_file.fclose(input_file);*/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-855457601476942745?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/855457601476942745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/855457601476942745'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/05/my-quick-plsql.html' title='My Quick PL/SQL'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-8185405515974545767</id><published>2010-01-21T15:15:00.000-08:00</published><updated>2010-03-11T14:21:44.341-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Display external jobs in PS Process Monitor</title><content type='html'>Many task schedulers exist to provide complex and powerful features that PS' own Process Scheduler cannot match.  For example, IBM's Tivoli Workload Scheduler allows complex definition of jobs (=PS' Process) and Job Streams (= PS' Job), server and workstation setup, sophisticated dependency structure, cross platform support, scheduling calendar and beyond, in a GUI environment. You can define complex dependency in its graphical  to drag and link jobs with ease.  A drawback of this is these jobs are not displayed in Process Monitor.  The following are the steps I took to display them in PS:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-8185405515974545767?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8185405515974545767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8185405515974545767'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/01/display-external-jobs-in-ps-process.html' title='Display external jobs in PS Process Monitor'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-7830738666574664829</id><published>2010-01-15T14:59:00.000-08:00</published><updated>2012-01-27T13:35:07.697-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>Quick PS Util - Get Record Description</title><content type='html'>This function displays Record Definition under Property for a PS record, the function can be expanded to display LONG field values for any PS record.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;Create Or replace Function  gl( rec In varchar2, long_fld In varchar2, key_fld In varchar2 )&lt;br /&gt;Return varchar2&lt;br /&gt;As&lt;br /&gt;  l_cursor    integer Default dbms_sql.open_cursor;&lt;br /&gt;  l_n         number;&lt;br /&gt;  l_long_val  varchar2(4000);&lt;br /&gt;  l_long_len  number;&lt;br /&gt;  l_buflen    number := 4000;&lt;br /&gt;  l_curpos    number := 0;&lt;br /&gt;Begin&lt;br /&gt;&lt;br /&gt;  dbms_sql.parse( l_cursor, 'select ' || long_fld || ' from ' || rec ||' where recname=upper(:x)', dbms_sql.native );&lt;br /&gt;  dbms_sql.bind_variable( l_cursor, ':x', key_fld );&lt;br /&gt;&lt;br /&gt;  dbms_sql.define_column_long(l_cursor, 1);&lt;br /&gt;  l_n := dbms_sql.execute(l_cursor);&lt;br /&gt;&lt;br /&gt;  If (dbms_sql.fetch_rows(l_cursor)&amp;gt;0)&lt;br /&gt;  Then&lt;br /&gt;     dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,l_long_val, l_long_len );&lt;br /&gt; End If;&lt;br /&gt;&lt;br /&gt; dbms_sql.close_cursor(l_cursor);&lt;br /&gt;&lt;br /&gt; Return l_long_val;&lt;br /&gt;&lt;br /&gt;End gl;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EX:&lt;br /&gt;Select gl('psrecdefn','descrlong','vendor') From dual&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;**** Nice utility to parse PS SQL Trace files : http://devwfb.blogspot.com/2009/11/script-analyzing-tracesql-file-and.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande;"&gt;Get View Definition Text: &lt;/span&gt;-----------------------------------------------------------------------&lt;br /&gt;select * from user_views where view_name=upper('')&lt;br /&gt;&lt;br /&gt;select DBMS_METADATA.GET_DDL('VIEW',upper('___')) from dual&lt;br /&gt;&lt;br /&gt;select * from PSSQLTEXTDEFN where sqlid=upper('___')&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-7830738666574664829?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7830738666574664829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7830738666574664829'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/01/quick-ps-functions-get-record.html' title='Quick PS Util - Get Record Description'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2138994322873849790</id><published>2010-01-07T15:52:00.001-08:00</published><updated>2011-12-28T14:59:00.620-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'>Korn Shell Snippets</title><content type='html'>&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;Numeric Test --&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.&lt;br /&gt;if [[ -z $(echo $2 | sed 's/[0-9]//g') ]]&lt;br /&gt;then                             &lt;br /&gt;echo "integer only"&lt;br /&gt;fi &lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;if [[ -z $(echo $2 | awk '/^[0-9]+$/') ]]&lt;br /&gt;then                             &lt;br /&gt;echo "integer only"&lt;br /&gt;fi &lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;if [[ ! -z $(awk -v x=$a 'END{if(x==x+0) print "integer"}' /dev/null) ]]&lt;br /&gt;then                             &lt;br /&gt;echo "integer only"&lt;br /&gt;fi &lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Select * From table_name  Where  Regexp_Like(column_name, '^[0-9]+&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;Display Shell line number  --&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;typeset -x PS4='[$LINENO] '&lt;br /&gt;ksh -x script)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;Alias to display File access/mod/create time  --&lt;br /&gt;&lt;/span&gt;alias ft='_(){ echo "modify time: \c";ls -l $1; echo "create time: \c"; ls -lc $1; echo "access time: \c";ls -lu $1; }; _'&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;Display Date Time at prompt:&lt;/span&gt;&lt;br /&gt;export SECONDS="$(date '+3600*%H+60*%M+%S')";typeset -Z2 _h; typeset -Z2  _m ; typeset -Z2  _s;_hh="(SECONDS/3600)%24";_mm="(SECONDS/60)%60";_ss="(SECONDS)%60";_time='${_x[(_m=_mm)==(_h=_hh)==(_s=_ss)]}$_h:$_m:$_s';&lt;br /&gt;export PS1=$(echo "${_time}")':$PWD&amp;gt;';&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;Date math &amp;amp; TZ (AIX):&lt;/span&gt;  &lt;b&gt;/etc/environment&lt;/b&gt; (https://www-304.ibm.com/support/docview.wss?uid=isg3T1000252)&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00 (DST enabled)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CST6CDT is the time zone you are in;  &lt;/li&gt;&lt;li&gt;M3 is the third month;  &lt;/li&gt;&lt;li&gt;.2 is the second occurrence of the day in the month;  &lt;/li&gt;&lt;li&gt;.0 is Sunday;  &lt;/li&gt;&lt;li&gt;/2:00:00  is the time.  &lt;/li&gt;&lt;/ul&gt;# get current TZ value&lt;br /&gt; tz=`echo $TZ | tr -s '[:upper:]' '[\0*]' | cut -d, -f"1"`&lt;br /&gt;&lt;br /&gt; # 2 hrs back&lt;br /&gt; ((tz_2hr_back=$tz+2))&lt;br /&gt;&lt;br /&gt; # date string format = MMDDHHMIYY&lt;br /&gt; TZ=GMT+$tz_2hr_back date +%m%d%H%M%y;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;ksh93 Associative Array:&lt;/span&gt;&lt;br /&gt;unsert color&lt;br /&gt;set -A color&lt;br /&gt;color=([Application Engine]=1 \&lt;br /&gt;[COBOL SQL]=2 \&lt;br /&gt;[Crystal]=3 \&lt;br /&gt;[SQR Process]=4 \&lt;br /&gt;[SQR Report]=5)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;${color[@]}                 = all elements of the array&lt;br /&gt;${!color[@]}                = subscripts of an array&lt;br /&gt;${#color[@]}                = # of elements within the array.&lt;br /&gt;${color[@]:offset:length}   = Elements within a numeric subscript range&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo ${color[@]}          &lt;br /&gt;echo ${!color[@]}         &lt;br /&gt;echo ${#color[@]}         &lt;br /&gt;echo ${color[@]:1:length}&lt;br /&gt;&lt;br /&gt;idx=0&lt;br /&gt;while [ $idx -lt ${#color[@]} ]&lt;br /&gt;do&lt;br /&gt;echo ${color[@]:$idx:1}&lt;br /&gt;((idx=idx+1))&lt;br /&gt;done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2138994322873849790?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2138994322873849790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2138994322873849790'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/01/korn-shell-snippets.html' title='Korn Shell Snippets'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-7288523160282906738</id><published>2009-11-30T09:05:00.000-08:00</published><updated>2009-11-30T09:08:26.191-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>resolve bind variable values in PS trace/log files</title><content type='html'>Peoplesoft SQL and AE trace files display bind variable values along with the sql statements. Here is a script that quickly merges them so the sql statements can be rerun for testing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-7288523160282906738?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7288523160282906738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7288523160282906738'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/11/resolve-bind-variable-values-in.html' title='resolve bind variable values in PS trace/log files'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-1416542044156998919</id><published>2009-07-17T09:26:00.000-07:00</published><updated>2009-07-17T09:53:57.426-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>A Dynamic Prompt Table based on Specific Columns</title><content type='html'>Some Peoplesoft Financials tables include a number of columns that are coming from different modules such as PO, AP, REQ.  Commonly these transaction data are stored in modules' own specific tables, and a certain functions, such as Commitment Control, capture these transaction into a single table.   In such case, the Commitment Control transaction table is defined with a column assigned for each type of the modules, such as VOUCHER_ID, PO_ID, REQ_ID, JOURNAL_ID etc.&lt;br /&gt;&lt;br /&gt;The Search Key for such tables is defined by another auto-incrementing numeric column. This renders the key column meaningless.  On a deliverered search page, user has to know beforehand what the unique key is in order to bring up the transaction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-1416542044156998919?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1416542044156998919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1416542044156998919'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/07/dynamic-prompt-table-based-on-specific.html' title='A Dynamic Prompt Table based on Specific Columns'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-1496658294332437327</id><published>2009-06-23T14:35:00.000-07:00</published><updated>2010-01-15T15:11:19.983-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>Quick PS Util - Display Table data in order of Column Name</title><content type='html'>When using Toad or other tools that displays results in a grid that can be scrolled from left to right, and there are many columns, I usually have to to go back and forth a few times to find a column.  Some of the solutions to this --&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;1. &lt;/span&gt;creataing a function returns a sql that displays fields in the order of filed name:&lt;fieldset&gt;&lt;pre&gt;&lt;code&gt;CREATE OR REPLACE function  fo(table_in IN varchar2)RETURN varchar2&lt;br /&gt;IS&lt;br /&gt;  sql1      varchar2(6000);&lt;br /&gt;  cnt       integer;&lt;br /&gt;  rec_name  varchar2(30);&lt;br /&gt;&lt;br /&gt;  cursor c1 is&lt;br /&gt;     select column_name as fieldname from all_tab_columns where TABLE_NAME=rec_name order by column_name;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt; cnt      :=0; &lt;br /&gt; sql1     :='select ';&lt;br /&gt; rec_name :='PS_'||upper(table_in);&lt;br /&gt;&lt;br /&gt; FOR zz IN c1 LOOP&lt;br /&gt;    sql1:=sql1 || zz.fieldname||',';&lt;br /&gt;    cnt:=cnt+1;&lt;br /&gt; END LOOP;    &lt;br /&gt;&lt;br /&gt; if cnt = 0 then&lt;br /&gt;&lt;br /&gt;    rec_name := upper(table_in);&lt;br /&gt;&lt;br /&gt;    FOR zz IN c1 LOOP&lt;br /&gt;        sql1:=sql1 || zz.fieldname||',';&lt;br /&gt;        cnt:=cnt+1;&lt;br /&gt;    END LOOP;    &lt;br /&gt; end if;&lt;br /&gt;&lt;br /&gt; if cnt = 0  then&lt;br /&gt;    return table_in ||' columns not found';&lt;br /&gt; end if;&lt;br /&gt;&lt;br /&gt; sql1 := sql1 || '''---'' from ' || rec_name ;&lt;br /&gt;&lt;br /&gt; RETURN sql1 ;&lt;br /&gt;&lt;br /&gt;EXCEPTION&lt;br /&gt; WHEN OTHERS THEN&lt;br /&gt;    raise_application_error(-20001,'Errro - '||SQLCODE||' -ERROR- '||SQLERRM);&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;show error function fo&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;Ex:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;select fo('installation') from dual -- default to 'PS_'&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;select fo('psrecdefn') from dual&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;select fo('all_objects') from dual &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-1496658294332437327?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1496658294332437327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1496658294332437327'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/display-table-data-in-order-of-column.html' title='Quick PS Util - Display Table data in order of Column Name'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-643078014106302442</id><published>2009-06-17T21:03:00.000-07:00</published><updated>2010-07-08T08:44:53.760-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Change Peoplesoft FTP to SFTP - Part 4</title><content type='html'>A sample script that ties up things using the information discussed.&lt;br /&gt;&lt;span style="font-size:180%;"&gt;1. &lt;/span&gt;minimize code changes to delivered script &amp;amp; call custom code in separate script&lt;br /&gt;&lt;fieldset&gt;:::::&lt;br /&gt;&lt;pre&gt;cd ${PS_HOME}/bin&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;# source my sftp script&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;. my_sftp_script&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;ftp_cmd_file=$1&lt;/span&gt;&lt;br /&gt;::::::&lt;br /&gt;::::::&lt;br /&gt;echo "about to submit ftp -vin $1"&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;#&lt;/span&gt;&lt;/span&gt;$FTP_CMD -vin &lt; $1    &lt;span style="font-style: italic; font-weight: bold; color: rgb(102, 51, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 51);font-size:130%;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;font-size:130%;" &gt;my_sftp_function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;break&lt;br /&gt;;;&lt;br /&gt;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;::::::::&lt;/pre&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;2. &lt;/span&gt;my_sftp_script:&lt;br /&gt;&lt;fieldset&gt;&lt;pre&gt;#####################################################&lt;br /&gt;#&lt;br /&gt;# My SFTP function&lt;br /&gt;#&lt;br /&gt;#####################################################&lt;br /&gt;function my_sftp_function&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;#singal handler&lt;br /&gt;trap "cleanup" 0&lt;br /&gt;trap "echo Cancelled; cleanup;" 1 2 3 15&lt;br /&gt;&lt;br /&gt;err=0&lt;br /&gt;feedback=1&lt;br /&gt;&lt;br /&gt;SFTP_CMD="/usr/bin/sftp"&lt;br /&gt;sftp_cmd="h_sftp_cmd."$$&lt;br /&gt;sftp_tmp="h_sftp_tmp."$$&lt;br /&gt;sftp_log="h_sftp_log."$$&lt;br /&gt;dev=me@some.place.com&lt;br /&gt;user=/somehost/somedir/user_list&lt;br /&gt;&lt;br /&gt;##### sftp messages           --change text as needed&lt;br /&gt;SFTP_LOGIN_ERR="Permission denied (publickey,password,keyboard-interactive)"&lt;br /&gt;SFTP_NO_FILE="No such file or directory"&lt;br /&gt;&lt;br /&gt;##### ftp messages &amp;amp; codes    --change text as needed&lt;br /&gt;FTP_NO_FILE="A file or directory in the path name does not exist."&lt;br /&gt;FTP_LOGIN_ERR="Login incorrect."&lt;br /&gt;FTP_MAX_SIZE="Exceeded storage allocation"&lt;br /&gt;&lt;br /&gt;FTP_DEL_NOFILE_CD=532&lt;br /&gt;FTP_LOGIN_ERR_CD=530&lt;br /&gt;FTP_MAX_SIZE_CD=552&lt;br /&gt;FTP_GET_NOFILE_CD=550&lt;br /&gt;&lt;br /&gt;FTP_PUT_OK="226 Transfer complete."&lt;br /&gt;FTP_GET_OK="226 Transfer complete."&lt;br /&gt;FTP_DEL_OK="250 DELE command successful."&lt;br /&gt;&lt;br /&gt;###############&lt;br /&gt;# get ftp xfer command, remote dir, remote file name&lt;br /&gt;&lt;br /&gt;cmd=''&lt;br /&gt;r_file=`grep ^put $ftp_cmd_file | awk '{print $3}' | tr '\"' '\0'`&lt;br /&gt;&lt;br /&gt;if [ ${r_file:-none} == 'none' ]; then&lt;br /&gt;&lt;br /&gt;r_file=`grep ^get $ftp_cmd_file | awk '{print $2}' | tr '\"' '\0'`&lt;br /&gt;&lt;br /&gt;if [ ${r_file:-none} == 'none' ]; then&lt;br /&gt;&lt;br /&gt;r_file=`grep ^delete $ftp_cmd_file | awk '{print $2}' | tr '\"' '\0'`&lt;br /&gt;&lt;br /&gt;if [ ${r_file:-none} != 'none' ]; then&lt;br /&gt;  cmd=delete&lt;br /&gt;fi&lt;br /&gt;else&lt;br /&gt;cmd=get&lt;br /&gt;fi&lt;br /&gt;else&lt;br /&gt;cmd=put&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;r_dir=`grep ^cd $ftp_cmd_file | awk 'BEGIN{var=""} {if ($2!="/") var=var"/"$2; else var=var$2; } END{print var}' | sed 's/\/\//\//g'`&lt;br /&gt;&lt;br /&gt;#echo "!sleep 500" &gt; $sftp_cmd&lt;br /&gt;&lt;br /&gt;# convert ftp to sftp commands&lt;br /&gt;grep -e ^lcd -e ^cd -e ^put -e ^delete -e ^get -e ^quit $ftp_cmd_file | sed s/^delete/rm/ | awk '!/^rm/ {print $0} /^rm/ {print $0"\""}'  &gt; $sftp_cmd&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo 'sftp commands---------------'                  &gt; $sftp_log&lt;br /&gt;cat $sftp_cmd                                       &gt;&gt; $sftp_log&lt;br /&gt;&lt;br /&gt;echo '\nsftp log--------------------'               &gt;&gt; $sftp_log&lt;br /&gt;&lt;br /&gt;# run sftp command batch file&lt;br /&gt;$SFTP_CMD -b $sftp_cmd `grep ^user $ftp_cmd_file|awk '{print $2}'`@`grep ^open $ftp_cmd_file|awk '{print $2}'` 1&gt;&gt;$sftp_log 2&gt;&amp;amp;1&lt;br /&gt;&lt;br /&gt;err=$?&lt;br /&gt;&lt;br /&gt;if [ $err -ne 0 ]; then&lt;br /&gt;&lt;br /&gt;grep -qi $SFTP_LOGIN_ERR $sftp_log&lt;br /&gt;&lt;br /&gt;if [ $? -eq 0 ]; then&lt;br /&gt;echo $FTP_LOGIN_ERR_CD" "$FTP_LOGIN_ERR&lt;br /&gt;else&lt;br /&gt;grep -qi  $SFTP_NO_FILE $sftp_log&lt;br /&gt;&lt;br /&gt;if [ $? -eq 0 ]; then&lt;br /&gt;&lt;br /&gt;   if [ $cmd = 'delete' ]; then&lt;br /&gt;       echo $FTP_DEL_NOFILE_CD" "$FTP_NO_FILE&lt;br /&gt;   else&lt;br /&gt;       echo $FTP_GET_NOFILE_CD" "$FTP_NO_FILE&lt;br /&gt;   fi&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;   grep -qi  $FTP_MAX_SIZE $sftp_log&lt;br /&gt;&lt;br /&gt;   if [ $? -eq 0 ]; then&lt;br /&gt;&lt;br /&gt;       echo $FTP_MAX_SIZE_CD" "$FTP_MAX_SIZE&lt;br /&gt;&lt;br /&gt;   fi&lt;br /&gt;fi&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;# check sftp results&lt;br /&gt;&lt;br /&gt;echo '\nverifying results------------'            &gt;&gt;$sftp_log&lt;br /&gt;&lt;br /&gt;chk_results&lt;br /&gt;&lt;br /&gt;err=$?&lt;br /&gt;&lt;br /&gt;if [ $err -eq 0 ]; then&lt;br /&gt;&lt;br /&gt;if [ $cmd = 'get' ]; then&lt;br /&gt;   echo $FTP_GET_OK&lt;br /&gt;else&lt;br /&gt;   if [ $cmd = 'put' ]; then&lt;br /&gt;       echo $FTP_PUT_OK&lt;br /&gt;   else&lt;br /&gt;       echo $FTP_DEL_OK&lt;br /&gt;   fi&lt;br /&gt;fi&lt;br /&gt;fi&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# send feedback&lt;br /&gt;if [ $err -ne 0 ] &amp;amp;&amp;amp; [ $feedback -eq 1 ]; then&lt;br /&gt;&lt;br /&gt;echo $cmd' failed.'                                &gt;&gt; $sftp_log                     &lt;br /&gt;                                      &lt;br /&gt;echo '\nftpunx log------------------'              &gt;&gt; $sftp_log&lt;br /&gt;echo ${ftp_cmd_file%.*}".log:"                     &gt;&gt; $sftp_log&lt;br /&gt;cat `echo ${ftp_cmd_file%.*}".log"`                &gt;&gt; $sftp_log&lt;br /&gt;                                      &lt;br /&gt;echo '\nEnd: '`date`                               &gt;&gt; $sftp_log&lt;br /&gt;&lt;br /&gt;if [ -f  $user ]; then&lt;br /&gt;mailx -s"My SFTP failed" `cat $user`             &lt; $sftp_log     else                                                          mailx -s"My SFTP failed" $dev                    &lt; $sftp_log    fi  fi  return $err  }  ################################################ # # check SFTP results # ################################################ function chk_results {  case $cmd in        put | get)         # compare file sizes                  echo "         `grep ^cd $ftp_cmd_file`         ls -l "$r_file"          quit         " &gt; $sftp_cmd&lt;br /&gt;&lt;br /&gt;$SFTP_CMD -b $sftp_cmd `grep ^user $ftp_cmd_file|awk '{print $2}'`@`grep ^open $ftp_cmd_file|awk '{print $2}'` 1&gt;$sftp_tmp 2&gt;&amp;amp;1&lt;br /&gt;&lt;br /&gt;if [ $? -ne 0 ]; then&lt;br /&gt;   return 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# get temp local file name&lt;br /&gt;&lt;br /&gt;if [ $cmd = 'put' ]; then&lt;br /&gt;  l_file=`grep ^lcd $ftp_cmd_file | awk 'BEGIN{var=""} {if ($2!="/") var=var"/"$2; else var=var$2; } END{print var}' | sed 's/\/\//\//g'`/`grep ^put $ftp_cmd_file | awk '{print $2}' | tr '\"' '\0'`&lt;br /&gt;else&lt;br /&gt;  l_file=`grep ^lcd $ftp_cmd_file | awk 'BEGIN{var=""} {if ($2!="/") var=var"/"$2; else var=var$2; } END{print var}' | sed 's/\/\//\//g'`/`grep ^get $ftp_cmd_file | awk '{print $3}' | tr '\"' '\0'`&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;l_file_size=`ls -l $l_file | awk '{print $5}'`&lt;br /&gt;r_file_size=`grep -v ^sftp $sftp_tmp | grep $r_file | awk '{print $5}'`&lt;br /&gt;&lt;br /&gt;if [ $l_file_size -ne $r_file_size ]; then&lt;br /&gt;&lt;br /&gt;   echo 'file size different:'                                 &gt;&gt; $sftp_log&lt;br /&gt;   echo 'local  file size='$l_file_size' ('$l_file')'          &gt;&gt; $sftp_log  &lt;br /&gt;   echo 'remote file size='$r_file_size' ('$r_dir'/'$r_file')' &gt;&gt; $sftp_log&lt;br /&gt;&lt;br /&gt;   return 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;break&lt;br /&gt;;;&lt;br /&gt;&lt;br /&gt;delete)&lt;br /&gt;&lt;br /&gt;# DELETE - verify file does not exist; use subshell so sftp does not error off&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;echo "&lt;br /&gt;`grep ^cd $ftp_cmd_file`&lt;br /&gt;ls -l "$r_file"&lt;br /&gt;quit&lt;br /&gt;"&lt;br /&gt;) | $SFTP_CMD `grep ^user $ftp_cmd_file|awk '{print $2}'`@`grep ^open $ftp_cmd_file|awk '{print $2}'` 1&gt;$sftp_tmp 2&gt;&amp;amp;1&lt;br /&gt;&lt;br /&gt;if [ $? -ne 0 ]; then&lt;br /&gt;   return 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;grep -q "$2 not found" $sftp_tmp&lt;br /&gt;&lt;br /&gt;if [ $? -ne 0 ]; then&lt;br /&gt;   cat $sftp_tmp                                               &gt;&gt; $sftp_log&lt;br /&gt;&lt;br /&gt;   return 1&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;break&lt;br /&gt;;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;return 0&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function cleanup&lt;br /&gt;{&lt;br /&gt;rm $sftp_tmp 2&gt;/dev/null&lt;br /&gt;rm $sftp_cmd 2&gt;/dev/null&lt;br /&gt;rm $sftp_log 2&gt;/dev/null&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/fieldset&gt;&lt;br /&gt;Navigation to related pages:&lt;br /&gt;&lt;br /&gt;Page Used to Define an FTP Server for File Attachments   &lt;table border="1" cellpadding="7" cellspacing="0" width="100%"&gt; &lt;thead valign="BOTTOM"&gt; &lt;tr align="CENTER" bgcolor="#000080"&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Page Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Object Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Navigation&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Usage&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody valign="TOP"&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;URL Maintenance&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;URL_TABLE&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;PeopleTools, Utilities, Administration, URLs&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Specify an FTP server for storing file &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h4&gt;Page used to Set Up File Attachment Servers&lt;a name="d0e2077"&gt;&lt;/a&gt;&lt;/h4&gt; &lt;table border="1" cellpadding="7" cellspacing="0" width="100%"&gt; &lt;colgroup&gt; &lt;col span="1" width="2*"&gt; &lt;col span="1" width="5*"&gt; &lt;col span="1" width="25%"&gt; &lt;col span="1" width="25%"&gt; &lt;/colgroup&gt; &lt;thead valign="BOTTOM"&gt; &lt;tr align="CENTER" bgcolor="#000080"&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Page Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Object Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Navigation&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Usage&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody valign="TOP"&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Maintain File Att Servers&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;PV_ATT_SRV_ADMIN&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Set Up Financials/Supply Chain, Utilities, Administer File Attachments, Administer Attachment Servers&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Used to set up the FTP server location for PDF and XML file attachments which are included with notifications.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;h4&gt;Pages Used to Set Up Attachments for Transactions&lt;a name="d0e2110"&gt;&lt;/a&gt;&lt;/h4&gt; &lt;table border="1" cellpadding="7" cellspacing="0" width="100%"&gt; &lt;colgroup&gt; &lt;col span="1" width="2*"&gt; &lt;col span="1" width="5*"&gt; &lt;col span="1" width="25%"&gt; &lt;col span="1" width="25%"&gt; &lt;/colgroup&gt; &lt;thead valign="BOTTOM"&gt; &lt;tr align="CENTER" bgcolor="#000080"&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Page Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Object Name&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Navigation&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLEHEAD"&gt;Usage&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody valign="TOP"&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Maintain File Att Servers&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;PV_ATT_SRV_ADMIN&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Set Up Financials/Supply Chain, Utilities, Administer File Attachments, Administer Attachment Servers&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Identify servers on which to store attachments.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Maintain Component Subdirs&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;PV_ATT_SRV_ADMIN&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Set Up Financials/Supply Chain, Utilities, Administer File Attachments, Administer Attachment Servers, Maintain Component Subdirs &lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Define component names and paths where the attachments are stored.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Vendor Address&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;VNDR_ADDRESS&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;eProcurement, Procurement Application Admin, Maintain Vendors, Vendor Profile, Address&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Define vendor email addresses for sending attachments.&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="TABLE"&gt;URL Maintenance&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;URL_TABLE&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;eProcurement, Procurement Application Admin, Maintain Overall System Options, Maintain FTP Server Location&lt;/p&gt; &lt;/td&gt; &lt;td&gt; &lt;p class="TABLE"&gt;Requires end users to enter the file location manually for attachments (not the recommended method).&lt;/p&gt; &lt;ol class="LISTNUMBER"&gt;&lt;li class="LISTNUMBER"&gt; &lt;p&gt;Set up a location for storing attachments. This is usually an FTP server. Add a subfolder named PV to the root directory. Give read and write privileges to anonymous users or any users that are specified in the FTP string. &lt;/p&gt; &lt;/li&gt;&lt;li class="LISTNUMBER"&gt; &lt;p&gt;Create a URL identifier that is named PV for the FTP location for PeopleSoft eProcurement attachments, and specify the FTP server address. The FTP root location must contain a subdirectory that is named PV. &lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-3.html"&gt;Change Peoplesoft FTP to SFTP - Part3&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-643078014106302442?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/643078014106302442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/643078014106302442'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-4.html' title='Change Peoplesoft FTP to SFTP - Part 4'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-3906535520464874544</id><published>2009-06-09T09:04:00.000-07:00</published><updated>2009-10-12T12:30:54.040-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Change Peoplesoft FTP to SFTP - Part 3</title><content type='html'>Because FTP is like any 3rd party application to PS, and it generally passes a return code of zero in the non-interactive session, it is not useful in determining a Success or Fail status.  So PS is using the session message that is captured in the log file and filtering the FTP status code.  A list of status code I can find that is used by PS for this :&lt;br /&gt;&lt;br /&gt;226 - Transfer complete.&lt;br /&gt;250 - DELE command successful.&lt;br /&gt;532 - A file or directory in the path name does not exist&lt;br /&gt;550 - A file or directory in the path name does not exist&lt;br /&gt;552 - Exceeded storage allocation&lt;br /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on down" style="display: block;" id="formatbar_ForeColor" title="Text Color" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);SelectColor(this,'ForeColor');ButtonMouseDown(this);"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Text Color" class="gl_color_fg" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The following considerations should be taken in regards to the wide range of systems and implementation of SFTP executables:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The only way I found that can consistently returns a error status code is the "-b" batch option. If you use HERE document or subshell-echo it returns zero even if there are  errors.&lt;/li&gt;&lt;li&gt;The &lt;a href="http://en.wikipedia.org/wiki/List_of_FTP_server_return_codes"&gt;FTP status code&lt;/a&gt; should be standard, but the message text can vary per system.  SFTP does not have a standard status code (on our system), and message text can also vary by systems. &lt;/li&gt;&lt;/ul&gt;So analyze and thoroughly test the code, look for variations in message text and make necessary adjustments.&lt;br /&gt;&lt;br /&gt;The Peoplecode statement for adding/loading a file is like:&lt;br /&gt;&lt;iframe src="http://www.blog.onacu.com/images/blogpost/PS_sftp_7.jpg" alt="" border="0" height="239" width="1024"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;The function (AddAttachment) calls ExecutePutAttachment API which examines the log file (ftp????_?????.log) for FTP status code then sets RETCODE as follows:&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="0" width="800"&gt;&lt;tbody&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;&lt;strong&gt;System Variable for &amp;amp;RETCODE&lt;/strong&gt;&lt;/td&gt;      &lt;td valign="top" width="49"&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;strong&gt;FTP Code&lt;/strong&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_Success&lt;/td&gt;      &lt;td valign="top" width="49"&gt;0&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_Failed&lt;/td&gt;      &lt;td valign="top" width="49"&gt;1&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_Cancelled&lt;/td&gt;      &lt;td valign="top" width="49"&gt;2&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;user hit “CANCEL” instead of “Upload”&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_FileTransferFailed&lt;/td&gt;      &lt;td valign="top" width="49"&gt;3&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_NoDiskSpaceAppServ&lt;/td&gt;      &lt;td valign="top" width="49"&gt;4&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;N/A for FTP&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_NoDiskSpaceWebServ&lt;/td&gt;      &lt;td valign="top" width="49"&gt;5&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;N/A for FTP&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_FileExceedsMaxSize&lt;/td&gt;      &lt;td valign="top" width="49"&gt;6&lt;/td&gt;      &lt;td valign="top" width="48"&gt;552&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_DestSystNotFound&lt;/td&gt;      &lt;td valign="top" width="49"&gt;7&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_DestSysFailedLogin&lt;/td&gt;      &lt;td valign="top" width="49"&gt;8&lt;/td&gt;      &lt;td valign="top" width="48"&gt;530&lt;/td&gt;      &lt;td valign="top" width="356"&gt;sftp cannot authenticate &lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_FileNotFound&lt;/td&gt;      &lt;td valign="top" width="49"&gt;9&lt;/td&gt;      &lt;td valign="top" width="48"&gt;550 &lt;/td&gt;      &lt;td valign="top" width="356"&gt;user “Upload” a 0-byte file; “View” file does not exist&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_DeleteFailed&lt;/td&gt;      &lt;td valign="top" width="49"&gt;10&lt;/td&gt;      &lt;td valign="top" width="48"&gt;552     &lt;/td&gt;      &lt;td valign="top" width="356"&gt;user hit “delete” but file does not exist&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_NoFileName&lt;/td&gt;      &lt;td valign="top" width="49"&gt;11&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;user hit “Upload” without selecting a file&lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;      &lt;td valign="top" width="246"&gt;%Attachment_FileNameTooLong&lt;/td&gt;      &lt;td valign="top" width="49"&gt;12&lt;/td&gt;      &lt;td valign="top" width="48"&gt;&lt;br /&gt;&lt;/td&gt;      &lt;td valign="top" width="356"&gt;&lt;br /&gt;&lt;/td&gt;    &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;You can see not all status codes are related to FTP.  This is due to the the fact only a portion of the transfer process utilizes ftp.  Between Browser and Web Server, Web Server &amp;amp; App Server, App Server &amp;amp; DB Server FTP is not involved.  I tried to test as many FTP codes as I can, these are the ones I see PS reports off the log file.  For ex. if you set &amp;amp;MESSAGE_LVL (in FILE_ATTACH_WRK peoplecode) to a value of 1 or 2, you will see a detailed message box after each operation. This is the delivered code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:78%;" &gt;&lt;span style="font-family:arial;"&gt;&amp;amp;RETCODE = AddAttachment(&amp;amp;URL_ID, &amp;amp;ATTACHSYSFILENAME, &amp;amp;FILEEXTENSION, &amp;amp;ATTACHUSERFILE, &amp;amp;FILESIZE);&lt;br /&gt;:::::::::::::::::::::::::::::::::::::&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:78%;" &gt;&lt;span style="font-family:arial;"&gt;If &amp;amp;MESSAGE_LVL = 1 Or&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&amp;amp;MESSAGE_LVL = 2 Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      If (&amp;amp;RETCODE = %Attachment_Failed) Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         MessageBox(0, MsgGetText(137, 1, "File Attachment Status"), 137, 2, "AddAttachment failed");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      End-If;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      :::::::::::::::::::::::::::::::::::::::&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      :::::::::::::::::::::::::::::::::::::::      &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      If (&amp;amp;RETCODE = %Attachment_DestSysFailedLogin) Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         MessageBox(0, MsgGetText(137, 1, "File Attachment Status"), 137, 9, "AddAttachment failed: Unable to login into destination system for ftp");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      End-If;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      If (&amp;amp;RETCODE = %Attachment_FileNotFound) Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         MessageBox(0, MsgGetText(137, 1, "File Attachment Status"), 137, 29, "The file was not found so the operation could not be completed.");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      End-If;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      /* Error Message for Invalid file or No file name */&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      If (&amp;amp;RETCODE = %Attachment_NoFileName) Then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         MessageBox(0, MsgGetText(137, 1, "File Attachment Status"), 137, 38, "AddAttachment failed: No File Name Specified.");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      End-If;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;::::::::::::::::::::::::::::::&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The API &lt;span style="font-weight: bold;font-size:78%;" &gt;&lt;span style="font-family:arial;"&gt;AddAttachment &lt;/span&gt;&lt;/span&gt;will return zero if it sees this FTP session message in the log file:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-weight: bold;font-family:arial;" &gt;226 Transfer complete&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;so the SFTP will simply run:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-weight: bold;font-family:arial;" &gt;echo "226 Transfer complete&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;after it verifies a PUT operation is successful. Similarly, &lt;span style="font-weight: bold;font-size:78%;" &gt;&lt;span style="font-family:arial;"&gt;DeleteAttachment &lt;/span&gt;&lt;/span&gt;API is looking for:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 51, 255);font-family:arial;" &gt;250 DELE command successful&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next is a script that ties everything together.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-2.html"&gt;Change Peoplesoft FTP to SFTP - Part 2&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt; | &lt;/span&gt;&lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-2.html"&gt;&lt;/a&gt;&lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-4.html"&gt;Change Peoplesoft FTP to SFTP - Part4&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-3906535520464874544?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3906535520464874544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/3906535520464874544'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-3.html' title='Change Peoplesoft FTP to SFTP - Part 3'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-6842788033826645584</id><published>2009-06-08T15:03:00.000-07:00</published><updated>2010-05-21T15:39:53.088-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Change Peoplesoft FTP to SFTP - Part 2</title><content type='html'>In the PS generated script, ftp?????_????.txt, it stores the host, login, cd, lcd, get/put/delete &amp;amp; quit commands.  A single file is processed each time.   Prior to doing sftp, the correct public/private keys need to be generated, known_host and authorized_keys must be set up for the ftp use account.  Converting the script to run sftp is straightforward, in 2 steps:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;1. &lt;/span&gt;grep -e ^lcd -e ^cd -e ^put -e ^delete -e ^get -e ^quit $ftp_cmd_file | sed s/^delete/rm/ | awk '!/^rm/ {print $0} /^rm/ {print $0"\""}'  &gt; $sftp_cmd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This extracts all ftp commands, excluding host and login info, and stores them into a temp sftp script.  The ftp "delete" command is replaced by sftp  "rm" command.  In addition, for DELETE operation, PS leaves off a closing ", so it looks like this&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 153);"&gt;delete "XXXXXX.YYY&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;FTP does not complain it, but SFTP is more strict in syntax and will cause an error.  The command changes it to&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 153);"&gt;rm "XXXXXX.YYY"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For PUT operation, PS inserted a "mkdir" command.  This will cause SFTP to error in batch mode. So this command is not picked up by the script, just verify the directory exists beforehand.&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;2.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt; $SFTP_CMD -b $sftp_cmd `grep ^user $ftp_cmd_file|awk '{print $2}'`@`grep ^open $ftp_cmd_file|awk '{print $2}'` 1&gt;$sftp_log 2&gt;&amp;amp;1&lt;br /&gt;&lt;/span&gt;($SFTP_CMD = sftp executable)&lt;span style="color: rgb(51, 0, 153); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 153); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;This executes SFTP in batch mode, with host name and login info from the original ftp script. Password is not needed, as it will be authenticated by Public Key.&lt;br /&gt;&lt;br /&gt;I embedded a sleep command in SFTP to get a view at the process tree for this&lt;br /&gt;&lt;iframe src="http://www.blog.onacu.com/images/blogpost/PS_sftp_5.jpg" alt="" border="0" height="115" width="1226"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;24781020 - An App Server instance handles the PS connection and peforms&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;15798308 - App Server instances spwans a shell &amp;amp; executes ftpunx script&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;19480650 - ftpunx script runs sftp command&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;14291166 - sftp run ssh to handle file transfer &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;2396354  - ssh exeutes a OS command &lt;/li&gt;&lt;/ul&gt;This is all it takes to transfer a file using secured FTP with sftp.   But this is just the beginning, to fully integrate with PS,  the results must be "relayed" back to PS . This is done through examination of the SFTP log file.  The technique I used is detailed in the next part.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bluespur.blogspot.com/2009/05/change-peoplesoft-ftp-to-sftp-part-1.html"&gt;Change Peoplesoft FTP to SFTP - Part 1&lt;/a&gt; | &lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-3.html"&gt;Change Peoplesoft FTP to SFTP - Part 3&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-6842788033826645584?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6842788033826645584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6842788033826645584'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-2.html' title='Change Peoplesoft FTP to SFTP - Part 2'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-5917870278483863191</id><published>2009-06-03T11:46:00.000-07:00</published><updated>2009-06-05T12:54:17.908-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplesoft Notify Address</title><content type='html'>&lt;span style="font-family:arial;"&gt;Application Package Peoplecode:&lt;br /&gt;PT_WF_NOTIFICATION.Notification.OnExecute&lt;br /&gt;&lt;br /&gt;method Send&lt;br /&gt;&lt;br /&gt;/* SendMail(0, &amp;amp;strEmailCC, "", &amp;amp;strEmailBCC, &amp;amp;Subject, &amp;amp;Message, &amp;amp;strFileNames, &amp;amp;strFileTitles, &amp;amp;tempEmailReplyTo, ";", &amp;amp;ContentType);*/&lt;br /&gt;SendMail(0, &amp;amp;strEmailTo, &amp;amp;strEmailCC, &amp;amp;strEmailBCC, &amp;amp;Subject, &amp;amp;Message, "/path/path/filename.ext", "xxx.txt", "From_Notify@rver.xx.yy.zz", ";", &amp;amp;ContentType, &amp;amp;tempEmailReplyTo, "sender@srvr1.xx.yy.zz");&lt;br /&gt;&lt;br /&gt;Further reading:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;a href="http://www.cns.utoronto.ca/usg/technotes/smtp-intro.html"&gt;SMTP&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://en.kioskea.net/contents/internet/smtp.php3"&gt;Internet Messaging protocols (SMTP,POP3 and IMAP4)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.cns.utoronto.ca/usg/technotes/spam-filtering.html"&gt;SPAM Filtering&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-5917870278483863191?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5917870278483863191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5917870278483863191'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/peoplesoft-notify-address.html' title='Peoplesoft Notify Address'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2847006305866248311</id><published>2009-05-31T17:39:00.001-07:00</published><updated>2010-05-28T08:13:07.227-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Change Peoplesoft FTP to SFTP - Part 1</title><content type='html'>Many workplaces are implementing a higher level of  secured data transfer requirements due to increased security concerns.  The PS delivered file transfer process in v8.49 currently does not support SFTP however. These are the steps I employed to make the switch. This article applies to the file transfer from a client desktop to a FTP server using the delivered ftpunx shell script.&lt;br /&gt;&lt;br /&gt;Firstly a note on the flow of Peoplesoft's File Attachment process. In a 4-tier environment, a file transfer request initiates from the client browser. This file data goes to the Web server using HTTP or HTTPS protocal. Web Server then sends it to App Sever through Jolt. It is in the final leg of the relay, from App Server to destination FTP Sever, that FTP/SFTP is employeed.   When viewing a file, the above steps are reversed.&lt;br /&gt;&lt;br /&gt;The Peoplecode function that transfers a file is &lt;b&gt;AddAttachment&lt;/b&gt;.   There are multiple pages that uses multiple ways to call this function, some directly and some can go through layers of Application Package code, but they ultimately call the same function/&lt;br /&gt;&lt;br /&gt;A look into the behind the scene actions when adding an file attachment -&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;1&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;  &lt;/span&gt;generating a unique temp file name, such as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-size:85%;" &gt;&amp;amp;UniqueName = .OPRID | "_" | String(Month(%Date)) | "_" | String(Day(%Date)) | "_" | String(Year(%Date)) | "_" | String(Hour(%Time)) | "_" | String(Minute(%Time)) | "_" | String(Second(%Time));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The name can vary slightly among different load pages/processes. They are in the general format of Date Time stamp and OPRID.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;2&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 102, 204);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt; &lt;/span&gt;When user hit Attach button, an entry is inserted into PSFILE_ATTDET:&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0pt 0px 0px 0pt; float: left; cursor: pointer; width: 800px; height: 50px;" src="http://www.blog.onacu.com/images/blogpost/PS_sftp_1.jpg" alt="" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;This row will stay in the table as a tag.  FILE_SEQ is 0, FILE_SIZE is 5 bytes, indicating the FILE_DATA size.   (value is HEX 00 64 00 75 00 on my system)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;ATTACHSYSFILENAME is a unique file name that will be used to store file data as it loads in chunks of 28K indexed by FILE_SEQ.   If no file is selected to load, this row is not removed. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt; All the rows (one per chunk) used during file load are deleted after successfully reassembled on App Server, and before actual FTP runs.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;3&lt;/span&gt;. The Upload box displays after the above steps:&lt;br /&gt;&lt;img style="margin: 0pt 0px 0px 0pt; float: left; cursor: pointer; width: 800px; height: 50px;" src="http://www.blog.onacu.com/images/blogpost/PS_sftp_2.jpg" alt="" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;4&lt;/span&gt;. When user selects a file and hit "Upload", internally PS run a FileAttachService API that performs these tasks:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the tag row in PSFILE_ATTDET is cleared&lt;/li&gt;&lt;li&gt;get MAXCHUNKSIZE from PSOPTIONS. Default is 28K.&lt;/li&gt;&lt;li&gt;breaking down file data into chunks of MAXCHUNKSIZE and insert each segment, identified by FILE_SEQ, into PSFILE_ATTDET&lt;/li&gt;&lt;/ul&gt;&lt;iframe src="http://www.blog.onacu.com/images/blogpost/PS_sftp_3.jpg" alt="" border="0" height="745" width="825"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;(the last segment size is smaller because it contains only the remainder of file. so the file size = MAX(FILE_SEQ) - 1 * MAXCHUNKSIZE  + FILE_SIZE of final segment)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;note: the API is not directly accessible from Peoplecode.  PS runs them at appropriate junction to perform special purpose internal tasks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Now that the data has been saved onto a table on Database server.  Next PS will put the data back into a file on App Server.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;5&lt;/span&gt;.    The function &lt;b&gt;AddAttachment&lt;/b&gt; is called after the above has completed.  PS runs internal APIs &lt;span style="font-family:verdana;"&gt;ExecuteGetAttachmentDB&lt;/span&gt; &amp;amp; ExecuteDeleteAttachmentDB:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;reassembles the data from table back into a file, in the order of FILE_SEQ, the location for the temp file is /tmp/PSFTP/&lt;db_name&gt;_?????/????&lt;/db_name&gt;&lt;/li&gt;&lt;li&gt;delete data from PSFILE_ATTDET&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;Now the file is on App Server, ready for FTP to its destination.  When viewing a file, the above steps are reversed.  The file is FTP'ed to App Server, then Jolt'ed to Web Server, then HTTP'ed to client browser.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;6&lt;/span&gt;. Still in &lt;b&gt;AddAttachment&lt;/b&gt;, the API &lt;span style="font-family:verdana;"&gt;ExecutePutAttachment performs the most important tasks of the process:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;parse FTP URL (ftp://UID:PWD@FTP_Dest_Server/xxx/xxx/xxx/&lt;oprod&gt;_&lt;dt&gt;_?????.ext) to build a series of FTP commands (open, user, cd, lcd, get/put/delete...) into a temp script in /tmp/ftp???_????.txt&lt;br /&gt;&lt;/dt&gt;&lt;/oprod&gt;&lt;/li&gt;&lt;li&gt;verify the  FTP script exists&lt;/li&gt;&lt;li&gt;run FTP using the FTP script&lt;/li&gt;&lt;li&gt;check FTP results in /tmp/ftp?????_?????_?????.log&lt;/li&gt;&lt;li&gt;delete FTP script, preserve log if needed&lt;/li&gt;&lt;/ul&gt;This is a very critical step because of the sensitive data involved.   The ftp???.txt contains all FTP commands needed to perform the transfer.   PS runs(spawn()?) the FTP wrapper, $PS_HOME/bin/ftpunx, to send the file.   The output from the ftp is stored in ftp???.log &amp;amp; used to verify results.  This is the process as being run:&lt;br /&gt;&lt;br /&gt;/bin/sh $PS_HOME/bin/ftpunx /tmp/ftp????_????_?????.txt&lt;br /&gt;&lt;br /&gt;A look at ftpunx:&lt;br /&gt;&lt;iframe src="http://www.blog.onacu.com/images/blogpost/PS_sftp_4.jpg" alt="" border="0" height="489" width="880"&gt;&lt;/iframe&gt;&lt;br /&gt;2 things to note: (1) $FTP_CMD is the ftp executable on App server and $1 is the ftp????.txt script (2) because of the location of "result=$?", it's going to always = 0. As a result we will always see "File Transfer Successful" in the log, even in failed situations.  This is misleading but not damaging, because PS does not rely on this check.&lt;br /&gt;&lt;br /&gt;If all goes well, the file is now supposed to be FTP'ed to it's destination.  How does PS verify this?  It checks the resulting session message file.  Before getting into this,  take a look at the changes in the script to run SFTP.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bluespur.blogspot.com/2009/06/change-peoplesoft-ftp-to-sftp-part-2.html"&gt;Change Peoplesoft FTP to SFTP - Part 2&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2847006305866248311?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2847006305866248311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2847006305866248311'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/change-peoplesoft-ftp-to-sftp-part-1.html' title='Change Peoplesoft FTP to SFTP - Part 1'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-8569505440348637103</id><published>2009-05-31T10:05:00.000-07:00</published><updated>2009-06-05T19:50:48.469-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><title type='text'>Cool Gadgets</title><content type='html'>&lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;&lt;iframe src="http://gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/weather/weather.xml&amp;amp;nocache=0&amp;amp;up_degree_unit_type=0&amp;amp;up_first_load=1&amp;amp;up_locations={%22name%22:[%22Ellensburg%22],%22zip_code%22:[%2298926%22],%22city_code%22:[],%22country%22:[%22US%22],%22default%22:0}&amp;amp;up_zip_code=78729&amp;amp;up_city_code=0&amp;amp;up_disable_os=0&amp;amp;up_ver=A&amp;amp;lang=en&amp;amp;country=il&amp;amp;.lang=en&amp;amp;.country=il&amp;amp;synd=ig&amp;amp;mid=52&amp;amp;ifpctok=-1143713565199386485&amp;amp;exp_track_js=1&amp;amp;exp_ids=17259&amp;amp;parent=http://www.google.co.il&amp;amp;extern_js=/extern_js/f/CgJlbhICdXMrMBI4ACwrMBM4ACw/k1VYXjgOIbk.js" width="303" height="330"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;td valign="top" width="200"&gt;&lt;iframe src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/clock/clock.xml&amp;amp;up_skin_id=1&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=316&amp;amp;title=&amp;amp;lang=all&amp;amp;country=ALL&amp;amp;border=0&amp;amp;" width="303" height="330" 23999999="23999999"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;     &lt;td valign="top" width="200"&gt;&lt;iframe src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/converter/converter.xml&amp;amp;up_recents=%5B%5D&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=226&amp;amp;title=__MSG_title__&amp;amp;lang=all&amp;amp;country=ALL&amp;amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;amp;" width="303" height="250"&gt;&lt;/iframe&gt;&lt;/td&gt; &lt;td valign="middle" width="200"&gt;&lt;iframe src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/ip/ip.xml&amp;amp;up_k1=&amp;amp;up_k2=&amp;amp;up_k3=&amp;amp;up_skin_id=&amp;amp;up_sections=&amp;amp;up_last_visit=&amp;amp;up_visits_today=0&amp;amp;up_visits_week=0&amp;amp;up_visits_month=0&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=150&amp;amp;title=&amp;amp;lang=all&amp;amp;country=ALL&amp;amp;border=0&amp;amp;" width="303" height="250" 23999999="23999999" ;=";"&gt;&lt;/iframe&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;script src="http://www.gmodules.com/ig/ifr?url=http://www.labpixies.com/campaigns/maps/maps.xml&amp;amp;up_last_location=0&amp;amp;synd=open&amp;amp;w=320&amp;amp;h=440&amp;amp;title=&amp;amp;lang=all&amp;amp;country=ALL&amp;amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;amp;output=js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-8569505440348637103?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8569505440348637103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8569505440348637103'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/cool-gadgets.html' title='Cool Gadgets'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-5767115379593102669</id><published>2009-05-30T23:01:00.000-07:00</published><updated>2009-05-30T23:05:06.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Greasemonkey'/><title type='text'>Enlarge CSR Description and Resolution Box</title><content type='html'>The web version of Stat has some nice feature over the client desktop version.  But the text editing area for Description and Resolution is way too small.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using a simple greasemonkey script I enlarge both to allow for easy editing:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-5767115379593102669?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5767115379593102669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5767115379593102669'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/enlarge-csr-description-and-resolution.html' title='Enlarge CSR Description and Resolution Box'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-7808296089681418004</id><published>2009-05-29T22:14:00.000-07:00</published><updated>2009-06-20T20:00:33.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development Tools'/><title type='text'>Development Tools -</title><content type='html'>&lt;span style="font-family:arial;"&gt;As a programmer I have used numerous programming tools for development on DOS, Windows, and Unix.  The programming languages include 8086 PC assembly, c, c++, cobol, php, VB, VB script, java script, ASP. Applications that run standalone on PC, Windows,  or Client-Server and Server side.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;  I found a development tool can add to one's coding skill and system knowledge greatly in that it can save large amount of time and facilitates coding, compiling, testing and debugging.  The primary factor for me is the capability to customize Menu, Toolbar and even Context Menu, create Macros, remap Keyboards.  The deafult settings &lt;/span&gt;&lt;span style="font-family:arial;"&gt;usually have a lot of items I dont need, they just take up screen space.  In addition its annoying to see these unused items.  Some functions are set too "dangerously" close.  Like "Commit' and "Rollback", the 2 tiny bitmap button next to each other is a potential trap.&lt;br /&gt;&lt;br /&gt;I am waiting for the day when voice commands becomes a reality for programming task.  For now as little typing as possible.&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li  style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-size:100;" &gt;text editor - &lt;a href="http://www.ultraedit.com/"&gt;Ultraedit&lt;/a&gt; &lt;/span&gt;&lt;span style="font-size:100;"&gt;&lt;span style="font-size:100%;"&gt;by IDM Computer Solutions. Check out the &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;programmer(&amp;amp;founder)'s &lt;a href="http://www.ultraedit.com/company/IDM_full_story.html#update"&gt;story.&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;terminal emulator - &lt;a href="http://www.vandyke.com/products/securecrt/index.html"&gt;SecureCRT&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;span style="font-size:100%;"&gt;by VanDyke Software&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;SQL development - &lt;a href="http://www.quest.com/toad-for-oracle/"&gt;Toad&lt;/a&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;by Quest Software&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;a style="" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.vandyke.com/products/securecrt/index.html"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 48px; height: 48px;" src="http://www.vandyke.com/images/product_icons/securecrt48x.gif" alt="Secure CRT" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on" style="display: block;" id="formatbar_Add_Image" title="Add Image" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="addImage();" onmousedown="CheckFormatting(event);;ButtonMouseDown(this);"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Add Image" class="gl_photo" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.quest.com/toad-for-oracle/toad-for-oracle-base-edition.aspx"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 50px; height: 62px;" src="http://www.quest.com/toad-for-oracle/images/screenshot.gif" alt="Toad" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.ultraedit.com/"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 49px; height: 65px;" src="http://www.ultraedit.com/assets/images/uebox_home.jpg" alt="Ultraedit" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-7808296089681418004?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7808296089681418004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/7808296089681418004'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/crt.html' title='Development Tools -'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-5322430910175678196</id><published>2009-05-29T20:48:00.000-07:00</published><updated>2009-10-12T12:24:53.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'>My bin</title><content type='html'>&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;dd&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#!/bin/csh -f&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#-------------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;set parm = 'ls -l' &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;while (1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   if ($1 == '/od') then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      if ($?bysize) then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         echo 'Error: cannot sort by both date &amp;amp; size'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         exit(1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         set bydate = '-t -r'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      if ($1 == '/os') then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         if ($?bydate) then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            echo 'Error: cannot sort by both date &amp;amp; size'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            exit(1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            set bysize = 'sort -n -k 5'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         if ($1 == '/r') then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            set revse = '-r'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            if ($1 == '/a') then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;               set hidden = '-a'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            else  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;               break&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;            endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;         endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   endif&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   shift&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#---------------------------------------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if ($?hidden) then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   set parm = "$parm $hidden"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if ($?bydate) then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   set parm = "$parm $bydate"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if ($?bysize) then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   $parm $* | $bysize | more -e&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   $parm $* | more -e&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;exit(0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;gr&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#!/bin/ksh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#  this script greps Process&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if [ $1'x' = 'x' ]; then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   echo 'Nothing to grep'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   exit 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;flag=ef &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;while getopts :c:l args&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     case $args in&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     c) clear&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        shift&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        ;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     l) flag=fL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        shift&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        ;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;     esac&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;done  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if [ $flag == "ef" ]; then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    echo "tracing process by name &gt;&gt;&gt;&gt; ps -ef | grep $* "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    ps -ef | grep $* | grep -v ~djen/bin/gr  | grep -v grep&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    echo "tracing single process  tree &gt;&gt;&gt;&gt; ps -fL "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    ps -fL $*&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;path&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;#!/bin/ksh&lt;br /&gt;#-------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;if [ $# -eq 0 ]; then&lt;br /&gt;&lt;br /&gt;echo $PATH | tr ':' '\n'&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;set -A arPATH `echo $PATH | tr ':' ' '`&lt;br /&gt;&lt;br /&gt;idx=0&lt;br /&gt;while [ $idx -lt ${#arPATH[*]} ]&lt;br /&gt;do&lt;br /&gt;    if [ -f ${arPATH[idx]}/$1 ]; then&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;ls -l ${arPATH[idx]}/$1&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;break&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;else&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;((idx=idx+1))&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     &lt;/span&gt;&lt;span style="font-size:130%;"&gt;fi&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-5322430910175678196?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5322430910175678196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5322430910175678196'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/my-bin.html' title='My bin'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-1709551191743641828</id><published>2009-05-29T20:40:00.001-07:00</published><updated>2012-01-30T13:14:12.440-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle/SQL'/><title type='text'>My Oracle SQLs</title><content type='html'>-------------------------------------------------------------------------------------------------------SQL history&lt;br /&gt;http://www.dbasupport.com/oracle/ora10g/session_wait.shtml&lt;br /&gt;&lt;br /&gt;select distinct sql_id from v$active_session_history where  SESSION_ID=&lt;br /&gt;&lt;br /&gt;select distinct sql_id from DBA_HIST_ACTIVE_SESS_HISTORY where  SESSION_ID=&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------DB Objects&lt;br /&gt;--http://www.techonthenet.com/oracle/sys_tables/&lt;br /&gt;all_views&lt;br /&gt;ALL_CATALOG&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------get Session Id name&lt;br /&gt;Select Sid From V$SESSION Where audsid = SYS_CONTEXT('userenv','sessionid')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------get User name&lt;br /&gt;Select '*** User = '||USER||' ***' From dual&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------get db name&lt;br /&gt;Select Name, CREATED, LOG_MODE&lt;br /&gt;From V$DATABASE;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------get DB links&lt;br /&gt;Select db_link From user_db_links;&lt;br /&gt;&lt;br /&gt;Select A.OWNER, A.HOST, A.DB_LINK, A.USERNAME, A.CREATED,&lt;br /&gt;DECODE (B.FLAG, 0, 'NO', 1, 'YES') "Dec", B.AUTHUSR, C.STATUS&lt;br /&gt;From DBA_DB_LINKS A, SYS.USER$ U, SYS.LINK$ B, DBA_OBJECTS C&lt;br /&gt;Where A.DB_LINK = B.Name And&lt;br /&gt;A.OWNER = U.Name And&lt;br /&gt;B.OWNER# = U.USER# And&lt;br /&gt;A.DB_LINK = C.OBJECT_NAME And&lt;br /&gt;A.OWNER = C.OWNER And&lt;br /&gt;C.OBJECT_TYPE = 'DATABASE LINK'&lt;br /&gt;Order By 1, 2, 3;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------------------------------------------SYS_CONTEXT:  http://www.psoug.org/reference/sys_context.html&lt;br /&gt;Select SYS_CONTEXT('userenv','DB_NAME') From dual&lt;br /&gt;&lt;br /&gt;DB_NAME = Database&lt;br /&gt;SERVER_HOST = Name Of server Where DB resides&lt;br /&gt;HOST = Name Of client&lt;br /&gt;SESSION_ID = Session Id&lt;br /&gt;OS_USER = O.S user&lt;br /&gt;SERVICE_NAME = Name Of service conneted To A Session (db Name)&lt;br /&gt;SESSION_USER = Name Of user login Id&lt;br /&gt;SESSION_USERID = dentifier Of The Database user Name By which The Current user Is Authenticated.&lt;br /&gt;Sid =&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------------who is running what&lt;br /&gt;Select s.Program, s.schemaname, s.Sid, s.status, s.process, s.osuser, A.sql_text, P.Program&lt;br /&gt;From v$session s, v$sqlarea A, v$process P&lt;br /&gt;Where s.sql_hash_value=A.hash_value And s.sql_address=A.address And s.paddr=P.addr&lt;br /&gt;--and s.schemaname='&amp;amp;1'&lt;br /&gt;And s.status='ACTIVE'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------Oracle Parameters (init.ora)&lt;br /&gt;Select Name,&lt;br /&gt;DECODE (Type, 1, 'Boolean', 2, 'String', 3, 'INTEGER', 4, 'FILE', 5, 'RESERVED', 6, 'BIG INTEGER') Type,&lt;br /&gt;VALUE, DESCRIPTION, ISSES_MODIFIABLE, ISSYS_MODIFIABLE, ISDEFAULT,&lt;br /&gt;ISMODIFIED, ISADJUSTED&lt;br /&gt;From V$PARAMETER&lt;br /&gt;Order By Name;&lt;br /&gt;&lt;br /&gt;--RBS&lt;br /&gt;Select&lt;br /&gt;r.segment_name segment_name,&lt;br /&gt;r.owner owner,&lt;br /&gt;r.tablespace_name tablespace_name,&lt;br /&gt;r.status status,&lt;br /&gt;ROUND(r.initial_extent/1024/1024) initial_extent,&lt;br /&gt;ROUND(r.next_extent/1024/1024) next_extent,&lt;br /&gt;s.Extents,0 Extents,&lt;br /&gt;ROUND(s.rssize/1024/1024) rssize,&lt;br /&gt;s.xacts active_trans&lt;br /&gt;From&lt;br /&gt;dba_rollback_segs r,&lt;br /&gt;v$rollname n,&lt;br /&gt;v$rollstat s&lt;br /&gt;Where r.segment_name = n.Name&lt;br /&gt;And n.usn = s.usn;&lt;br /&gt;&lt;br /&gt;Select 'Database Version = '||banner From v$version Where Rownum = 1;&lt;br /&gt;&lt;br /&gt;Select 'Database Block Size = '||value From v$parameter Where Name = 'db_block_size';&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------------Date Time difference&lt;br /&gt;Sql&amp;gt; Create Or REPLACE Function datediff( p_what In VARCHAR2,&lt;br /&gt;2 p_d1 In DATE,&lt;br /&gt;3 p_d2 In DATE ) Return NUMBER&lt;br /&gt;4 As&lt;br /&gt;5 l_result NUMBER;&lt;br /&gt;6 Begin&lt;br /&gt;7 Select (p_d2-p_d1) *&lt;br /&gt;8 DECODE( UPPER(p_what),&lt;br /&gt;9 'SS', 24*60*60, 'MI', 24*60, 'HH', 24, Null )&lt;br /&gt;10 Into l_result From dual;&lt;br /&gt;11&lt;br /&gt;11 Return l_result;&lt;br /&gt;12 End;&lt;br /&gt;13 /&lt;br /&gt;Function created&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------who is using rbs?&lt;br /&gt;Select SUBSTR(A.os_user_name,1,8) "OS User"&lt;br /&gt;, SUBSTR(b.object_name,1,30) "Object Name"&lt;br /&gt;, SUBSTR(b.object_type,1,8) "Type"&lt;br /&gt;, SUBSTR(c.segment_name,1,10) "RBS"&lt;br /&gt;, E.process "PROCESS"&lt;br /&gt;, SUBSTR(d.used_urec,1,8) "# Of Records"&lt;br /&gt;, d.used_ublk&lt;br /&gt;From v$locked_object A&lt;br /&gt;, dba_objects b&lt;br /&gt;, dba_rollback_segs c&lt;br /&gt;, v$transaction d&lt;br /&gt;, v$session E&lt;br /&gt;Where A.object_id = b.object_id&lt;br /&gt;And A.xidusn = c.segment_id&lt;br /&gt;And A.xidusn = d.xidusn&lt;br /&gt;And A.xidslot = d.xidslot&lt;br /&gt;And d.addr = E.taddr&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------------Re-Connect&lt;br /&gt;Begin sys.dbms_application_info.set_module('T.O.A.D.', Null); End;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------Client Info&lt;br /&gt;SET serveroutput On&lt;br /&gt;Declare&lt;br /&gt;XXX VARCHAR(20);&lt;br /&gt;&lt;br /&gt;Begin&lt;br /&gt;DBMS_APPLICATION_INFO.SET_CLIENT_INFO ('TOAD1+1');&lt;br /&gt;DBMS_APPLICATION_INFO.READ_CLIENT_INFO (XXX );&lt;br /&gt;DBMS_OUTPUT.PUT_LINE(XXX);&lt;br /&gt;End;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select P.spid,&lt;br /&gt;substr(s.osuser,1,10) osuser,&lt;br /&gt;substr(s.username,1,8) username,&lt;br /&gt;substr(s.Program,1,24) Program,&lt;br /&gt;substr(s.client_info,1,60) ClientInfo&lt;br /&gt;From v$session s, v$process P&lt;br /&gt;Where s.paddr=P.addr&lt;br /&gt;And s.osuser Is Not Null&lt;br /&gt;--and spid=4767916&lt;br /&gt;Order By s.osuser&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------SET_SESSION_LONGOPS&lt;br /&gt;Select * From V$SESSION_LONGOPS Where sql_address='070000004185C7E0'&lt;br /&gt;&lt;br /&gt;Select *-- sql_id&lt;br /&gt;From v$session&lt;br /&gt;Where Sid =24&lt;br /&gt;&lt;br /&gt;Select operation&lt;br /&gt;, options&lt;br /&gt;, object_name&lt;br /&gt;, object_alias&lt;br /&gt;, object_type&lt;br /&gt;&lt;br /&gt;Select *&lt;br /&gt;From v$sql_plan --WHERE object_name='XXXX'&lt;br /&gt;Where address = --'070000004185C7E0'&lt;br /&gt;( Select sql_address&lt;br /&gt;From v$session&lt;br /&gt;Where Sid =24)&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------CBO&lt;br /&gt;Select *--index_name,table_name, blevel, avg_data_blocks_per_key, avg_leaf_blocks_per_key, clustering_factor&lt;br /&gt;From user_indexes Where table_name In ('XXXX','YYYY')&lt;br /&gt;&lt;br /&gt;Select *--table_name, blocks&lt;br /&gt;From user_tables Where table_name In (''XXXX','YYYY')&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_table_stats('orauser', ''XXXX');&lt;br /&gt;EXEC DBMS_STATS.gather_table_stats('orauser', ''XXXX', estimate_percent =&amp;gt; 15);&lt;br /&gt;&lt;br /&gt;EXEC DBMS_STATS.gather_index_stats('orauser', ''XXXX');&lt;br /&gt;EXEC DBMS_STATS.gather_index_stats('orauser', ''XXXX', estimate_percent =&amp;gt; 15);&lt;br /&gt;&lt;br /&gt;--more on Statistics&lt;br /&gt;http://www.oracle-base.com/articles/8i/CostBasedOptimizerAndDatabaseStatistics.php&lt;br /&gt;&lt;br /&gt;Select table_name, num_rows From dba_tables Where owner='orauser'&lt;br /&gt;Order By 2 desc&lt;br /&gt;&lt;br /&gt;Select * From user_tab_cols&lt;br /&gt;&lt;br /&gt;col c1 heading 'Average Waits|forFull| Scan Read I/O' format 9999.999&lt;br /&gt;col c2 heading 'Average Waits|for Index|Read I/O' format 9999.999&lt;br /&gt;col c3 heading 'Percent of| I/O Waits|for Full Scans' format 9.99&lt;br /&gt;col c4 heading 'Percent of| I/O Waits|for Index Scans' format 9.99&lt;br /&gt;col c5 heading 'Starting|Value|for|optimizer|index|cost|adj' format 999&lt;br /&gt;&lt;br /&gt;Select&lt;br /&gt;A.average_wait ,&lt;br /&gt;b.average_wait ,&lt;br /&gt;A.total_waits /(A.total_waits + b.total_waits) ,&lt;br /&gt;b.total_waits /(A.total_waits + b.total_waits) ,&lt;br /&gt;b.average_wait , A.average_wait&lt;br /&gt;From&lt;br /&gt;v$system_event A,&lt;br /&gt;v$system_event b&lt;br /&gt;Where&lt;br /&gt;A.event = 'db file scattered read'&lt;br /&gt;And&lt;br /&gt;b.event = 'db file sequential read'&lt;br /&gt;&lt;br /&gt;Select * From v$system_event&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------File Status&lt;br /&gt;&lt;br /&gt;Select SEGMENT_NAME, STATUS From dba_rollback_segs&lt;br /&gt;&lt;br /&gt;Select * From dba_data_files Order By file_id&lt;br /&gt;&lt;br /&gt;Select FILE#,status,Error From v$datafile_header&lt;br /&gt;&lt;br /&gt;Select Name , status From v$datafile ;&lt;br /&gt;4&lt;br /&gt;/u04/oradata/f752x539/o1_mf_psindex_2pxzbghr_.dbf&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------------AutoNumber in trigger&lt;br /&gt;Create Or REPLACE Trigger TableName_ID_assign&lt;br /&gt;Before Insert On TableName For Each Row&lt;br /&gt;Begin&lt;br /&gt;Select TableName_IDs.Nextval Into :New.Id From dual;&lt;br /&gt;End;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Create Procedure TableName_C( p_ID Out TableName.Id%Type ...) Is&lt;br /&gt;v_NewID TableName.Id%Type;&lt;br /&gt;Begin&lt;br /&gt;Select TableName_IDs.Nextval Into v_NewID From dual;&lt;br /&gt;Insert Into TableName (Id ...) Values (v_NewID ...);&lt;br /&gt;p_ID = v_NewID;&lt;br /&gt;End TableName_C;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------Tables/Index in a TableSpace&lt;br /&gt;Select A.Name,c.Name Tablespace,b.analyzetime analyzed,b.rowcnt ,d.bytes, d.bytes/POWER(2,20) MB,d.bytes/POWER(2,30) GB&lt;br /&gt;From sys.obj$ A, sys.tab$ b, sys.ts$ C,DBA_SEGMENTS d&lt;br /&gt;Where A.Name Like 'XXXX%'&lt;br /&gt;And A.obj#=b.obj#&lt;br /&gt;And b.ts#=c.ts#&lt;br /&gt;And A.Name=d.segment_name&lt;br /&gt;And d.segment_type='TABLE'&lt;br /&gt;And d.tablespace_name=c.Name&lt;br /&gt;&lt;br /&gt;Select A.Name,c.Name Tablespace,b.analyzetime analyzed,b.rowcnt ,d.bytes, d.bytes/POWER(2,20) MB,d.bytes/POWER(2,30) GB&lt;br /&gt;From sys.obj$ A, sys.ind$ b, sys.ts$ C,DBA_SEGMENTS d&lt;br /&gt;Where A.obj#=b.obj#&lt;br /&gt;And b.ts#=c.ts#&lt;br /&gt;And A.Name=d.segment_name&lt;br /&gt;And d.segment_type='INDEX'&lt;br /&gt;And d.tablespace_name=c.Name&lt;br /&gt;And A.Name Like ''XXXX%'&lt;br /&gt;Order By Name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select segment_name,segment_type, bytes/POWER(2,20) MB,bytes/POWER(2,30) GB&lt;br /&gt;From DBA_SEGMENTS Where segment_name Like 'XXXX%'&lt;br /&gt;&lt;br /&gt;Drop Table XXXX&lt;br /&gt;&lt;br /&gt;Select * From sys.tab$&lt;br /&gt;&lt;br /&gt;Select * From DBA_SEGMENTS Where segment_name Like 'XXXX%'&lt;br /&gt;&lt;br /&gt;-- total bytes&lt;br /&gt;Select SUM(BYTES) From USER_SEGMENTS Where SEGMENT_TYPE='TABLE' And segment_name=UPPER(''XXXX')&lt;br /&gt;&lt;br /&gt;--how many MB -GB&lt;br /&gt;Select 1073741824/POWER(2,20) MB, 1073741824/POWER(2,30) GB From dual&lt;br /&gt;&lt;br /&gt;--move to a different tablespace&lt;br /&gt;Alter Table 'XXXX Move Tablespace new_table_space&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------bind variable VALUES IN 10g&lt;br /&gt;http://halisway.blogspot.com/search/Label/oracle&lt;br /&gt;&lt;br /&gt;First  have A look In v$sql To find The Sql Query you are looking For,Join The  sql_id To v$sql_bind_capture And To View The bind variable Values For  that Query.&lt;br /&gt;v$session.sql_hash_value = Current Cursor Sql,  v$session.prev_hash_value = prev Sql. Both can Use To look up Sql text  (HASH_VALUE(&lt;br /&gt;&lt;br /&gt;Select sql_id,sql_text From v$sql Where users_executing &amp;gt; 0&lt;br /&gt;&lt;br /&gt;Select Name, position, DATATYPE_STRING,WAS_CAPTURED,LAST_CAPTURED,VALUE_STRING&lt;br /&gt;From v$sql_bind_capture Where sql_id='5chvypbvbxtau'&lt;br /&gt;&lt;br /&gt;Select sql_text From v$sqlarea Where users_executing &amp;gt; 0&lt;br /&gt;&lt;br /&gt;--from SID&lt;br /&gt;Select  SQL_TEXT,sql_id From V$SQLTEXT_WITH_NEWLINES Where  HASH_VALUE=TO_NUMBER((Select sql_hash_value From v$session Where Sid  =459 And Type &amp;lt;&amp;gt; 'BACKGROUND')) Order By PIECE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------Oracle select Index&lt;br /&gt;--&amp;gt;&amp;gt; USER_TAB_COLUMNS.NUM_DISTINCT - This column defines the number of distinct values the column holds.&lt;br /&gt;&lt;br /&gt;Select * From USER_TAB_COLUMNS Where table_name='XXXXX' And column_name='BUSINESS_UNIT'&lt;br /&gt;&lt;br /&gt;--USER_TABLES.NUM_ROWS - IF NUM_DISTINCT = NUM_ROWS THEN USING an INDEX would be preferable TO doing a FULL TABLE SCAN.&lt;br /&gt;--AS the NUM_DISTINCT decreases, the cost OF USING an INDEX increase thereby making the INDEX LESS desirable.&lt;br /&gt;&lt;br /&gt;Select * From USER_TABLES Where table_name='XXXXX'&lt;br /&gt;&lt;br /&gt;Select Clustering_Factor From USER_INDEXES Where index_name='XXXXX'&lt;br /&gt;&lt;br /&gt;#  USER_INDEXES.Clustering_Factor - This defines how Ordered The Rows are  In The Index. If Clustering_Factor approaches The NUMBER Of Blocks In  The Table, The Rows are Ordered. If it approaches The NUMBER Of Rows In  The Table, The Rows are randomly Ordered. In such A Case, it Is unlikely  that Index entries In The same leaf Block will Point To Rows In The  same Data Blocks.&lt;br /&gt;&lt;br /&gt;# Decrease The INIT.ORA parameter  DB_FILE_MULTIBLOCK_READ_COUNT - A higher value will make The Cost Of A  Full Table Scan cheaper.&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------- Descending index&lt;br /&gt;Select owner, index_name, uniqueness, status&lt;br /&gt;,INDEX_TYPE, Temporary, PARTITIONED, Logging, Degree, funcidx_status, join_index&lt;br /&gt;From sys.ALL_INDEXES&lt;br /&gt;Where table_owner = 'orauser'&lt;br /&gt;And table_name = 'XXXXX'&lt;br /&gt;Order By index_name&lt;br /&gt;&lt;br /&gt;Select * From sys.ALL_IND_COLUMNS Where index_owner = 'orauser' And index_name = 'XXXXXX' Order By column_position&lt;br /&gt;&lt;br /&gt;Select  column_expression From sys.ALL_IND_EXPRESSIONS Where index_owner =  'orauser'And index_name = 'XXXXX'And column_position =3&lt;br /&gt;&lt;br /&gt;Select&lt;br /&gt;INDEX_NAME "Index Name"&lt;br /&gt;,INDEX_TYPE "Index Type"&lt;br /&gt;,UNIQUENESS "Uniqueness"&lt;br /&gt;,STATUS "Status"&lt;br /&gt;,TABLE_OWNER || '.' || TABLE_NAME "Table"&lt;br /&gt;,TABLE_TYPE "Table Type"&lt;br /&gt;,TABLESPACE_NAME "Tablespace"&lt;br /&gt;,Buffer_Pool "Buffer Pool"&lt;br /&gt;,initcap(partitioned) "Partitioned"&lt;br /&gt;,decode(Temporary, 'N', 'No', 'Yes') "Temporary"&lt;br /&gt;,INI_TRANS "Initial Transactions"&lt;br /&gt;,MAX_TRANS "Max Transactions"&lt;br /&gt;,INITIAL_EXTENT "Initial Extent Size"&lt;br /&gt;,NEXT_EXTENT "Next Extent Size"&lt;br /&gt;,MIN_EXTENTS "Minimum Extents"&lt;br /&gt;,MAX_EXTENTS "Maximum Extents"&lt;br /&gt;,PCT_INCREASE "Percent Increase"&lt;br /&gt;,PCT_FREE "Percent Free"&lt;br /&gt;,Freelists "Freelists"&lt;br /&gt;,FREELIST_GROUPS "Freelist Groups"&lt;br /&gt;,Degree "Degree"&lt;br /&gt;,Instances "Instances"&lt;br /&gt;,LAST_ANALYZED "Last Analyzed"&lt;br /&gt;,BLEVEL "BLevel"&lt;br /&gt;,LEAF_BLOCKS "Leaf Blocks"&lt;br /&gt;,DISTINCT_KEYS "Distinct Keys"&lt;br /&gt;,AVG_LEAF_BLOCKS_PER_KEY "Avg Leaf Blocks Per Key"&lt;br /&gt;,AVG_DATA_BLOCKS_PER_KEY "Avg Data Blocks Per Key"&lt;br /&gt;,Clustering_Factor "Clustering Factor"&lt;br /&gt;,NUM_ROWS "Num Rows"&lt;br /&gt;,SAMPLE_SIZE "Sample Size"&lt;br /&gt;,Generated "Generated"&lt;br /&gt;,decode(JOIN_INDEX, 'NO', 'No', 'Yes') "Join Index"&lt;br /&gt;From SYS.USER_INDEXES&lt;br /&gt;Where INDEX_NAME Like 'XXXXX'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------Session Info&lt;br /&gt;--::::::::::Sql  statements still In The Cache that have done A great deal Of Disk I/O  And Buffer gets. (Buffer gets show approximately The amount Of CPU  Resource used.)&lt;br /&gt;Select * From V$SQLAREA --WHERE module LIKE 'T.O.A.D%'&lt;br /&gt;&lt;br /&gt;--::::::::: Shows active (in progress) transactions&lt;br /&gt;Select Sid, serial#,s.status,username, terminal, osuser,&lt;br /&gt;T.start_time, r.Name, (T.used_ublk*8192)/1024 USED_kb, T.used_ublk "ROLLB BLKS",&lt;br /&gt;DECODE(T.Space, 'YES', 'SPACE TX',&lt;br /&gt;DECODE(T.recursive, 'YES', 'RECURSIVE TX',&lt;br /&gt;DECODE(T.noundo, 'YES', 'NO UNDO TX', T.status)&lt;br /&gt;)) status&lt;br /&gt;From sys.v_$transaction T, sys.v_$rollname r, sys.v_$session s&lt;br /&gt;Where T.xidusn = r.usn&lt;br /&gt;And T.ses_addr = s.saddr&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select&lt;br /&gt;substr(s.username,1,18) username,&lt;br /&gt;substr(s.Program,1,15) Program,&lt;br /&gt;decode(s.command,&lt;br /&gt;0,'No Command',&lt;br /&gt;1,'Create Table',&lt;br /&gt;2,'Insert',&lt;br /&gt;3,'Select',&lt;br /&gt;6,'Update',&lt;br /&gt;7,'Delete',&lt;br /&gt;9,'Create Index',&lt;br /&gt;15,'Alter Table',&lt;br /&gt;21,'Create View',&lt;br /&gt;23,'Validate Index',&lt;br /&gt;35,'Alter Database',&lt;br /&gt;39,'Create Tablespace',&lt;br /&gt;41,'Drop Tablespace',&lt;br /&gt;40,'Alter Tablespace',&lt;br /&gt;53,'Drop User',&lt;br /&gt;62,'Analyze Table',&lt;br /&gt;63,'Analyze Index',&lt;br /&gt;s.command||': Other') command&lt;br /&gt;From&lt;br /&gt;v$session s,&lt;br /&gt;v$process P,&lt;br /&gt;v$transaction T,&lt;br /&gt;v$rollstat r,&lt;br /&gt;v$rollname n&lt;br /&gt;Where s.paddr = P.addr&lt;br /&gt;And s.taddr = T.addr (+)&lt;br /&gt;And T.xidusn = r.usn (+)&lt;br /&gt;And r.usn = n.usn (+)&lt;br /&gt;Order By 1&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------------------------------- reset PW&lt;br /&gt;Select username, Password&lt;br /&gt;From DBA_USERS Where username='XXXX'&lt;br /&gt;&lt;br /&gt;Alter USER XXXX Identified By XXXXX&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------------------------------  how many users in DB, CPU usage&lt;br /&gt;Select  rpad(c.Name||':',11)||chr(9)||chr(9)|| rpad(' Current  logons='||(to_number(b.sessions_current)-1),20)||chr(10)|| 'cumulative  logons='||rpad(substr(A.value,1,12),12)||chr(9)|| 'highwater  mark='||b.sessions_highwater||chr(9)&lt;br /&gt;From v$sysstat A, v$license b, v$database c&lt;br /&gt;Where A.Name = 'logons cumulative'&lt;br /&gt;&lt;br /&gt;Select  substr(sn.Name,1,30) parameter, ss.username ||' ('|| se.Sid ||') '  user_process, se.value,  ss.osuser,ss.process,ss.Program,ss.logon_time,ss.client_info,ss.last_call_et&lt;br /&gt;From v$session ss, v$sesstat se, v$statname sn&lt;br /&gt;Where se. statistic# = sn.statistic#&lt;br /&gt;And sn.Name Like '%CPU used by this session%'&lt;br /&gt;And se.Sid=ss.Sid&lt;br /&gt;Order By sn.Name, se.value DESC&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------- Installed Packages&lt;br /&gt;Select *--owner, object_type&lt;br /&gt;From dba_objects Where object_name = 'UTL_FILE'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select * From dba_objects Where OBJECT_TYPE='PACKAGE' Order By 2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select *--owner, object_type&lt;br /&gt;From dba_objects Where owner='PUBLIC' And OBJECT_TYPE='SYNONYM'&lt;br /&gt;And OBJECT_name In (Select OBJECT_name From dba_objects Where owner='SYS' And OBJECT_TYPE='PACKAGE')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------- Random 1/10 records select&lt;br /&gt;select a.*  from table1 a&lt;br /&gt;where dbms_utility.get_hash_value(dump(key_field),0,100)&amp;lt;10&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;---- create 10000 random strings&lt;br /&gt;select dbms_random.string('x', 10),&lt;br /&gt;   case when level &amp;lt;= 5000 then 1 else 0 end,&lt;br /&gt;   level&lt;br /&gt;from dual&lt;br /&gt;connect by level &amp;lt;= 10000&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------- Di&lt;span&gt;&lt;span style="font-family:Times New Roman;"&gt;splaying multiple column  values per row&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;http://www.dba-oracle.com/t_display_multiple_column_values_same_rows.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-1709551191743641828?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1709551191743641828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1709551191743641828'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/my-oracle-sqls.html' title='My Oracle SQLs'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-981700113399430740</id><published>2009-05-29T13:22:00.000-07:00</published><updated>2011-07-07T15:07:09.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'>my quick ksh</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;Numeric test&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;1.&lt;/span&gt;&lt;br /&gt;nonums="$(echo $answer | sed 's/[0-9]//g')" &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if [ ! -z "$nonums" ] ; then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   echo "Not an integer value." &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;2.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;echo -n "Pick a number between 1 and 20: " read answer &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;nonums="$(echo $answer | sed 's/[0-9]//g')" &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if [ ! -z "$nonums" ] ; then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;   echo "Not an integer value." exit 0 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fi &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;if [ $answer -lt 10 ] ; then &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;       echo "Your answer is less than ten" &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;else &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;       echo "Your answer is not less than ten" &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;3.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;case xxx in &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;+([0-9]))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      echo 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* ) &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      echo 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;      ;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;esac&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Parse file Name &amp;amp; Ext&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;file=xxxx.yyy&lt;br /&gt;&lt;br /&gt;nam=`echo ${file%.*}`&lt;br /&gt;ext=`echo ${file#*.}`&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;remove CR from EOF&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;tr '\012' ' '; echo&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;awk '{printf "%s ", $0} END { print "" }'&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Ksh Version&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;at a ksh prompt - print xxx &lt;esc&gt; &lt;ctl-v&gt;&lt;/ctl-v&gt;&lt;/esc&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;$ set|egrep -i ver&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;$ what /bin/ksh | egrep Version&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Email&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;simple text body:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;cat file1 | mailx -s "subject"  user@host.com&lt;/li&gt;&lt;li&gt;mailx -s "subject"  user@host.com &amp;lt;&amp;gt;&lt;/li&gt;&lt;/ul&gt;attachments:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;uuencode file1 file1 | mailx -s "subject"  user@host.com&lt;/li&gt;&lt;li&gt;(uuencode file1 file1; uuencode file2 file2) | mailx -s "subject"  user@host.com&lt;/li&gt;&lt;/ul&gt;both:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;(cat file1; uuencode file1 file1;uuencode file2 file2 ) | mailx -s "subject"  user@host.com&lt;/li&gt;&lt;/ul&gt;save attachment in mbox then uuencode to retrieve the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 51, 255);"&gt;sendmail:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/ksh&lt;br /&gt;set -xv&lt;br /&gt;# sendmail header function&lt;br /&gt;fn_sendmail()&lt;br /&gt;{&lt;br /&gt;# Build sendmail header.&lt;br /&gt;echo "From: user1@test.com"&lt;br /&gt;echo "To: user2@test2.com"&lt;br /&gt;echo "Reply-to: user3@test3.com, user4@user4"&lt;br /&gt;echo "Subject: ${SUBJECT}"&lt;br /&gt;echo "X-MSMail-Priority: High"&lt;br /&gt;echo "importance: 1"&lt;br /&gt;#echo "Mime-Version: 1.0"&lt;br /&gt;#echo "Content-Type: text/plain"&lt;br /&gt;#echo "Content-Type: multipart/mixed"&lt;br /&gt;echo "&lt;br /&gt;&lt;br /&gt;# Run the data function.&lt;br /&gt;Hi XXX,&lt;br /&gt;&lt;br /&gt;This is a test email&lt;br /&gt;&lt;br /&gt;YYY&lt;br /&gt;"&lt;br /&gt;# uuencode the attachments, add checks if required file extension,&lt;br /&gt;for k in file1 file2&lt;br /&gt;do&lt;br /&gt;uuencode $k $k&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;SUBJECT=test_subject&lt;br /&gt;&lt;br /&gt;# Call sendmail header and pipe to sendmail.&lt;br /&gt;(fn_sendmail)| sendmail -t -oi&lt;br /&gt;##&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-981700113399430740?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/981700113399430740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/981700113399430740'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/ksh-numeric-test.html' title='my quick ksh'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2216415831599746366</id><published>2009-05-29T13:06:00.000-07:00</published><updated>2011-12-15T09:08:57.163-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix/Shell'/><title type='text'>My quick unix</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;AIX v5.3&lt;br /&gt;find&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;modified &amp;gt; 3 days : &lt;span style="font-weight: bold;"&gt;find . -mtime +3&lt;/span&gt;&lt;br /&gt;modified &amp;lt;&amp;gt;2 &amp;amp; &amp;lt;  &amp;gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;find only in current dir, exclude sub-dir&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;:   &lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;find . \( ! -name . -prune \)  \( -name "xyz.dat*" -o -name "abc*" \) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;find in all sub-dirs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;: &lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;find .  -type d -print &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;find only in 1st &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;level sub-dirs:  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;find . \( ! -name . -prune \) -type d -print &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;find only in 1st &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;level sub-dirs, folder names matching: &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;find . \( ! -name . -prune \) \( -type d -a \( -name "5AA00" -o -name "5X[0789]00" \) \)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;more - http://www.unix.com/answers-frequently-asked-questions/13863-advanced-complex-uses-find-command.html&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Grab file records by line #&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span&gt;&lt;u&gt;&lt;br /&gt;awk '{if (NR&amp;gt;=11895 &amp;amp;&amp;amp; NR&amp;lt;=11905) print $0}' xxx &amp;gt; yyy&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span&gt;&lt;u&gt;awk 'NR==11895,  NR==11905'  xxx &amp;gt; yyy&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span&gt;&lt;u&gt;awk '{if (NR==11895 || NR==11905) print $0}' xxx &amp;gt; yyy&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;br /&gt;&lt;hr /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;groups&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; - find user groups&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;find groups a user belongs to: groups user1 user2...&lt;br /&gt;find users in a group: lsgroup -f  group&lt;br /&gt;(file: /etc/group&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;hr /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;IFS&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; - change field delimiter&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="font-style: italic;"&gt;see current value:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;$echo "$IFS" | od -b&lt;br /&gt;0000000  040 011 012 012&lt;br /&gt;0000004&lt;br /&gt;&lt;br /&gt;$echo "$IFS" | od -c&lt;br /&gt;0000000       \t  \n  \n&lt;br /&gt;0000004&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;changing IFS to ","&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;IFS_SAV=$IFS&lt;br /&gt;IFS=,&lt;br /&gt;line=&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;'a,,b,c,d'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;for x in $line&lt;br /&gt;do&lt;br /&gt;echo $x&lt;br /&gt;done&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;hr /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;ls&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt; get file date time stamp&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;br /&gt;ls -l = modification time&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;ls -lu = access time&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;ls -l = creation time&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;&lt;hr /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;port&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12pt;"&gt;&lt;br /&gt;AIX - This file shows the usage of ports -  &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;span style="font-size:12pt;"&gt;/etc/services&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:navy;"   &gt;&lt;span style="font-weight: bold;font-family:'Courier New';font-size:10pt;color:navy;"   &gt;&lt;o:p&gt;&lt;/o:p&gt;/opt/freeware/sbin &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:Courier New;font-size:85%;color:navy;"   &gt;&lt;span style="font-weight: bold;font-family:'Courier New';font-size:10pt;color:navy;"   &gt;lsof  -i :port#&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;proctree&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;proctree (-a) PID&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;procfiles&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;procfiles (-n) PID&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;ps&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt; -&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;for user xxx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; ps -fuxxx&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; ps -fl -uxxx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;all jobs by xxx sort by cpu&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; ps -fuxxx | sort +3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;all jobs related to PID ??????&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; ps -fL ??????&lt;br /&gt;&lt;br /&gt;display environment of another process:&lt;br /&gt;&lt;br /&gt;ps eww PID | tr ' ' '\n' | grep ORACLE_SID&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;check process priority:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre class="displaycode"&gt;&lt;span style="font-weight: bold;"&gt;ps -eo pid,state,nice,args | less -S&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;ps -lef&lt;br /&gt;&lt;br /&gt;change priority:&lt;br /&gt;nice/renice&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;read&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;(break fields on a record/line into variables)&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;move 1st field of each line to end of line (xx=1st field, yy=rest of fields)&lt;br /&gt;while read -r xx yy&lt;br /&gt;do&lt;br /&gt;print printf "%s %s/n" $yy $xx&lt;br /&gt;done &amp;lt;&amp;gt;&amp;gt; To read a line and split it into fields, and use "enter ur name:" as a prompt&lt;br /&gt;read word1?"enter ur name:  " word2 word3 word4....&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt; read more than 1 values into a variable (reak up the list by using for)&lt;br /&gt;$ read x y z; echo $x; echo $y; echo $z&lt;br /&gt;one two three four&lt;br /&gt;$one&lt;br /&gt;$two&lt;br /&gt;$three four&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt; show the oldest file&lt;br /&gt;: ls -tr| read xxx; echo $xxx&lt;br /&gt;: ls -tr |&amp;amp;&lt;br /&gt;read -p $xxx&lt;br /&gt;echo $xxx&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt; read from a file into variables&lt;br /&gt;exec 3&amp;lt;&amp;gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;sed&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;print a line with a pattern &amp;amp; the next line&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;search string = APPSTVCH.BI120-3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;sed -n '&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        /APPSTVCH.BI120-3/ {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        N&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        /\n.*1/ p&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;        }' APPSTVCH_703295.log&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;sort&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; sort by column 4-14 of 1st field:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;sort -k 1.4,1.14&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; sort by numeric, 3rd field, delimited by ':'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;sort -n -t ':' +2 /etc/passwd  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; second field as the sort key&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;sort -k 2,2 infile # new style&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;sort +1 -2 infile  # old style&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; reverse sort, contents of infile1 and infile2, placing the output in outfile and using the second character of the second field as the sort key (assuming that the first character of the second field is the field separator):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -r -o outfile -k 2.2,2.2 infile1 infile2 # new style key definition used&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -r -o outfile +1.1 -1.2 infile1 infile2  # old style key definition used&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; sorts the contents of infile1 and infile2 using the second non-blank character of the second field as the sort key:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -k 2.2b,2.2b infile1 infile2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort +1.1b -1.2b infile1 infile2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; prints the passwd(4) file (user database) sorted by the numeric user ID (the third colon-separated field):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -t ':' -k 3,3n /etc/passwd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -t ':' +2 -3n /etc/passwd&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -n -t ':' -k 3,3 /etc/passwd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt; imitate uniq using sort: either of the following commands prints the lines of the already sorted file infile, suppressing all but one occurrence of lines having the same third field:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -um -k 3.1,3.0 infile&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -um +2.0 -3.0 infile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    The -n option informs sort to compare the specified field as numbers, not ASCII characters. The r option reverses the order of the sort.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;    sort -t: +5 -6 +0 -1 /etc/passwd # The output is now sorted by field 6, then by field 1 if necessary.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;using &lt;span style="color: rgb(204, 0, 0);"&gt;TAB&lt;/span&gt; as delimiter, sort on 5th field:  sort -t "`/bin/echo '\t'" +6 xx&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:130%;"  &gt;&lt;hr /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;touch&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; -&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;- change DTTM stamp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;03:04:55 a.m. on Jan 2, 1985&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt;touch -t 198501020304.55 program.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;use the time stamp of another file &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt;touch -r file1 program.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;avoid creating a new file, enter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&amp;gt;&amp;gt;touch -c program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2216415831599746366?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2216415831599746366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2216415831599746366'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/my-quick-unix.html' title='My quick unix'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-2447584374879094405</id><published>2009-05-12T09:34:00.000-07:00</published><updated>2009-06-12T09:37:59.570-07:00</updated><title type='text'>Using Oracle Function Based Index for dynamic Search Key Column</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-2447584374879094405?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2447584374879094405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/2447584374879094405'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/06/using-oracle-function-based-index-to.html' title='Using Oracle Function Based Index for dynamic Search Key Column'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-6437103841573088103</id><published>2009-02-02T13:07:00.000-08:00</published><updated>2010-02-02T13:24:53.436-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gadgets'/><title type='text'>What the Report Says =&gt; What It Means</title><content type='html'>http://rudy.ca/what-the-report-means.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-6437103841573088103?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6437103841573088103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6437103841573088103'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2010/02/what-report-says-what-it-means.html' title='What the Report Says =&gt; What It Means'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-5728713170887184415</id><published>2002-05-02T08:27:00.000-07:00</published><updated>2009-06-12T09:44:43.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplecode ODBC Function</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Open Database Connectivity (ODBC) allows an application to access data stored in variety of DBMSs. Commonly within an organization departmental data may be kept in their own specific repository. For example, you may need to look up a county code that's in DB2, a Commodity Code in SQL Server, or even your HR data in the same DBMS as your Peoplesoft on another server. Will you try to bring them into PS through a bunch of download and upload processes? What about keeping them in sync? This article will demonstrate a simple alternative by using ODBC interface APIs to achieve the goal.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;To use ODBC in peoplecode, ODBC needs to be installed and configured properly for the target DBMS. Go to Control Panel and double click the ODBC Administrator. You should see something like this:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_ODBC_1.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt; The Drivers tab lists all the drivers available for various DBMS. You also need to set up at least one DSN for the target DBMS. Here's a quick rundown on how the interface works:&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;1. Application (peoplecode) calls ODBC manager(odbc32.dll) with a series of requests&lt;br /&gt;2. ODBC manager relays the requests to appropriate drivers as defined in DSN&lt;br /&gt;3. platform specific ODBC driver performs DB query/update and send results back&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Here's an example using the above information to read a Ship Order name from a push button on a panel:&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_ODBC_2.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;When user clicks the Access button, the following data is read from Access into PS and displayed by  Winmessage().&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Let's now create a simple peoplecode function that will do the above, reading Access DB and retrieving a string, number and date field. The code uses v3 of 32-bit of ODBC driver. Create a User DSN as follows for the sample Northwind database included in Access:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_ODBC_3.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;(You can also set up System DSN which is available to all uses on client pc, add default UID and password. If you leave them blank, a prompt will be displayed)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Copy the following code into a push button FieldChange event:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;a href="http://web.archive.org/web/20050226050454/http://www.slerp.com/articles/source/29_a.txt"&gt;Download Code Sample 1.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;This section of code opens an ODBC connection with DSN we just set up in Read-Only mode. It then selects 3 fields from orders table and displays their values in a message box. The code demonstrates steps in establishing various connection handles, executing SQL statements, retrieving result columns, and disconnection steps. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;This code example barely skims the surface of ODBC programming. It's wide range of function calls enables you to code what's best suited for your needs. For example, if a SQL is executed only once, you may use SQLExecuteDirect(). But you may use SQLPrepare() and SQLExecute() if the SQL will be run multiple times. The same applies to retrieval of data. It's a subject worth deeper exploration. Here's some points to consider:&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt;The best place to use this code is in a lookup function. A push button brings in the data from a non-PS DBMS based on a PS field value. PS discourages the use of external function calls from inside a scroll and in all Save events, for obvious integrity and performance reasons, although I have gone as far as inserting rows of MS Access data into PS in a loop (by opening a 2nd connection into PS, thus bypassing all peoplecode Save restrictions). It may work for you if you examine your data thoroughly and explore appropriate ODBC functions. &lt;/li&gt;&lt;li&gt;Make sure your DSN is set up correctly before using it in peoplecode. I included a simple utility to help test your DSN.&lt;p&gt;If the DSN cannot connect, it will not work in peoplecode function.&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_ODBC_4.jpg" /&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;Execute you SQL statements in native DBMS before using them in peoplecode. Each DBMS may use a specific syntax. For example, I have to use ‘#' to denote a date field in Access: &lt;blockquote&gt;select orders.orderid from orders where orders.orderdate = #04/24/2002#&lt;/blockquote&gt;&lt;p&gt;If the SQL does not work in it's native DBMS, it will not work in peoplecode function.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;I find it easier to read all data in as Char, and then convert them into other data types rather than reading them in as the original data type. &lt;/li&gt;&lt;li&gt;The state of a table can effect the result of a query. For example, when the table is in the process of being altered or modified, or an Access table is opened by someone in Design mode, you may not get the correct results back. &lt;/li&gt;&lt;li&gt;After each function call, we are supposed to check the return code (&amp;amp;RC). If non-zero, it could indicate an error (SQL_ERROR), or success with warning (SQL_SUCCESS_WITH_INFO). Generally I found this to be true, but at times it's not consistent. Not sure why, it might have something to do with the call translation. As you can see, the check is omitted in the sample ( just rely on the result column values to be present.) You can certainly add them to the function.&lt;/li&gt;&lt;li&gt;A good practice is to set up User DSN with correct login information. Otherwise, a prompt will be displayed for user to login. This would require users to have knowledge about UID and password. Each ODBC driver has it's own parameters. The following is an ODBC setup for a secured Access database:&lt;p&gt;An alternative is to embed this info in your peoplecode SQLConnect string. But this also exposes the login information. The balance between maintenance and security are to be determined at your organization.&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_ODBC_5.jpg" /&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;A good source of information is Microsoft's own ODBC page:&lt;p&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/dasdkodbcoverview.asp&lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;(&lt;span style="font-style: italic;"&gt;this article was originally published on 05/02/02 at www.slerp.com. PSTools version 5,6,7)&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-5728713170887184415?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5728713170887184415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/5728713170887184415'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-odbc-function.html' title='Peoplecode ODBC Function'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-8622733883315532340</id><published>2002-03-14T08:34:00.000-08:00</published><updated>2009-06-12T09:45:23.929-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplecode OLE Automation</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;OLE (Object Linking and Embedding) enables you to exchange data into/from any application that has registered previously in your system. Frequently used to populate data into Word, Access, or Outlook. Here I’ll skip the background information about OLE, and go right into demonstrating how to export data in a Grid into an Excel spreadsheet. There are 4 peoplecode OLE functions we’ll use to implement this: &lt;b&gt;CreateObject, ObjectDoMethod, ObjectGetProperty, ObjectSetProperty&lt;/b&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Consider the Budget Inquiry panel in PS Financials:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_OLE_1.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;When user clicks the Excel button, the Grid data is transferred into the spreadsheet:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_OLE_2.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;Peoplecode behind the Excel button:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;     &lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Local object &amp;WORKAPP;&lt;br /&gt;Declare Function SendClip PeopleCode D_WIN32_FUNCLIB.D_CLIP_IO FieldFormula;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&amp;amp;WORKAPP = CreateObject("Excel.Application");&lt;br /&gt;ObjectSetProperty(&amp;amp;WORKAPP, "UserControl", "True");&lt;br /&gt;&amp;amp;WORKBOOKS = ObjectGetProperty(&amp;amp;WORKAPP, "Workbooks");&lt;br /&gt;&amp;amp;WORKBOOK = ObjectDoMethod(&amp;amp;WORKBOOKS, "Add");&lt;br /&gt;&amp;amp;WORKSHEETS = ObjectGetProperty(&amp;amp;WORKBOOK, "Worksheets");&lt;br /&gt;&amp;amp;WORKSHEET = ObjectGetProperty(&amp;amp;WORKSHEETS, "Item", 1);&lt;br /&gt;ObjectSetProperty(&amp;amp;WORKSHEET, "Name", "MyOLEtest");&lt;br /&gt;&amp;amp;RANGE = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "A1:E1");&lt;br /&gt;&amp;amp;FONT = ObjectGetProperty(&amp;amp;RANGE, "Font");&lt;br /&gt;ObjectSetProperty(&amp;amp;FONT, "Bold", "True");&lt;br /&gt;&amp;amp;HEADING = "Select" | Char(9) | "Budget Period" | Char(9) |&lt;br /&gt;"Begin Date" | Char(9) | "End Date" | Char(9) | "Description";&amp;amp;DTL_LINES = "";&lt;br /&gt;For &amp;amp;IDX = 1 To ActiveRowCount(RECORD.CTL_CRIT_SEG) Step 1;&lt;br /&gt;&amp;amp;SELECT = FetchValue(CTL_CRIT_SEG.SELECT_BDGT_PERIOD, &amp;amp;IDX);&lt;br /&gt;&amp;amp;BP = FetchValue(CTL_CRIT_SEG.BUDGET_PERIOD, &amp;amp;IDX);&lt;br /&gt;&amp;amp;BEG_DT = FetchValue(CTL_CRIT_SEG.BEGIN_DT, &amp;amp;IDX);&lt;br /&gt;&amp;amp;END_DT = FetchValue(CTL_CRIT_SEG.END_DT, &amp;amp;IDX);&lt;br /&gt;&amp;amp;DESCR = FetchValue(CTL_CRIT_SEG.DESCR, &amp;amp;IDX);&lt;br /&gt;&amp;amp;LINE = &amp;amp;SELECT | Char(9) | &amp;amp;BP | Char(9) | &amp;amp;BEG_DT | Char(9) |&lt;br /&gt;&amp;amp;END_DT | Char(9) | &amp;DESCR;&lt;br /&gt;&amp;amp;DTL_LINES = &amp;amp;DTL_LINES | &amp;amp;LINE | Char(10);&lt;br /&gt;End-For;&lt;br /&gt;&amp;amp;XX = SendClip(&amp;amp;HEADING);&lt;br /&gt;ObjectDoMethod(&amp;amp;RANGE, "Select");&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKSHEET, "Paste");&lt;br /&gt;&amp;amp;XX = SendClip(&amp;amp;DTL_LINES);&lt;br /&gt;&amp;amp;CELL = "E" | &amp;IDX;&lt;br /&gt;&amp;amp;RANGE2 = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "A2:" | &amp;amp;CELL);&lt;br /&gt;ObjectDoMethod(&amp;amp;RANGE2, "Select");&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKSHEET, "Paste");&lt;br /&gt;&amp;amp;IDX = &amp;amp;IDX + 1;&lt;br /&gt;&amp;amp;CELL = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "F" | &amp;amp;IDX);&lt;br /&gt;ObjectDoMethod(&amp;amp;CELL, "Select");&lt;br /&gt;ObjectSetProperty(&amp;amp;WORKAPP, "Visible", True);&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKBOOK, "SaveAs", "c:\temp\oletest.xls");&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&lt;span style="font-size:78%;"&gt;Code Dissection&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;Local object &amp;WORKAPP;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Must declare the Object before instantiating it properly&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;Declare Function djSendClip PeopleCode&lt;br /&gt;D_WIN32_FUNCLIB.D_CLIP_IO FieldFormula;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Use a clipboard function posted at this site earlier, this allows us to copy data into clipboard and paste to spreadsheet-same way we manually paste data. Not the only way to do it, but it simplifies the job. You can copy in the code here or in a FUNCLIB as above&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;WORKAPP = CreateObject("Excel.Application");&lt;br /&gt;::::::::::::::::&lt;br /&gt;&amp;amp;WORKSHEETS = ObjectGetProperty(&amp;amp;WORKBOOK, "Worksheets");&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Instantiate anExcelspreadsheet,hierarchy:Application-&gt;Workbooks-&gt;Workbook-&gt;Worksheet, allow user to control it after we are done&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;WORKSHEET = ObjectGetProperty(&amp;amp;WORKSHEETS, "Item", 1);&lt;br /&gt;ObjectSetProperty(&amp;amp;WORKSHEET, "Name", "MyOLEtest");&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Name sheet #1 MyOLETest&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;RANGE = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "A1:E1");&lt;br /&gt;:::::::::::::::::::::&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKSHEET, "Paste");&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Set title text of the 5 columns in Bold&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;DTL_LINES = "";&lt;br /&gt;For &amp;amp;IDX = 1 To ActiveRowCount(RECORD.CTL_CRIT_SEG) Step 1;&lt;br /&gt;:::::::::::::::::::::::&lt;br /&gt;End-For;&lt;br /&gt;&amp;amp;XX = SendClip(&amp;amp;DTL_LINES);&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**Prepares the grid data &amp;amp; copy to clipboard&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;CELL = "E" | &amp;IDX;&lt;br /&gt;&amp;amp;RANGE2 = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "A2:" | &amp;amp;CELL);&lt;br /&gt;ObjectDoMethod(&amp;amp;RANGE2, "Select");&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKSHEET, "Paste");&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**the data will occupy cells A2 (Row 1 is title) through column E and whatever number of rows as the value &amp;amp;IDX &lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;&amp;amp;IDX = &amp;amp;IDX + 1;&lt;br /&gt;&amp;amp;CELL = ObjectGetProperty(&amp;amp;WORKSHEET, "Range", "F" | &amp;amp;IDX);&lt;br /&gt;ObjectDoMethod(&amp;amp;CELL, "Select");&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;**move cursor to a new cell&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;b&gt;ObjectSetProperty(&amp;amp;WORKAPP, "Visible", True);&lt;br /&gt;ObjectDoMethod(&amp;amp;WORKBOOK, "SaveAs", "c:\temp\oletest.xls");&lt;br /&gt;**display the spreadsheet and save it&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;You can further define formula, subtotal, sort cells, or set up a template that includes these formulas, subtotals etc. When you populate the cells, this additional information will be readily present. This method is a simple and efficient alternative to nVision reports. With your knowledge about specific application, you can invoke different methods to achieve the same results as we did here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;(&lt;span style="font-style: italic;"&gt;this article was originally published on 03/14/02 at www.slerp.com. PSTools version 5,6,7)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-8622733883315532340?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8622733883315532340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8622733883315532340'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-ole-automation.html' title='Peoplecode OLE Automation'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-1648623398328808431</id><published>2002-02-14T08:38:00.000-08:00</published><updated>2009-06-12T09:45:42.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplecode FTP function</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Many processes are executed on the server for performance reasons. Their output and log files, such as process logs and *.spf files from SQR, are usually handled in the following ways:&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt;loaded into a table to be viewed in a on-line panel &lt;/li&gt;&lt;br /&gt;&lt;li&gt;saved to another location and picked up through 3-party reporting tools&lt;/li&gt;&lt;br /&gt;&lt;li&gt;moved to another server  by using a server script &lt;/li&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Here's a simple alternative to the above methods - FTP to client directly and use the rich set of tools on the client side to view or manipulate it. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The function accepts 5 parameters:&lt;br /&gt;&lt;li&gt; FTP site&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Directory&lt;/li&gt;&lt;br /&gt;&lt;li&gt; File Name&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Login ID&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Password&lt;/li&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The sample code retrieves a readme.txt from Microsoft's ftp site into the directory path pointed to by the environment variable TEMP. As is, it supports the Get operation in ASCII mode. Binary mode and other operations can be easily implemented. It’s doable to even build a simple FTP client into PS.&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt; Copy the function declaration:&lt;/li&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;Declare Function InternetOpenA Library "wininet.dll" (string Value As string, long Value As number,&lt;br /&gt;string Value As string, string Value As string, long Value As number) Returns long As number;&lt;br /&gt;Declare Function InternetConnectA Library "wininet.dll" (long Value As number, string Value As&lt;br /&gt;string, integer Value As number, string Value As string, string Value As string, long Value As&lt;br /&gt;number, long Value As number, long Value As number) Returns long As number;&lt;br /&gt;Declare Function FtpSetCurrentDirectoryA Library "wininet.dll" (long Value As number, string Value&lt;br /&gt;As string) Returns long As number;&lt;br /&gt;Declare Function FtpGetFileA Library "wininet.dll" (long Value As number, string Value As string,&lt;br /&gt;string Value As string, long Value As number, long Value As number, long Value As number, long Value&lt;br /&gt;As number) Returns boolean;&lt;br /&gt;Declare Function InternetCloseHandle Library "wininet.dll" (long Value As number) Returns integer&lt;br /&gt;As number;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;Function FTPGet(&amp;amp;HOST As string, &amp;amp;DIR As string, &amp;amp;FILE As string, &amp;amp;ACCT As string, &amp;amp;PW As string)&lt;br /&gt;Returns boolean;&lt;br /&gt;&amp;amp;OPEN_PRECONFIG = 0;&lt;br /&gt;&amp;amp;FTP_PORT = 21;&lt;br /&gt;&amp;amp;INET_FTP = 1;&lt;br /&gt;&amp;amp;INET_PASSIVE = 134217728;&lt;br /&gt;&amp;amp;FTP_ASCII = 1;&lt;br /&gt;&amp;amp;HOPEN = InternetOpenA("Peoplecode FTP", &amp;amp;OPEN_PRECONFIG, "", "", 0);&lt;br /&gt;If &amp;amp;HOPEN &gt; 0 Then&lt;br /&gt;  &amp;amp;HCONN = InternetConnectA(&amp;amp;HOPEN, &amp;amp;HOST, &amp;amp;FTP_PORT, &amp;amp;ACCT, &amp;amp;PW, &amp;amp;INET_FTP,&lt;br /&gt;  &amp;amp;INET_PASSIVE, 0);&lt;br /&gt;  If &amp;amp;HCONN &gt; 0 Then&lt;br /&gt;     If All(&amp;amp;DIR) Then&lt;br /&gt;        &amp;amp;HDIR = FtpSetCurrentDirectoryA(&amp;amp;HCONN, &amp;amp;DIR);&lt;br /&gt;     Else&lt;br /&gt;        &amp;amp;HDIR = 1;&lt;br /&gt;     End-If;&lt;br /&gt;     If &amp;amp;HDIR Then&lt;br /&gt;        &amp;amp;HFILE = FtpGetFileA(&amp;amp;HCONN, &amp;amp;FILE, GetEnv("TEMP") | "\" | &amp;amp;FILE, 0, 0, &amp;amp;FTP_ASCII, 0);&lt;br /&gt;        If &amp;amp;HFILE Then&lt;br /&gt;           &amp;amp;RC = InternetCloseHandle(&amp;amp;HCONN);&lt;br /&gt;           &amp;amp;RC = InternetCloseHandle(&amp;amp;HOPEN);&lt;br /&gt;           Return True;&lt;br /&gt;        End-If;&lt;br /&gt;     End-If;&lt;br /&gt;     &amp;amp;RC = InternetCloseHandle(&amp;amp;HCONN);&lt;br /&gt;  End-If;&lt;br /&gt;  &amp;amp;RC = InternetCloseHandle(&amp;amp;HOPEN);&lt;br /&gt;End-If;&lt;br /&gt;Return False;&lt;br /&gt;End-Function;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt; Copy the sample test to a FieldChange event run on the Client:&lt;/li&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;&amp;amp;XX = FTPGet("ftp.microsoft.com", "softlib", "readme.txt","anonymous","");&lt;br /&gt;If &amp;amp;XX Then&lt;br /&gt;WinExec("start " | GetEnv("TEMP") | "\"|"readme.txt", 1, False);&lt;br /&gt;Else&lt;br /&gt;WinMessage("fail");&lt;br /&gt;End-If;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;For NT client, replace "start" with "cmd /c start" so the line looks like:&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;WinExec("cmd /c start " | GetEnv("TEMP") | "\"|"readme.txt", 1, False);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Account ID &amp;amp; Password considerations - The demonstration uses a simple "anonymous" and null as password. Additional code can be added to prompt the user. They can also be defined based on operator ID/Classes. Permission for this account should then be set up accordingly for the FTP purpose only. The retrieval of ID &amp;amp; password can be encapsulated in the FTP function as well. The function then requires 3 parameters instead of 5.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;(&lt;span style="font-style: italic;"&gt;this article was originally published on 02/14/02 at www.slerp.com. PSTools version 5,6,7)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-1648623398328808431?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1648623398328808431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/1648623398328808431'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-ftp-function.html' title='Peoplecode FTP function'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-6359551357924517982</id><published>2002-02-07T08:39:00.000-08:00</published><updated>2009-06-12T09:46:02.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplecode 3-tier Detection</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The Status Bar is a control that is at the bottom of a panel that displays information about the application status. It is divided into individual panes. Each pane displays specific aspects of the process/function the user is in. 5 panes are present in v.7 and 6 panes in v.8. This article will demonstrate a platform independent method to detect 3-tier connection by accessing the information stored on status bar, provided the database sever and application server have different names. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Take a look at a sample status bar:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_Status_Bar_1_.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The 1st pane does not have a border, and is used for panel loading. We are interested in the 3rd pane. It displays the server name, GF75DMO. In PS8, there’s another pane for Time, but server name is still on 3rd pane. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;If server name is not displayed, turn it on in Configuration Manager Display tab: &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_Status_Bar_2_.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt;Copy the function declaration:&lt;/li&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;Declare Function GetActiveWindow Library "user32"&lt;br /&gt;() Returns long As number;&lt;br /&gt;Declare Function GetWindow Library "user32"&lt;br /&gt;(long Value As number, long Value As number) Returns long As number;&lt;br /&gt;Declare Function GetClassNameA Library "user32"&lt;br /&gt;(long Value As number, string Ref As string, integer Value As number) Returns long As number;&lt;br /&gt;Declare Function SendMsg2 Library "user32" Alias "SendMessageA"&lt;br /&gt;(long Value As number, integer Value As number, integer Value As number, string Ref As string)&lt;br /&gt;Returns long As number;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;Function GetSB(&amp;amp;PANETEXT As string) Returns boolean;&lt;br /&gt;&amp;amp;STATBAR = "msctls_statusbar32";&lt;br /&gt;&amp;amp;HWND = GetActiveWindow();&lt;br /&gt;&amp;amp;GW_CHILD = 5;&lt;br /&gt;&amp;amp;GW_HWNDNEXT = 2;&lt;br /&gt;&lt;br /&gt;&amp;amp;MAXLEN = 128;   &amp;amp;CLSNAME = Rept(" ", &amp;amp;MAXLEN);&lt;br /&gt;&amp;amp;CWND = GetWindow(&amp;amp;HWND, &amp;amp;GW_CHILD);&lt;br /&gt;While &amp;amp;CWND &gt; 0&lt;br /&gt;&amp;amp;CLSLEN = GetClassNameA(&amp;amp;CWND, &amp;amp;CLSNAME, &amp;amp;MAXLEN);&lt;br /&gt;If &amp;amp;CLSNAME = &amp;amp;STATBAR Then&lt;br /&gt;  Break;&lt;br /&gt;End-If;&lt;br /&gt;&amp;amp;CWND = GetWindow(&amp;amp;CWND, &amp;amp;GW_HWNDNEXT);&lt;br /&gt;End-While;&lt;br /&gt;If &amp;amp;CWND &gt; 0 Then&lt;br /&gt;&amp;amp;NPARTS = 0;&lt;br /&gt;&amp;amp;CORD = 0;&lt;br /&gt;&amp;amp;SB_GETTEXTA = 1026;&lt;br /&gt;&amp;amp;RC = SendMsg2(&amp;amp;CWND, &amp;amp;SB_GETTEXTA, 2, &amp;amp;PANETEXT);&lt;br /&gt;If &amp;amp;RC &gt; 0 Then&lt;br /&gt;  Return True;&lt;br /&gt;End-If;&lt;br /&gt;End-If;&lt;br /&gt;Return False;&lt;br /&gt;End-Function;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt;Test the function in a FieldChange event:&lt;/li&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-family:terminal;"&gt;&amp;amp;XX = GetSB(&amp;amp;PANETEXT);&lt;br /&gt;If &amp;amp;XX Then&lt;br /&gt;If &amp;amp;PANETEXT = "MyAppSvr" Then&lt;br /&gt;WinMessage("3-tier");&lt;br /&gt;Else&lt;br /&gt;WinMessage("2-tier");&lt;br /&gt;End-If;&lt;br /&gt;Else&lt;br /&gt;WinMessage("fail");&lt;br /&gt;End-If;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The server name is returned in &amp;amp;PANETEXT. Compare it to a list of known App Server names. If a match is found, then the user has logged into the App server.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;As with all external Windows function APIs, if your app server is not NT, set the execution location of this code to client:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_Status_Bar_3_.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;You can also read or write into this or other panes on the status bar. But there are some considerations when writing text to it. Please email the author if you’d like to see how to do it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;(&lt;span style="font-style: italic;"&gt;this article was originally published on 02/07/02 at www.slerp.com. PSTools version 5,6,7)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-6359551357924517982?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6359551357924517982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/6359551357924517982'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-3-tier-detection.html' title='Peoplecode 3-tier Detection'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-8386807633381862609</id><published>2002-01-11T08:44:00.000-08:00</published><updated>2009-06-12T09:46:25.955-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>Peoplecode Windows Registry Access</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Windows Registry&lt;/span&gt;&lt;/span&gt; stores various settings about the Windows system and other applications. To be able to access these information provides greater capability of your Peoplecode applications. For example, only a small number of Peoplesoft’s own settings (through Configuration Manager) are available as system variables. But they are all accessible in registry. The following are typical registry settings for 7.5 PSTools:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;img src="http://www.blog.onacu.com/images/blogpost/PC_Windows_Registry.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;This Peoplecode function ReadReg() will let you glance at all the ASCII registry data of installed software under HKEY_CURRENT_USER, which contains the sub-key Software that describes the current user's software settings and contains program-specific information previously stored in the Win.ini or private initialization files in Windows 3.x. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;To use the function, set &amp;amp;SUBKEY to the path in registry, as shown on the status bar above, and set &amp;amp;VALNAME to the Value Name in question. The Value Data will be returned in &amp;amp;KEY_VAL. For example, to read the value of PS_HOME, use subkey “Software\PeopleSoft\PeopleTools\Release7.5\Process Scheduler” and Value Name “PS_HOME”. Be sure to include spaces where needed. If the data string is longer than 128 bytes, you need to increase the value of &amp;amp;KEY_LEN. &lt;/span&gt;&lt;/p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;li&gt;Copy the function declaration: &lt;pre&gt;&lt;p&gt;Local number &amp;amp;H_REG_KEY;&lt;br /&gt;Declare Function RegOpenKeyExA Library "advapi32" (long Value As number,&lt;br /&gt;string Value As string, long Value As number, long Value As number,&lt;br /&gt;long Ref As number) Returns long As number;&lt;br /&gt;Declare Function RegQueryValueExA Library "advapi32" (long Value As&lt;br /&gt;number, string Value As string, long Value As number, long Ref As&lt;br /&gt;number, string Ref As string, long Ref As number)&lt;br /&gt;Returns long As number;&lt;br /&gt;Declare Function RegCloseKey Library "advapi32" (long Value As&lt;br /&gt;number) Returns long As number;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Function ReadReg(&amp;amp;SUBKEY As string, &amp;amp;VALNAME As string,&lt;br /&gt;&amp;amp;KEY_VAL As string) Returns boolean;&lt;br /&gt;&amp;amp;HKEY_CURRENT_USER = - 2147483647;&lt;br /&gt;&amp;amp;KEY_QUERY_VALUE = 1;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   &amp;amp;RC = RegOpenKeyExA(&amp;amp;HKEY_CURRENT_USER, &amp;amp;SUBKEY, 0,&lt;br /&gt;&amp;amp;KEY_QUERY_VALUE, &amp;amp;H_REG_KEY);&lt;br /&gt;If &amp;amp;RC &lt;&gt;  0 Then&lt;br /&gt;MessageBox(48, "ReadReg", 0, 0, "Cannot open Registry");&lt;br /&gt;Return False;&lt;br /&gt;End-If;&lt;br /&gt;/*key value type is null-terminated string */&lt;br /&gt;&amp;amp;REG_SZ = 1;&lt;br /&gt;/* initialize string to 128 bytes */&lt;br /&gt;&amp;amp;KEY_LEN = 129;&lt;br /&gt;&amp;amp;KEY_VAL = Rept(" ", &amp;amp;KEY_LEN);&lt;br /&gt;&amp;amp;RC = RegQueryValueExA(&amp;amp;H_REG_KEY, &amp;amp;VALNAME, 0, &amp;amp;REG_SZ,&lt;br /&gt;&amp;amp;KEY_VAL, &amp;amp;KEY_LEN);&lt;br /&gt;If &amp;amp;RC &lt;&gt;  0 Then&lt;br /&gt;MessageBox(48, "ReadReg", 0, 0, "Cannot query Registry");&lt;br /&gt;Return False;&lt;br /&gt;End-If;&lt;br /&gt;&amp;amp;RC = RegCloseKey(&amp;amp;H_REG_KEY);&lt;br /&gt;Return True;&lt;br /&gt;End-Function;&lt;br /&gt;&lt;/p&gt;&lt;li&gt;Copy the following function call test:&lt;p&gt;&amp;amp;SUBKEY = "Software\PeopleSoft\PeopleTools\release7.5\startup";&lt;br /&gt;&amp;amp;VALNAME = "dbtype";&lt;br /&gt;&amp;amp;KEY_VAL = "";&lt;br /&gt;&amp;amp;XX = ReadReg(&amp;amp;SUBKEY, &amp;amp;VALNAME, &amp;amp;KEY_VAL);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If &amp;amp;XX Then&lt;br /&gt;MessageBox(48, "ReadReg", 0, 0, &amp;amp;SUBKEY | "\" | &amp;amp;VALNAME | "=" | &amp;amp;KEY_VAL | ".");&lt;br /&gt;Else&lt;br /&gt;WinMessage("Fail");&lt;br /&gt;End-If;&lt;/p&gt;&lt;/li&gt;&lt;/pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&lt;pre&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;note: &lt;/span&gt;this article was originally published on 1/11/02 at www.slerp.com for PSTools version 6,7.  it uses ms windows system dll which is not accessible in PIA unless for a pure NT shop. still it provides an example on how to interface to OS library functions &amp;amp;  the peoplecode parameters passing.  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;pre&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-8386807633381862609?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8386807633381862609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/8386807633381862609'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-windows-registry-access.html' title='Peoplecode Windows Registry Access'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-8707999212699764452.post-4890035080517939869</id><published>2001-12-14T08:41:00.000-08:00</published><updated>2009-06-12T09:46:58.175-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Peoplesoft'/><title type='text'>PeopleCode Clipboard Function</title><content type='html'>&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;This function allows access to Clipboard where data can be pasted into a wide range of applications. My client uses it to output data into email to be sent off to other departments. For output that does not require extensive formatting, it's a quick &amp;amp; easy alternative to existing options, such as Crystal or nVision. For example, in a grid/scroll, where datacannot be seen on one screen, you can now select only columns (or other criteria) that are of interest and copy them to clipboard. This allows data to be selectively extracted/copied from a grid.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The following code declares the Clipboard function:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Declare Function OpenClipboard Library "USER32"&lt;br /&gt;(long Value As number) Returns boolean;&lt;br /&gt;Declare Function EmptyClipboard Library "USER32"&lt;br /&gt;() Returns boolean;&lt;br /&gt;Declare Function SetClipboardData Library "USER32"&lt;br /&gt;(long Value As number, long Value As number) Returns long As number;&lt;br /&gt;Declare Function CloseClipboard Library "USER32"&lt;br /&gt;() Returns boolean;&lt;br /&gt;Declare Function GlobalAlloc Library "kernel32"&lt;br /&gt;(integer Value As number, long Value As number) Returns long As number;&lt;br /&gt;Declare Function GlobalFree Library "kernel32"&lt;br /&gt;(long Value As number) Returns long As number;&lt;br /&gt;Declare Function lstrcpy Library "kernel32"&lt;br /&gt;(long Value As number, string Ref As string) Returns long As number;&lt;br /&gt;Declare Function GlobalLock Library "kernel32"&lt;br /&gt;(long Value As number) Returns long As number;&lt;br /&gt;Declare Function GlobalUnlock Library "kernel32"&lt;br /&gt;(long Value As number) Returns long As number;&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;Function djSendClip(&amp;amp;STR) Returns boolean;&lt;br /&gt;&amp;amp;CLIPOK = False;&lt;br /&gt;/* Clipboard format is text only */&lt;br /&gt;&amp;amp;CF_TEXT = 1;&lt;br /&gt;/* memory type is global fixed*/&lt;br /&gt;&amp;amp;GMEM_FIXED = 0;&lt;br /&gt;/* get 1 byte more than the text length */&lt;br /&gt;&amp;amp;LEN = Len(&amp;amp;STR) + 1;&lt;br /&gt;/* get a memory block from global heap , return global Handle*/&lt;br /&gt;&amp;amp;H_GMEM = GlobalAlloc(&amp;amp;GMEM_FIXED, &amp;amp;LEN);&lt;br /&gt;If &amp;amp;H_GMEM &lt;&gt; 0 Then&lt;br /&gt;/*  lock memory address, retrun pointer to memory (same as H_GEMM for GMEM_FIXED) */&lt;br /&gt;&amp;amp;LP_GMEM = GlobalLock(&amp;amp;H_GMEM);&lt;br /&gt;If &amp;amp;LP_GMEM &lt;&gt; 0 Then&lt;br /&gt;   /* copy string to global memory area, retrun long pointer to global string */&lt;br /&gt;   &amp;amp;LPSTR = lstrcpy(&amp;amp;LP_GMEM, &amp;amp;STR);&lt;br /&gt;   If &amp;amp;LPSTR &lt;&gt; 0 Then&lt;br /&gt;      &amp;amp;B_RC = OpenClipboard(0);&lt;br /&gt;      If &amp;amp;B_RC = True Then&lt;br /&gt;         &amp;amp;B_RC = EmptyClipboard();&lt;br /&gt;         If &amp;amp;B_RC = True Then&lt;br /&gt;            &amp;amp;H_RC = SetClipboardData(&amp;amp;CF_TEXT, &amp;amp;LP_GMEM);&lt;br /&gt;            If &amp;amp;H_RC &lt;&gt; 0 Then&lt;br /&gt;               &amp;amp;CLIPOK = True;&lt;br /&gt;            End-If;&lt;br /&gt;         End-If;&lt;br /&gt;         &amp;amp;B_RC = CloseClipboard();&lt;br /&gt;      End-If;&lt;br /&gt;   End-If;&lt;br /&gt;   &amp;amp;RC = GlobalUnlock(&amp;amp;LP_GMEM);&lt;br /&gt;End-If;&lt;br /&gt;&amp;amp;RC = GlobalFree(&amp;amp;H_GMEM);&lt;br /&gt;End-If;&lt;br /&gt;If &amp;amp;CLIPOK = False Then&lt;br /&gt;MessageBox(48, "SendClip", 0, 0, "Failed to copy to clipboard");&lt;br /&gt;End-If;&lt;br /&gt;Return &amp;CLIPOK;&lt;br /&gt;End-Function;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;The following example uses the function above to copy a string to clipboard:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;&amp;amp;XX = djSendClip("copy data to clipboard");&lt;/span&gt;&lt;p&gt;&lt;span style=";font-family:helv;font-size:85%;"  &gt;If &amp;amp;XX Then&lt;br /&gt;WinMessage("Success");&lt;br /&gt;Else&lt;br /&gt;WinMessage("Fail");&lt;br /&gt;End-If;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;(&lt;span style="font-style: italic;"&gt;this article was originally published on 12/14/01 at www.slerp.com. PSTools version 6,7)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8707999212699764452-4890035080517939869?l=bluespur.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/4890035080517939869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8707999212699764452/posts/default/4890035080517939869'/><link rel='alternate' type='text/html' href='http://bluespur.blogspot.com/2009/05/peoplecode-clipboard-function.html' title='PeopleCode Clipboard Function'/><author><name>David</name><uri>http://www.blogger.com/profile/12243778471280748522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
