<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tyson Moore &#187; sql</title>
	<atom:link href="http://www.tysonmoore.net/public/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tysonmoore.net/public</link>
	<description>Consultant, Developer, Volunteer</description>
	<lastBuildDate>Tue, 15 Jun 2010 21:40:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Auditing Journal Post in PS9.0</title>
		<link>http://www.tysonmoore.net/public/2010/02/auditing-journal-post-in-ps9-0/</link>
		<comments>http://www.tysonmoore.net/public/2010/02/auditing-journal-post-in-ps9-0/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:23:13 +0000</pubDate>
		<dc:creator>Tyson</dc:creator>
				<category><![CDATA[General Ledger]]></category>
		<category><![CDATA[PeopleSoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[journal post]]></category>
		<category><![CDATA[peoplesoft 9.0]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.tysonmoore.net/public/?p=29</guid>
		<description><![CDATA[In every GL implementation I&#8217;ve been involved with, auditors or managers always ask for the ability to audit who posted their own journal entries. Unfortunately PeopleSoft doesn&#8217;t provide the means to do this very easily, so I&#8217;ve written a couple of queries that you can use to build a report or a view that satisfies [...]]]></description>
			<content:encoded><![CDATA[<p>In every GL implementation I&#8217;ve been involved with, auditors or managers always ask for the ability to audit who posted their own journal entries.  Unfortunately PeopleSoft doesn&#8217;t provide the means to do this very easily, so I&#8217;ve written a couple of queries that you can use to build a report or a view that satisfies this requirement.</p>
<p>The first query is only valid if you&#8217;ve disallowed users from On-Demand Posting journals (the &#8220;Journal Post&#8221; option in the drop-down box on the JE Lines screen).  If you disable this process, users have to utilize the batch journal post process.  Here is the SQL:</p>
<p>
<pre name="code" class="sql">
SELECT A.OPRID, B.BUSINESS_UNIT, B.JOURNAL_ID, B.JOURNAL_DATE, B.DESCR
	FROM PS_JRNL_POST_REQ A, PS_JRNL_HEADER B
	WHERE A.OPRID = B.OPRID
		AND B.BUSINESS_UNIT = A.BUSINESS_UNIT;
</pre>
</p>
<p>The second query is valid if you haven&#8217;t restricted On-Demand Posting of journal entries.  It&#8217;s a bit tricky, so stay with me:</p>
<p>
<pre name="code" class="sql">
SELECT A.BUSINESS_UNIT, A.JOURNAL_ID, A.JOURNAL_DATE, A.DESCR, A.OPRID,
	A.POSTED_DATE, A.PROCESS_INSTANCE, B.JOBID, B.PROGRAM_NAME,
	C.MESSAGE_PARM
  FROM PS_JRNL_HEADER A, PS_MESSAGE_LOG B, PS_MESSAGE_LOGPARM C
  WHERE B.PROCESS_INSTANCE = A.PROCESS_INSTANCE
    AND B.PROCESS_INSTANCE = C.PROCESS_INSTANCE
    AND B.MESSAGE_SEQ = C.MESSAGE_SEQ
    AND C.MESSAGE_SEQ = 2
    AND C.PARM_SEQ = 2
    AND A.OPRID = C.MESSAGE_PARM
    AND B.PROGRAM_NAME LIKE 'GLPP%'
  ORDER BY A.BUSINESS_UNIT, A.JOURNAL_ID, A.JOURNAL_DATE;
</pre>
</p>
<p>I&#8217;ve heard that PeopleSoft 9.1 provides this ability as delivered, but haven&#8217;t seen it yet.  I&#8217;ll update this post once I verify the feature is available.  Happy querying!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;partner=sociable" title="PDF"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;partner=sociable" title="Print"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Auditing%20Journal%20Post%20in%20PS9.0&amp;body=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F" title="email"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Auditing%20Journal%20Post%20in%20PS9.0%20-%20http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F" title="Twitter"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;t=Auditing%20Journal%20Post%20in%20PS9.0" title="Facebook"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;title=Auditing%20Journal%20Post%20in%20PS9.0&amp;source=Tyson+Moore+Consultant%2C+Developer%2C+Volunteer&amp;summary=In%20every%20GL%20implementation%20I%27ve%20been%20involved%20with%2C%20auditors%20or%20managers%20always%20ask%20for%20the%20ability%20to%20audit%20who%20posted%20their%20own%20journal%20entries.%20%20Unfortunately%20PeopleSoft%20doesn%27t%20provide%20the%20means%20to%20do%20this%20very%20easily%2C%20so%20I%27ve%20written%20a%20couple%20of" title="LinkedIn"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tysonmoore.net/public/feed/" title="RSS"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;t=Auditing%20Journal%20Post%20in%20PS9.0&amp;s=In%20every%20GL%20implementation%20I%27ve%20been%20involved%20with%2C%20auditors%20or%20managers%20always%20ask%20for%20the%20ability%20to%20audit%20who%20posted%20their%20own%20journal%20entries.%20%20Unfortunately%20PeopleSoft%20doesn%27t%20provide%20the%20means%20to%20do%20this%20very%20easily%2C%20so%20I%27ve%20written%20a%20couple%20of" title="Tumblr"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F&amp;title=Auditing%20Journal%20Post%20in%20PS9.0&amp;annotation=In%20every%20GL%20implementation%20I%27ve%20been%20involved%20with%2C%20auditors%20or%20managers%20always%20ask%20for%20the%20ability%20to%20audit%20who%20posted%20their%20own%20journal%20entries.%20%20Unfortunately%20PeopleSoft%20doesn%27t%20provide%20the%20means%20to%20do%20this%20very%20easily%2C%20so%20I%27ve%20written%20a%20couple%20of" title="Google Bookmarks"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=Auditing%20Journal%20Post%20in%20PS9.0&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F02%2Fauditing-journal-post-in-ps9-0%2F" title="Netvibes"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tysonmoore.net/public/2010/02/auditing-journal-post-in-ps9-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PeopleSoft Trees via SQL</title>
		<link>http://www.tysonmoore.net/public/2010/01/peoplesoft-trees-via-sql/</link>
		<comments>http://www.tysonmoore.net/public/2010/01/peoplesoft-trees-via-sql/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 21:08:10 +0000</pubDate>
		<dc:creator>Tyson</dc:creator>
				<category><![CDATA[PeopleSoft]]></category>
		<category><![CDATA[PSoftPros]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Trees]]></category>
		<category><![CDATA[peoplesoft tree]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.tysonmoore.net/public/?p=27</guid>
		<description><![CDATA[I need to export (using SQL) a PeopleSoft tree &#8211; showing all Tree Nodes and Leafs from the Top of the tree all the way down. levels are not used on the tree I am trying to retrieve. Can someone please help &#8211; it would be much appreciated! Here is the SQL I use to [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>I need to export (using SQL) a PeopleSoft tree &#8211; showing all Tree Nodes and Leafs from the Top of the tree all the way down. levels are not used on the tree I am trying to retrieve. Can someone please help &#8211; it would be much appreciated!</p></blockquote>
<p>Here is the SQL I use to get the Parent Node, Node, Detail Value (Leaf), and Level from trees in PeopleSoft via SQL:</p>
<p><em>Note: Click <u>View Plain</u> in the codeblock below to see all the SQL correctly.  I&#8217;m working on my current WP theme to get it to quit interfering with my syntax highlighter.</em></p>
<pre name="code" class="sql">
SELECT PSTREENODE.SETID,
  PSTREENODE.TREE_NAME,
  PSTREENODE.EFFDT,
  PARENT_NODE_NAME AS PARENTNODE,
  TREE_NODE        AS NODENAME,
  TREE_NODE        AS TREENODE,
  TREE_LEVEL_NUM,
  TREE_NODE_NUM
FROM PSTREENODE
  --- REPLACE WITH YOUR SETID
WHERE PSTREENODE.SETID = 'SHARE'
  --- REPLACE WITH YOUR TREE NAME
AND TREE_NAME = 'ACCOUNT'
  --- REPLACE WITH YOUR TREE EFFECTIVE DATE
AND EFFDT = TO_DATE('01011900','MMDDYYYY')
UNION ALL
--- REPLACE WITH YOUR SETID
SELECT 'SHARE',
  N.TREE_NAME,
  --- REPLACE WITH YOUR TREE EFFECTIVE DATE
  TO_DATE('01011900','MMDDYYYY'),
  N.TREE_NODE AS PARENTNODE,
  A.DESCR     AS NODENAME,
  --- REPLACE A.ACCOUNT WITH A.your_chartfield
  A.ACCOUNT AS TREENODE,
  TREE_LEVEL_NUM,
  N.TREE_NODE_NUM
FROM PSTREENODE N
INNER JOIN PSTREELEAF L
ON N.SETID      = L.SETID
AND N.TREE_NAME = L.TREE_NAME
  --- REPLACE WITH YOUR SETID
AND N.SETID = 'SHARE'
  --- REPLACE WITH YOUR TREE NAME
AND N.TREE_NAME = 'ACCOUNT'
  --- REPLACE WITH YOUR TREE EFFECTIVE DATE
AND N.EFFDT         = TO_DATE('01011900','MMDDYYYY')
AND N.EFFDT         = L.EFFDT
AND N.TREE_NODE_NUM = L.TREE_NODE_NUM
  --- REPLACE TABLE WITH LOOKUP TABLE FOR YOUR chartfield
INNER JOIN PS_GL_ACCOUNT_TBL A
  --- REPLACE A.ACCOUNT WITH A.your_chartfield
ON A.ACCOUNT >= L.RANGE_FROM
  --- REPLACE A.ACCOUNT WITH A.your_chartfield
AND A.ACCOUNT <= L.RANGE_TO
  --- REPLACE WITH YOUR SETID
AND L.SETID = 'SHARE'
ORDER BY TREE_NODE_NUM,
  TREE_LEVEL_NUM,
  TREENODE;</pre>
<p>Remember to read the comments on each line to see where and what you need to replace in the query, depending on the tree you are querying and the ChartField stored on the tree.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;partner=sociable" title="PDF"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;partner=sociable" title="Print"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=PeopleSoft%20Trees%20via%20SQL&amp;body=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F" title="email"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=PeopleSoft%20Trees%20via%20SQL%20-%20http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F" title="Twitter"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;t=PeopleSoft%20Trees%20via%20SQL" title="Facebook"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;title=PeopleSoft%20Trees%20via%20SQL&amp;source=Tyson+Moore+Consultant%2C+Developer%2C+Volunteer&amp;summary=I%20need%20to%20export%20%28using%20SQL%29%20a%20PeopleSoft%20tree%20-%20showing%20all%20Tree%20Nodes%20and%20Leafs%20from%20the%20Top%20of%20the%20tree%20all%20the%20way%20down.%20levels%20are%20not%20used%20on%20the%20tree%20I%20am%20trying%20to%20retrieve.%20Can%20someone%20please%20help%20-%20it%20would%20be%20much%20appreciated%21%0D%0AHere%20is%20the" title="LinkedIn"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tysonmoore.net/public/feed/" title="RSS"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;t=PeopleSoft%20Trees%20via%20SQL&amp;s=I%20need%20to%20export%20%28using%20SQL%29%20a%20PeopleSoft%20tree%20-%20showing%20all%20Tree%20Nodes%20and%20Leafs%20from%20the%20Top%20of%20the%20tree%20all%20the%20way%20down.%20levels%20are%20not%20used%20on%20the%20tree%20I%20am%20trying%20to%20retrieve.%20Can%20someone%20please%20help%20-%20it%20would%20be%20much%20appreciated%21%0D%0AHere%20is%20the" title="Tumblr"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F&amp;title=PeopleSoft%20Trees%20via%20SQL&amp;annotation=I%20need%20to%20export%20%28using%20SQL%29%20a%20PeopleSoft%20tree%20-%20showing%20all%20Tree%20Nodes%20and%20Leafs%20from%20the%20Top%20of%20the%20tree%20all%20the%20way%20down.%20levels%20are%20not%20used%20on%20the%20tree%20I%20am%20trying%20to%20retrieve.%20Can%20someone%20please%20help%20-%20it%20would%20be%20much%20appreciated%21%0D%0AHere%20is%20the" title="Google Bookmarks"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=PeopleSoft%20Trees%20via%20SQL&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fpeoplesoft-trees-via-sql%2F" title="Netvibes"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tysonmoore.net/public/2010/01/peoplesoft-trees-via-sql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL Developer Tweaks</title>
		<link>http://www.tysonmoore.net/public/2010/01/sql-developer-tweaks/</link>
		<comments>http://www.tysonmoore.net/public/2010/01/sql-developer-tweaks/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 18:16:31 +0000</pubDate>
		<dc:creator>Tyson</dc:creator>
				<category><![CDATA[PeopleSoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle sql developer]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql developer]]></category>

		<guid isPermaLink="false">http://www.tysonmoore.net/public/?p=21</guid>
		<description><![CDATA[I came across Duncan Davies&#8216;s PeopleSoft Tipster blog when searching for ways to customize and optimize SQL Developer to make my job easier. He has some great tips for tweaking Oracle&#8217;s free SQL Developer tool to look better and work better for the consultants of the world. Some tips that I&#8217;ve started using: 1) Change [...]]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://peoplesofttipster.com/sql-developer/" target="_blank">Duncan Davies</a>&#8216;s PeopleSoft Tipster blog when searching for ways to customize and optimize SQL Developer to make my job easier.  He has some great tips for tweaking Oracle&#8217;s free SQL Developer tool to look better and work better for the consultants of the world.  Some tips that I&#8217;ve started using:</p>
<blockquote><p>1)  Change the Font. Developers like to indent and line up their code to make it more readable.  Why deliver the product with a default font that isn’t fixed width, therefore making this harder?  The first change I make is to swap the font (Tools &gt; Preferences &gt; Code Editor &gt; Fonts) for Lucida Console, 11pts – although the font size may vary depending upon monitor resolution and the state of your eyesight.</p></blockquote>
<p>&#8230;</p>
<blockquote><p>3)	Syntax Colours. Picking a better colour scheme eases readability as you’ll be able to pick out strings, operators and brackets/braces quicker but the delivered scheme highlights keywords in bold, which throws out the alignment if you’ve pick a fixed-width font.  I normally make the following changes (Tools &gt; Preferences &gt; Code Editor &gt; Syntax Colours):</p>
<ul>
<li>Remove the bold highlight from ‘Default Element Name’ and ‘Default Keyword’.</li>
<li>Change Default Separator to purple</li>
<li>Change Default String to red</li>
<li>Uncheck ‘Enable highlight’ against Current SQL</li>
</ul>
</blockquote>
<p>I also use several of the Toolbar Shortcuts he mentions, such as F9 to execute SQL queries.</p>
<p>Thanks for the great article, Duncan!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;partner=sociable" title="PDF"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;partner=sociable" title="Print"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=SQL%20Developer%20Tweaks&amp;body=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F" title="email"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=SQL%20Developer%20Tweaks%20-%20http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F" title="Twitter"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;t=SQL%20Developer%20Tweaks" title="Facebook"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;title=SQL%20Developer%20Tweaks&amp;source=Tyson+Moore+Consultant%2C+Developer%2C+Volunteer&amp;summary=I%20came%20across%20Duncan%20Davies%27s%20PeopleSoft%20Tipster%20blog%20when%20searching%20for%20ways%20to%20customize%20and%20optimize%20SQL%20Developer%20to%20make%20my%20job%20easier.%20%20He%20has%20some%20great%20tips%20for%20tweaking%20Oracle%27s%20free%20SQL%20Developer%20tool%20to%20look%20better%20and%20work%20better%20for%20the%20" title="LinkedIn"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tysonmoore.net/public/feed/" title="RSS"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;t=SQL%20Developer%20Tweaks&amp;s=I%20came%20across%20Duncan%20Davies%27s%20PeopleSoft%20Tipster%20blog%20when%20searching%20for%20ways%20to%20customize%20and%20optimize%20SQL%20Developer%20to%20make%20my%20job%20easier.%20%20He%20has%20some%20great%20tips%20for%20tweaking%20Oracle%27s%20free%20SQL%20Developer%20tool%20to%20look%20better%20and%20work%20better%20for%20the%20" title="Tumblr"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F&amp;title=SQL%20Developer%20Tweaks&amp;annotation=I%20came%20across%20Duncan%20Davies%27s%20PeopleSoft%20Tipster%20blog%20when%20searching%20for%20ways%20to%20customize%20and%20optimize%20SQL%20Developer%20to%20make%20my%20job%20easier.%20%20He%20has%20some%20great%20tips%20for%20tweaking%20Oracle%27s%20free%20SQL%20Developer%20tool%20to%20look%20better%20and%20work%20better%20for%20the%20" title="Google Bookmarks"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=SQL%20Developer%20Tweaks&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fsql-developer-tweaks%2F" title="Netvibes"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tysonmoore.net/public/2010/01/sql-developer-tweaks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asset Management &#8211; Remaining Life</title>
		<link>http://www.tysonmoore.net/public/2010/01/asset-management-remaining-life/</link>
		<comments>http://www.tysonmoore.net/public/2010/01/asset-management-remaining-life/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 23:35:55 +0000</pubDate>
		<dc:creator>Tyson</dc:creator>
				<category><![CDATA[Asset Management]]></category>
		<category><![CDATA[PeopleSoft]]></category>
		<category><![CDATA[peoplesoft asset management]]></category>
		<category><![CDATA[remaining life]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.tysonmoore.net/public/?p=13</guid>
		<description><![CDATA[I had a request to create a query that would return an asset&#8217;s remaining life from PeopleSoft Asset Management 9.0.  This presumes you have loaded the PS_ASSET_NBV_TBL (asset NBV table) for the asset, that you are running it as VP1, and the Run ID used is NBV.  Obviously you should change these variables to match [...]]]></description>
			<content:encoded><![CDATA[<p>I had a request to create a query that would return an asset&#8217;s remaining life from PeopleSoft Asset Management 9.0.  This presumes you have loaded the PS_ASSET_NBV_TBL (asset NBV table) for the asset, that you are running it as VP1, and the Run ID used is NBV.  Obviously you should change these variables to match your current configuration.</p>
<pre name="code" class="sql">SELECT A.BUSINESS_UNIT, A.ASSET_ID, A.BOOK, A.IN_SERVICE_DT,
A.BEGIN_DEPR_DT, A.LIFE,
CASE
WHEN A.LIFE-(COUNT(D.ACCOUNTING_PERIOD)+((C.END_DT-A.BEGIN_DEPR_DT)/
     (C.END_DT-C.BEGIN_DT))-1) &lt; 0 THEN 0
ELSE A.LIFE-(COUNT(D.ACCOUNTING_PERIOD)+((C.END_DT-A.BEGIN_DEPR_DT)/
     (C.END_DT-C.BEGIN_DT))-1)
END AS REMAINING_LIFE
FROM PS_BOOK_CUR_VW A, PS_BU_BOOK_TBL B, PS_CAL_DETP_TBL C,
     PS_CAL_DETP_TBL D, PS_SET_CNTRL_REC T
WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT
AND A.BOOK = B.BOOK
AND A.BUSINESS_UNIT = T.SETCNTRLVALUE
AND T.REC_GROUP_ID = 'FS_02'
AND T.RECNAME = 'CAL_DETP_TBL'
AND C.SETID = T.SETID
AND B.CAL_DEPR_PD = C.CALENDAR_ID
AND D.SETID = T.SETID
AND B.CAL_DEPR_PD = D.CALENDAR_ID
AND A.BEGIN_DEPR_DT >= C.BEGIN_DT
AND A.BEGIN_DEPR_DT <= C.END_DT
AND D.END_DT >= C.END_DT
AND D.END_DT <= (SELECT DISTINCT N.AS_OF_DATE FROM PS_ASSET_NBV_TBL N
     WHERE N.OPRID = 'VP1' AND N.RUN_ID = 'NBV' AND A.BOOK = N.BOOK)
GROUP BY A.BUSINESS_UNIT, A.ASSET_ID, A.BOOK, A.LIFE, A.IN_SERVICE_DT,
     A.BEGIN_DEPR_DT, C.END_DT, C.BEGIN_DT
ORDER BY A.BUSINESS_UNIT, A.ASSET_ID, A.BOOK;</pre>
<p>Note: The SQL hasn't been performance tuned yet.  I will post ways to tune this SQL, or appropriate indexes for the tables referenced, once I have them identified.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;partner=sociable" title="PDF"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;partner=sociable" title="Print"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="mailto:?subject=Asset%20Management%20-%20Remaining%20Life&amp;body=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F" title="email"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Asset%20Management%20-%20Remaining%20Life%20-%20http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F" title="Twitter"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;t=Asset%20Management%20-%20Remaining%20Life" title="Facebook"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;title=Asset%20Management%20-%20Remaining%20Life&amp;source=Tyson+Moore+Consultant%2C+Developer%2C+Volunteer&amp;summary=I%20had%20a%20request%20to%20create%20a%20query%20that%20would%20return%20an%20asset%27s%20remaining%20life%20from%20PeopleSoft%20Asset%20Management%209.0.%C2%A0%20This%20presumes%20you%20have%20loaded%20the%20PS_ASSET_NBV_TBL%20%28asset%20NBV%20table%29%20for%20the%20asset%2C%20that%20you%20are%20running%20it%20as%20VP1%2C%20and%20the%20Run%20ID%20u" title="LinkedIn"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tysonmoore.net/public/feed/" title="RSS"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;t=Asset%20Management%20-%20Remaining%20Life&amp;s=I%20had%20a%20request%20to%20create%20a%20query%20that%20would%20return%20an%20asset%27s%20remaining%20life%20from%20PeopleSoft%20Asset%20Management%209.0.%C2%A0%20This%20presumes%20you%20have%20loaded%20the%20PS_ASSET_NBV_TBL%20%28asset%20NBV%20table%29%20for%20the%20asset%2C%20that%20you%20are%20running%20it%20as%20VP1%2C%20and%20the%20Run%20ID%20u" title="Tumblr"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F&amp;title=Asset%20Management%20-%20Remaining%20Life&amp;annotation=I%20had%20a%20request%20to%20create%20a%20query%20that%20would%20return%20an%20asset%27s%20remaining%20life%20from%20PeopleSoft%20Asset%20Management%209.0.%C2%A0%20This%20presumes%20you%20have%20loaded%20the%20PS_ASSET_NBV_TBL%20%28asset%20NBV%20table%29%20for%20the%20asset%2C%20that%20you%20are%20running%20it%20as%20VP1%2C%20and%20the%20Run%20ID%20u" title="Google Bookmarks"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=Asset%20Management%20-%20Remaining%20Life&amp;url=http%3A%2F%2Fwww.tysonmoore.net%2Fpublic%2F2010%2F01%2Fasset-management-remaining-life%2F" title="Netvibes"><img src="http://www.tysonmoore.net/public/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tysonmoore.net/public/2010/01/asset-management-remaining-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

