<?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; Trees</title>
	<atom:link href="http://www.tysonmoore.net/public/category/peoplesoft/trees/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.0.1</generator>
		<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[PSoftPros]]></category>
		<category><![CDATA[PeopleSoft]]></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>
	</channel>
</rss>
