Relational hierarchical data to hierarchical XML

Hi All,
I have a self-referential relational table (ie, fk to self) to establish hierarchical, parent-child relationships (item_id is PK and item_id_parent references item_id as FK) between items. There can be an arbitrary level of depth down any branch of a tree. I can issue a basic "connect by" query and get back a correct hierarchical representation along the lines of the following (for a chosen root):
root
sub1
sub1,1
sub1,1,1
sub1,1,2
sub1,2
sub2
sub3
sub3,1
sub3,2
sub3,2,1
I need to generate a hierarchical XML document to represent this along the lines of:
<base>
<name>root</name>
<subs>
<sub>
<name>sub1</name>
<subs>
<sub>
<name>sub1,1</name>
<subs>
<sub>
<name>sub1,1,1</name>
</sub>
<sub>
<name>sub1,1,2</name>
</sub>
</subs>
</sub>
<sub>
<name>sub1,2</name>
</sub>
</subs>
</sub>
<sub>
<name>sub2</name>
</sub>
</subs>
</base>
I originally anticipated using XMLELEMENT, XMLForest, XMLAGG, etc, but I can't quite figure out how to handle the arbitrary nature of the depth of a branch. I can build a 'flat' xml document (containing all subs, in the right order, but not hierarchically nested below parents) or I can build the base and some pre-determined level of depth of the subs, but not an arbitrary level of depth. I next tried using types with dbms_xmlgen.newContext and cast(multiset(select...)), but again, I can only do it for a predetermined level of depth (ie, not in a recursive manner).
Can someone please give me a hint or two on this??
Thanks Much!!!!
Jim Stoll

Testing with 10g I do not have the problem...
SQL> set trimspool on
SQL> connect &1/&2
Connected.
SQL> --
SQL> set timing on
SQL> set long 10000
SQL> set pages 10000
SQL> set feedback on
SQL> set lines 132
SQL> --
SQL> @@testcasebody.sql
SQL> declare
2 xmlschema CLOB :=
3 '<?xml version="1.0" encoding="UTF-8"?>
4 <!--W3C Schema generated by XMLSPY v2004 rel. 2 U (http://www.xmlspy.com)-->
5 <xs:schema targetNamespace="EmployeeList" xmlns="EmployeeList" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
6      <xs:complexType name="EmployeeType" mixed="true">
7           <xs:choice>
8                <xs:element name="Manager" type="xs:byte"/>
9                <xs:element name="Employee" type="xs:byte"/>
10                <xs:element name="FirstName" type="xs:string"/>
11                <xs:element name="LastName" type="xs:string"/>
12                <xs:element name="EmailAddress" type="xs:string"/>
13                <xs:element name="Telephone" type="xs:string"/>
14                <xs:element name="StartDate" type="xs:date"/>
15                <xs:element name="Position" type="xs:string"/>
16                <xs:element name="Salary" type="xs:short"/>
17                <xs:element name="Reports" type="ReportsType"/>
18           </xs:choice>
19      </xs:complexType>
20      <xs:complexType name="ReportsType">
21           <xs:sequence>
22                <xs:element name="Employee" type="EmployeeType" maxOccurs="unbounded"/>
23           </xs:sequence>
24      </xs:complexType>
25      <xs:element name="Corporation">
26           <xs:complexType>
27                <xs:sequence>
28                     <xs:element name="Employee" type="EmployeeType"/>
29                </xs:sequence>
30           </xs:complexType>
31      </xs:element>
32 </xs:schema>';
33 begin
34 dbms_xmlschema.registerSchema
35 (
36      schemaURL => 'Employee.xsd',
37      schemaDoc => xmlschema,
38      local     => TRUE,
39      genTypes => TRUE,
40      genBean => FALSE,
41      genTables => FALSE
42 );
43 end;
44 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.63
SQL> create or replace function processResultSet(currentLevel in out number, currentNode in out XMLType, query SYS_REFCURSOR)
2 return XMLType
3 is
4 thisLevel number;
5 thisNode xmlType;
6 result xmlType;
7 begin
8 thisLevel := currentLevel;
9 thisNode := currentNode;
10 fetch query into currentLevel, currentNode;
11 if (query%NOTFOUND) then
12      currentLevel := -1;
13 end if;
14 while (currentLevel >= thisLevel) loop
15      -- Next Node is a decendant of sibling of this Node.
16      if (currentLevel > thisLevel) then
17      -- Next Node is a decendant of this Node.
18      result := processResultSet(currentLevel, currentNode, query);
19      select xmlElement
20           (
21           "Employee",
22           extract(thisNode,'/Employee/*'),
23           xmlElement
24           (
25           "Reports",
26           result
27           )
28           )
29      into thisNode
30      from dual;
31      else
32      -- Next node is a sibling of this Node.
33      result := processResultSet(currentLevel, currentNode, query);
34      select xmlconcat(thisNode,result) into thisNode from dual;
35      end if;
36 end loop;
37
38 -- Next Node is a sibling of some ancestor of this node.
39
40 return thisNode;
41
42 end;
43 /
Function created.
Elapsed: 00:00:00.01
SQL> show errors
No errors.
SQL> --
SQL> create or replace function printEmployees
2 return XMLType
3 is
4      query SYS_REFCURSOR;
5      result XMLType;
6      rootLevel number := 0;
7      rootNode xmlType;
8 begin
9      open query for
10      select level, xmlElement
11                (
12                "Employee",
13                xmlForest
14                (
15                e.MANAGER_ID as "Manager",
16                e.EMPLOYEE_ID as "Employee",
17                e.FIRST_NAME as "FirstName",
18                e.LAST_NAME as "LastName",
19                e.EMAIL     as "EmailAddress",
20                e.PHONE_NUMBER as "Telephone",
21                to_char(e.HIRE_DATE,'YYYY-MM-DD') as "StartDate",
22                j.JOB_TITLE as "Position",
23                e.SALARY as "Salary",
24                e.COMMISSION_PCT as "Commission"
25                )
26                ) as XML
27      from HR.EMPLOYEES e, HR.JOBS j
28      where e.JOB_ID = J.JOB_ID
29           connect by PRIOR EMPLOYEE_ID = MANAGER_ID
30           start with MANAGER_ID is null;
31
32      fetch query into rootLevel, rootNode;
33      result := processResultSet(rootLevel, rootNode, query);
34      select xmlElement
35      (
36           "Corporation",
37           xmlAttributes
38           (
39           'EmployeeList' as "xmlns",
40           'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
41           'EmployeeList Employee.xsd' as "xsi:schemaLocation"
42           ),
43           result
44      )
45      into result
46      from dual;
47      return result;
48 end;
49 /
Function created.
Elapsed: 00:00:00.00
SQL> show errors
No errors.
SQL> --
SQL> create or replace view CORPORATION_VIEW of XMLType
2 with object id
3 (
4 'ROW'
5 )
6 as select printEmployees() from dual
7 /
View created.
Elapsed: 00:00:00.07
SQL> show errors
No errors.
SQL> --
SQL> set long     200000
SQL> set pagesize 10000
SQL> select * from CORPORATION_VIEW
2 /
SYS_NC_ROWINFO$
<Corporation xmlns="EmployeeList" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="EmployeeList Employee.xs
d"><Employee><Employee>100</Employee>
<FirstName>Steven</FirstName>
<LastName>King</LastName>
<EmailAddress>SKING</EmailAddress>
<Telephone>515.123.4567</Telephone>
<StartDate>1987-06-17</StartDate>
<Position>President</Position>
<Salary>24000</Salary>
<Reports><Employee><Manager>100</Manager>
<Employee>101</Employee>
<FirstName>Neena</FirstName>
<LastName>Kochhar</LastName>
<EmailAddress>NKOCHHAR</EmailAddress>
<Telephone>515.123.4568</Telephone>
<StartDate>1989-09-21</StartDate>
<Position>Administration Vice President</Position>
<Salary>17000</Salary>
<Reports><Employee><Manager>101</Manager>
<Employee>205</Employee>
<FirstName>Shelley</FirstName>
<LastName>Higgins</LastName>
<EmailAddress>SHIGGINS</EmailAddress>
<Telephone>515.123.8080</Telephone>
<StartDate>1994-06-07</StartDate>
<Position>Accounting Manager</Position>
<Salary>12000</Salary>
<Reports><Employee><Manager>205</Manager><Employee>206</Employee><FirstName>William</FirstName><LastName>Gietz</LastName><EmailAddre
ss>WGIETZ</EmailAddress><Telephone>515.123.8181</Telephone><StartDate>1994-06-07</StartDate><Position>Public Accountant</Position><S
alary>8300</Salary></Employee></Reports></Employee><Employee><Manager>101</Manager><Employee>200</Employee><FirstName>Jennifer</Firs
tName><LastName>Whalen</LastName><EmailAddress>JWHALEN</EmailAddress><Telephone>515.123.4444</Telephone><StartDate>1987-09-17</Start
Date><Position>Administration Assistant</Position><Salary>4400</Salary></Employee><Employee><Manager>101</Manager>
<Employee>108</Employee>
<FirstName>Nancy</FirstName>
<LastName>Greenberg</LastName>
<EmailAddress>NGREENBE</EmailAddress>
<Telephone>515.124.4569</Telephone>
<StartDate>1994-08-17</StartDate>
<Position>Finance Manager</Position>
<Salary>12000</Salary>
<Reports><Employee><Manager>108</Manager><Employee>109</Employee><FirstName>Daniel</FirstName><LastName>Faviet</LastName><EmailAddre
ss>DFAVIET</EmailAddress><Telephone>515.124.4169</Telephone><StartDate>1994-08-16</StartDate><Position>Accountant</Position><Salary>
9000</Salary></Employee><Employee><Manager>108</Manager><Employee>112</Employee><FirstName>Jose Manuel</FirstName><LastName>Urman</L
astName><EmailAddress>JMURMAN</EmailAddress><Telephone>515.124.4469</Telephone><StartDate>1998-03-07</StartDate><Position>Accountant
</Position><Salary>7800</Salary></Employee><Employee><Manager>108</Manager><Employee>110</Employee><FirstName>John</FirstName><LastN
ame>Chen</LastName><EmailAddress>JCHEN</EmailAddress><Telephone>515.124.4269</Telephone><StartDate>1997-09-28</StartDate><Position>A
ccountant</Position><Salary>8200</Salary></Employee><Employee><Manager>108</Manager><Employee>111</Employee><FirstName>Ismael</First
Name><LastName>Sciarra</LastName><EmailAddress>ISCIARRA</EmailAddress><Telephone>515.124.4369</Telephone><StartDate>1997-09-30</Star
tDate><Position>Accountant</Position><Salary>7700</Salary></Employee><Employee><Manager>108</Manager><Employee>113</Employee><FirstN
ame>Luis</FirstName><LastName>Popp</LastName><EmailAddress>LPOPP</EmailAddress><Telephone>515.124.4567</Telephone><StartDate>1999-12
-07</StartDate><Position>Accountant</Position><Salary>6900</Salary></Employee></Reports></Employee><Employee><Manager>101</Manager><
Employee>203</Employee><FirstName>Susan</FirstName><LastName>Mavris</LastName><EmailAddress>SMAVRIS</EmailAddress><Telephone>515.123
.7777</Telephone><StartDate>1994-06-07</StartDate><Position>Human Resources Representative</Position><Salary>6500</Salary></Employee
<Employee><Manager>101</Manager><Employee>204</Employee><FirstName>Hermann</FirstName><LastName>Baer</LastName><EmailAddress>HBAER</EmailAddress><Telephone>515.123.8888</Telephone><StartDate>1994-06-07</StartDate><Position>Public Relations Representative</Positio
n><Salary>10000</Salary></Employee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>102</Employee>
<FirstName>Lex</FirstName>
<LastName>De Haan</LastName>
<EmailAddress>LDEHAAN</EmailAddress>
<Telephone>515.123.4569</Telephone>
<StartDate>1993-01-13</StartDate>
<Position>Administration Vice President</Position>
<Salary>17000</Salary>
<Reports><Employee><Manager>102</Manager>
<Employee>103</Employee>
<FirstName>Alexander</FirstName>
<LastName>Hunold</LastName>
<EmailAddress>AHUNOLD</EmailAddress>
<Telephone>590.423.4567</Telephone>
<StartDate>1990-01-03</StartDate>
<Position>Programmer</Position>
<Salary>9000</Salary>
<Reports><Employee><Manager>103</Manager><Employee>104</Employee><FirstName>Bruce</FirstName><LastName>Ernst</LastName><EmailAddress
BERNST</EmailAddress><Telephone>590.423.4568</Telephone><StartDate>1991-05-21</StartDate><Position>Programmer</Position><Salary>6000</Salary></Employee><Employee><Manager>103</Manager><Employee>105</Employee><FirstName>David</FirstName><LastName>Austin</LastName>
<EmailAddress>DAUSTIN</EmailAddress><Telephone>590.423.4569</Telephone><StartDate>1997-06-25</StartDate><Position>Programmer</Positi
on><Salary>4800</Salary></Employee><Employee><Manager>103</Manager><Employee>106</Employee><FirstName>Valli</FirstName><LastName>Pat
aballa</LastName><EmailAddress>VPATABAL</EmailAddress><Telephone>590.423.4560</Telephone><StartDate>1998-02-05</StartDate><Position>
Programmer</Position><Salary>4800</Salary></Employee><Employee><Manager>103</Manager><Employee>107</Employee><FirstName>Diana</First
Name><LastName>Lorentz</LastName><EmailAddress>DLORENTZ</EmailAddress><Telephone>590.423.5567</Telephone><StartDate>1999-02-07</Star
tDate><Position>Programmer</Position><Salary>4200</Salary></Employee></Reports></Employee></Reports></Employee><Employee><Manager>10
0</Manager>
<Employee>201</Employee>
<FirstName>Michael</FirstName>
<LastName>Hartstein</LastName>
<EmailAddress>MHARTSTE</EmailAddress>
<Telephone>515.123.5555</Telephone>
<StartDate>1996-02-17</StartDate>
<Position>Marketing Manager</Position>
<Salary>13000</Salary>
<Reports><Employee><Manager>201</Manager><Employee>202</Employee><FirstName>Pat</FirstName><LastName>Fay</LastName><EmailAddress>PFA
Y</EmailAddress><Telephone>603.123.6666</Telephone><StartDate>1997-08-17</StartDate><Position>Marketing Representative</Position><Sa
lary>6000</Salary></Employee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>114</Employee>
<FirstName>Den</FirstName>
<LastName>Raphaely</LastName>
<EmailAddress>DRAPHEAL</EmailAddress>
<Telephone>515.127.4561</Telephone>
<StartDate>1994-12-07</StartDate>
<Position>Purchasing Manager</Position>
<Salary>11000</Salary>
<Reports><Employee><Manager>114</Manager><Employee>115</Employee><FirstName>Alexander</FirstName><LastName>Khoo</LastName><EmailAddr
ess>AKHOO</EmailAddress><Telephone>515.127.4562</Telephone><StartDate>1995-05-18</StartDate><Position>Purchasing Clerk</Position><Sa
lary>3100</Salary></Employee><Employee><Manager>114</Manager><Employee>116</Employee><FirstName>Shelli</FirstName><LastName>Baida</L
astName><EmailAddress>SBAIDA</EmailAddress><Telephone>515.127.4563</Telephone><StartDate>1997-12-24</StartDate><Position>Purchasing
Clerk</Position><Salary>2900</Salary></Employee><Employee><Manager>114</Manager><Employee>117</Employee><FirstName>Sigal</FirstName>
<LastName>Tobias</LastName><EmailAddress>STOBIAS</EmailAddress><Telephone>515.127.4564</Telephone><StartDate>1997-07-24</StartDate><
Position>Purchasing Clerk</Position><Salary>2800</Salary></Employee><Employee><Manager>114</Manager><Employee>119</Employee><FirstNa
me>Karen</FirstName><LastName>Colmenares</LastName><EmailAddress>KCOLMENA</EmailAddress><Telephone>515.127.4566</Telephone><StartDat
e>1999-08-10</StartDate><Position>Purchasing Clerk</Position><Salary>2500</Salary></Employee><Employee><Manager>114</Manager><Employ
ee>118</Employee><FirstName>Guy</FirstName><LastName>Himuro</LastName><EmailAddress>GHIMURO</EmailAddress><Telephone>515.127.4565</T
elephone><StartDate>1998-11-15</StartDate><Position>Purchasing Clerk</Position><Salary>2600</Salary></Employee></Reports></Employee>
<Employee><Manager>100</Manager>
<Employee>145</Employee>
<FirstName>John</FirstName>
<LastName>Russell</LastName>
<EmailAddress>JRUSSEL</EmailAddress>
<Telephone>011.44.1344.429268</Telephone>
<StartDate>1996-10-01</StartDate>
<Position>Sales Manager</Position>
<Salary>14000</Salary>
<Commission>.4</Commission>
<Reports><Employee><Manager>145</Manager><Employee>150</Employee><FirstName>Peter</FirstName><LastName>Tucker</LastName><EmailAddres
s>PTUCKER</EmailAddress><Telephone>011.44.1344.129268</Telephone><StartDate>1997-01-30</StartDate><Position>Sales Representative</Po
sition><Salary>10000</Salary><Commission>.3</Commission></Employee><Employee><Manager>145</Manager><Employee>152</Employee><FirstNam
e>Peter</FirstName><LastName>Hall</LastName><EmailAddress>PHALL</EmailAddress><Telephone>011.44.1344.478968</Telephone><StartDate>19
97-08-20</StartDate><Position>Sales Representative</Position><Salary>9000</Salary><Commission>.25</Commission></Employee><Employee><
Manager>145</Manager><Employee>153</Employee><FirstName>Christopher</FirstName><LastName>Olsen</LastName><EmailAddress>COLSEN</Email
Address><Telephone>011.44.1344.498718</Telephone><StartDate>1998-03-30</StartDate><Position>Sales Representative</Position><Salary>8
000</Salary><Commission>.2</Commission></Employee><Employee><Manager>145</Manager><Employee>151</Employee><FirstName>David</FirstNam
e><LastName>Bernstein</LastName><EmailAddress>DBERNSTE</EmailAddress><Telephone>011.44.1344.345268</Telephone><StartDate>1997-03-24<
/StartDate><Position>Sales Representative</Position><Salary>9500</Salary><Commission>.25</Commission></Employee><Employee><Manager>1
45</Manager><Employee>154</Employee><FirstName>Nanette</FirstName><LastName>Cambrault</LastName><EmailAddress>NCAMBRAU</EmailAddress
<Telephone>011.44.1344.987668</Telephone><StartDate>1998-12-09</StartDate><Position>Sales Representative</Position><Salary>7500</Salary><Commission>.2</Commission></Employee><Employee><Manager>145</Manager><Employee>155</Employee><FirstName>Oliver</FirstName><Las
tName>Tuvault</LastName><EmailAddress>OTUVAULT</EmailAddress><Telephone>011.44.1344.486508</Telephone><StartDate>1999-11-23</StartDa
te><Position>Sales Representative</Position><Salary>7000</Salary><Commission>.15</Commission></Employee></Reports></Employee><Employ
ee><Manager>100</Manager>
<Employee>146</Employee>
<FirstName>Karen</FirstName>
<LastName>Partners</LastName>
<EmailAddress>KPARTNER</EmailAddress>
<Telephone>011.44.1344.467268</Telephone>
<StartDate>1997-01-05</StartDate>
<Position>Sales Manager</Position>
<Salary>13500</Salary>
<Commission>.3</Commission>
<Reports><Employee><Manager>146</Manager><Employee>156</Employee><FirstName>Janette</FirstName><LastName>King</LastName><EmailAddres
s>JKING</EmailAddress><Telephone>011.44.1345.429268</Telephone><StartDate>1996-01-30</StartDate><Position>Sales Representative</Posi
tion><Salary>10000</Salary><Commission>.35</Commission></Employee><Employee><Manager>146</Manager><Employee>158</Employee><FirstName
Allan</FirstName><LastName>McEwen</LastName><EmailAddress>AMCEWEN</EmailAddress><Telephone>011.44.1345.829268</Telephone><StartDate
1996-08-01</StartDate><Position>Sales Representative</Position><Salary>9000</Salary><Commission>.35</Commission></Employee><Employee><Manager>146</Manager><Employee>160</Employee><FirstName>Louise</FirstName><LastName>Doran</LastName><EmailAddress>LDORAN</EmailAd
dress><Telephone>011.44.1345.629268</Telephone><StartDate>1997-12-15</StartDate><Position>Sales Representative</Position><Salary>750
0</Salary><Commission>.3</Commission></Employee><Employee><Manager>146</Manager><Employee>161</Employee><FirstName>Sarath</FirstName
<LastName>Sewall</LastName><EmailAddress>SSEWALL</EmailAddress><Telephone>011.44.1345.529268</Telephone><StartDate>1998-11-03</StartDate><Position>Sales Representative</Position><Salary>7000</Salary><Commission>.25</Commission></Employee><Employee><Manager>146</M
anager><Employee>159</Employee><FirstName>Lindsey</FirstName><LastName>Smith</LastName><EmailAddress>LSMITH</EmailAddress><Telephone
011.44.1345.729268</Telephone><StartDate>1997-03-10</StartDate><Position>Sales Representative</Position><Salary>8000</Salary><Commission>.3</Commission></Employee><Employee><Manager>146</Manager><Employee>157</Employee><FirstName>Patrick</FirstName><LastName>Sull
y</LastName><EmailAddress>PSULLY</EmailAddress><Telephone>011.44.1345.929268</Telephone><StartDate>1996-03-04</StartDate><Position>S
ales Representative</Position><Salary>9500</Salary><Commission>.35</Commission></Employee></Reports></Employee><Employee><Manager>10
0</Manager>
<Employee>148</Employee>
<FirstName>Gerald</FirstName>
<LastName>Cambrault</LastName>
<EmailAddress>GCAMBRAU</EmailAddress>
<Telephone>011.44.1344.619268</Telephone>
<StartDate>1999-10-15</StartDate>
<Position>Sales Manager</Position>
<Salary>11000</Salary>
<Commission>.3</Commission>
<Reports><Employee><Manager>148</Manager><Employee>169</Employee><FirstName>Harrison</FirstName><LastName>Bloom</LastName><EmailAddr
ess>HBLOOM</EmailAddress><Telephone>011.44.1343.829268</Telephone><StartDate>1998-03-23</StartDate><Position>Sales Representative</P
osition><Salary>10000</Salary><Commission>.2</Commission></Employee><Employee><Manager>148</Manager><Employee>168</Employee><FirstNa
me>Lisa</FirstName><LastName>Ozer</LastName><EmailAddress>LOZER</EmailAddress><Telephone>011.44.1343.929268</Telephone><StartDate>19
97-03-11</StartDate><Position>Sales Representative</Position><Salary>11500</Salary><Commission>.25</Commission></Employee><Employee>
<Manager>148</Manager><Employee>173</Employee><FirstName>Sundita</FirstName><LastName>Kumar</LastName><EmailAddress>SKUMAR</EmailAdd
ress><Telephone>011.44.1343.329268</Telephone><StartDate>2000-04-21</StartDate><Position>Sales Representative</Position><Salary>6100
</Salary><Commission>.1</Commission></Employee><Employee><Manager>148</Manager><Employee>172</Employee><FirstName>Elizabeth</FirstNa
me><LastName>Bates</LastName><EmailAddress>EBATES</EmailAddress><Telephone>011.44.1343.529268</Telephone><StartDate>1999-03-24</Star
tDate><Position>Sales Representative</Position><Salary>7300</Salary><Commission>.15</Commission></Employee><Employee><Manager>148</M
anager><Employee>171</Employee><FirstName>William</FirstName><LastName>Smith</LastName><EmailAddress>WSMITH</EmailAddress><Telephone
011.44.1343.629268</Telephone><StartDate>1999-02-23</StartDate><Position>Sales Representative</Position><Salary>7400</Salary><Commission>.15</Commission></Employee><Employee><Manager>148</Manager><Employee>170</Employee><FirstName>Tayler</FirstName><LastName>Fox<
/LastName><EmailAddress>TFOX</EmailAddress><Telephone>011.44.1343.729268</Telephone><StartDate>1998-01-24</StartDate><Position>Sales
Representative</Position><Salary>9600</Salary><Commission>.2</Commission></Employee></Reports></Employee><Employee><Manager>100</Ma
nager>
<Employee>149</Employee>
<FirstName>Eleni</FirstName>
<LastName>Zlotkey</LastName>
<EmailAddress>EZLOTKEY</EmailAddress>
<Telephone>011.44.1344.429018</Telephone>
<StartDate>2000-01-29</StartDate>
<Position>Sales Manager</Position>
<Salary>10500</Salary>
<Commission>.2</Commission>
<Reports><Employee><Manager>149</Manager><Employee>179</Employee><FirstName>Charles</FirstName><LastName>Johnson</LastName><EmailAdd
ress>CJOHNSON</EmailAddress><Telephone>011.44.1644.429262</Telephone><StartDate>2000-01-04</StartDate><Position>Sales Representative
</Position><Salary>6200</Salary><Commission>.1</Commission></Employee><Employee><Manager>149</Manager><Employee>178</Employee><First
Name>Kimberely</FirstName><LastName>Grant</LastName><EmailAddress>KGRANT</EmailAddress><Telephone>011.44.1644.429263</Telephone><Sta
rtDate>1999-05-24</StartDate><Position>Sales Representative</Position><Salary>7000</Salary><Commission>.15</Commission></Employee><E
mployee><Manager>149</Manager><Employee>177</Employee><FirstName>Jack</FirstName><LastName>Livingston</LastName><EmailAddress>JLIVIN
GS</EmailAddress><Telephone>011.44.1644.429264</Telephone><StartDate>1998-04-23</StartDate><Position>Sales Representative</Position>
<Salary>8400</Salary><Commission>.2</Commission></Employee><Employee><Manager>149</Manager><Employee>176</Employee><FirstName>Jonath
on</FirstName><LastName>Taylor</LastName><EmailAddress>JTAYLOR</EmailAddress><Telephone>011.44.1644.429265</Telephone><StartDate>199
8-03-24</StartDate><Position>Sales Representative</Position><Salary>8600</Salary><Commission>.2</Commission></Employee><Employee><Ma
nager>149</Manager><Employee>175</Employee><FirstName>Alyssa</FirstName><LastName>Hutton</LastName><EmailAddress>AHUTTON</EmailAddre
ss><Telephone>011.44.1644.429266</Telephone><StartDate>1997-03-19</StartDate><Position>Sales Representative</Position><Salary>8800</
Salary><Commission>.25</Commission></Employee><Employee><Manager>149</Manager><Employee>174</Employee><FirstName>Ellen</FirstName><L
astName>Abel</LastName><EmailAddress>EABEL</EmailAddress><Telephone>011.44.1644.429267</Telephone><StartDate>1996-05-11</StartDate><
Position>Sales Representative</Position><Salary>11000</Salary><Commission>.3</Commission></Employee></Reports></Employee><Employee><
Manager>100</Manager>
<Employee>147</Employee>
<FirstName>Alberto</FirstName>
<LastName>Errazuriz</LastName>
<EmailAddress>AERRAZUR</EmailAddress>
<Telephone>011.44.1344.429278</Telephone>
<StartDate>1997-03-10</StartDate>
<Position>Sales Manager</Position>
<Salary>12000</Salary>
<Commission>.3</Commission>
<Reports><Employee><Manager>147</Manager><Employee>167</Employee><FirstName>Amit</FirstName><LastName>Banda</LastName><EmailAddress>
ABANDA</EmailAddress><Telephone>011.44.1346.729268</Telephone><StartDate>2000-04-21</StartDate><Position>Sales Representative</Posit
ion><Salary>6200</Salary><Commission>.1</Commission></Employee><Employee><Manager>147</Manager><Employee>166</Employee><FirstName>Su
ndar</FirstName><LastName>Ande</LastName><EmailAddress>SANDE</EmailAddress><Telephone>011.44.1346.629268</Telephone><StartDate>2000-
03-24</StartDate><Position>Sales Representative</Position><Salary>6400</Salary><Commission>.1</Commission></Employee><Employee><Mana
ger>147</Manager><Employee>165</Employee><FirstName>David</FirstName><LastName>Lee</LastName><EmailAddress>DLEE</EmailAddress><Telep
hone>011.44.1346.529268</Telephone><StartDate>2000-02-23</StartDate><Position>Sales Representative</Position><Salary>6800</Salary><C
ommission>.1</Commission></Employee><Employee><Manager>147</Manager><Employee>164</Employee><FirstName>Mattea</FirstName><LastName>M
arvins</LastName><EmailAddress>MMARVINS</EmailAddress><Telephone>011.44.1346.329268</Telephone><StartDate>2000-01-24</StartDate><Pos
ition>Sales Representative</Position><Salary>7200</Salary><Commission>.1</Commission></Employee><Employee><Manager>147</Manager><Emp
loyee>163</Employee><FirstName>Danielle</FirstName><LastName>Greene</LastName><EmailAddress>DGREENE</EmailAddress><Telephone>011.44.
1346.229268</Telephone><StartDate>1999-03-19</StartDate><Position>Sales Representative</Position><Salary>9500</Salary><Commission>.1
5</Commission></Employee><Employee><Manager>147</Manager><Employee>162</Employee><FirstName>Clara</FirstName><LastName>Vishney</Last
Name><EmailAddress>CVISHNEY</EmailAddress><Telephone>011.44.1346.129268</Telephone><StartDate>1997-11-11</StartDate><Position>Sales
Representative</Position><Salary>10500</Salary><Commission>.25</Commission></Employee></Reports></Employee><Employee><Manager>100</M
anager>
<Employee>120</Employee>
<FirstName>Matthew</FirstName>
<LastName>Weiss</LastName>
<EmailAddress>MWEISS</EmailAddress>
<Telephone>650.123.1234</Telephone>
<StartDate>1996-07-18</StartDate>
<Position>Stock Manager</Position>
<Salary>8000</Salary>
<Reports><Employee><Manager>120</Manager><Employee>180</Employee><FirstName>Winston</FirstName><LastName>Taylor</LastName><EmailAddr
ess>WTAYLOR</EmailAddress><Telephone>650.507.9876</Telephone><StartDate>1998-01-24</StartDate><Position>Shipping Clerk</Position><Sa
lary>3200</Salary></Employee><Employee><Manager>120</Manager><Employee>181</Employee><FirstName>Jean</FirstName><LastName>Fleaur</La
stName><EmailAddress>JFLEAUR</EmailAddress><Telephone>650.507.9877</Telephone><StartDate>1998-02-23</StartDate><Position>Shipping Cl
erk</Position><Salary>3100</Salary></Employee><Employee><Manager>120</Manager><Employee>183</Employee><FirstName>Girard</FirstName><
LastName>Geoni</LastName><EmailAddress>GGEONI</EmailAddress><Telephone>650.507.9879</Telephone><StartDate>2000-02-03</StartDate><Pos
ition>Shipping Clerk</Position><Salary>2800</Salary></Employee><Employee><Manager>120</Manager><Employee>182</Employee><FirstName>Ma
rtha</FirstName><LastName>Sullivan</LastName><EmailAddress>MSULLIVA</EmailAddress><Telephone>650.507.9878</Telephone><StartDate>1999
-06-21</StartDate><Position>Shipping Clerk</Position><Salary>2500</Salary></Employee><Employee><Manager>120</Manager><Employee>125</
Employee><FirstName>Julia</FirstName><LastName>Nayer</LastName><EmailAddress>JNAYER</EmailAddress><Telephone>650.124.1214</Telephone
<StartDate>1997-07-16</StartDate><Position>Stock Clerk</Position><Salary>3200</Salary></Employee><Employee><Manager>120</Manager><Employee>126</Employee><FirstName>Irene</FirstName><LastName>Mikkilineni</LastName><EmailAddress>IMIKKILI</EmailAddress><Telephone>65
0.124.1224</Telephone><StartDate>1998-09-28</StartDate><Position>Stock Clerk</Position><Salary>2700</Salary></Employee><Employee><Ma
nager>120</Manager><Employee>128</Employee><FirstName>Steven</FirstName><LastName>Markle</LastName><EmailAddress>SMARKLE</EmailAddre
ss><Telephone>650.124.1434</Telephone><StartDate>2000-03-08</StartDate><Position>Stock Clerk</Position><Salary>2200</Salary></Employ
ee><Employee><Manager>120</Manager><Employee>127</Employee><FirstName>James</FirstName><LastName>Landry</LastName><EmailAddress>JLAN
DRY</EmailAddress><Telephone>650.124.1334</Telephone><StartDate>1999-01-14</StartDate><Position>Stock Clerk</Position><Salary>2400</
Salary></Employee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>121</Employee>
<FirstName>Adam</FirstName>
<LastName>Fripp</LastName>
<EmailAddress>AFRIPP</EmailAddress>
<Telephone>650.123.2234</Telephone>
<StartDate>1997-04-10</StartDate>
<Position>Stock Manager</Position>
<Salary>8200</Salary>
<Reports><Employee><Manager>121</Manager><Employee>185</Employee><FirstName>Alexis</FirstName><LastName>Bull</LastName><EmailAddress
ABULL</EmailAddress><Telephone>650.509.2876</Telephone><StartDate>1997-02-20</StartDate><Position>Shipping Clerk</Position><Salary>4100</Salary></Employee><Employee><Manager>121</Manager><Employee>187</Employee><FirstName>Anthony</FirstName><LastName>Cabrio</Last
Name><EmailAddress>ACABRIO</EmailAddress><Telephone>650.509.4876</Telephone><StartDate>1999-02-07</StartDate><Position>Shipping Cler
k</Position><Salary>3000</Salary></Employee><Employee><Manager>121</Manager><Employee>186</Employee><FirstName>Julia</FirstName><Las
tName>Dellinger</LastName><EmailAddress>JDELLING</EmailAddress><Telephone>650.509.3876</Telephone><StartDate>1998-06-24</StartDate><
Position>Shipping Clerk</Position><Salary>3400</Salary></Employee><Employee><Manager>121</Manager><Employee>184</Employee><FirstName
Nandita</FirstName><LastName>Sarchand</LastName><EmailAddress>NSARCHAN</EmailAddress><Telephone>650.509.1876</Telephone><StartDate>1996-01-27</StartDate><Position>Shipping Clerk</Position><Salary>4200</Salary></Employee><Employee><Manager>121</Manager><Employee>1
30</Employee><FirstName>Mozhe</FirstName><LastName>Atkinson</LastName><EmailAddress>MATKINSO</EmailAddress><Telephone>650.124.6234</
Telephone><StartDate>1997-10-30</StartDate><Position>Stock Clerk</Position><Salary>2800</Salary></Employee><Employee><Manager>121</M
anager><Employee>132</Employee><FirstName>TJ</FirstName><LastName>Olson</LastName><EmailAddress>TJOLSON</EmailAddress><Telephone>650
.124.8234</Telephone><StartDate>1999-04-10</StartDate><Position>Stock Clerk</Position><Salary>2100</Salary></Employee><Employee><Man
ager>121</Manager><Employee>131</Employee><FirstName>James</FirstName><LastName>Marlow</LastName><EmailAddress>JAMRLOW</EmailAddress
<Telephone>650.124.7234</Telephone><StartDate>1997-02-16</StartDate><Position>Stock Clerk</Position><Salary>2500</Salary></Employee
<Employee><Manager>121</Manager><Employee>129</Employee><FirstName>Laura</FirstName><LastName>Bissot</LastName><EmailAddress>LBISSOT</EmailAddress><Telephone>650.124.5234</Telephone><StartDate>1997-08-20</StartDate><Position>Stock Clerk</Position><Salary>3300</Sa
lary></Employee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>122</Employee>
<FirstName>Payam</FirstName>
<LastName>Kaufling</LastName>
<EmailAddress>PKAUFLIN</EmailAddress>
<Telephone>650.123.3234</Telephone>
<StartDate>1995-05-01</StartDate>
<Position>Stock Manager</Position>
<Salary>7900</Salary>
<Reports><Employee><Manager>122</Manager><Employee>191</Employee><FirstName>Randall</FirstName><LastName>Perkins</LastName><EmailAdd
ress>RPERKINS</EmailAddress><Telephone>650.505.4876</Telephone><StartDate>1999-12-19</StartDate><Position>Shipping Clerk</Position><
Salary>2500</Salary></Employee><Employee><Manager>122</Manager><Employee>190</Employee><FirstName>Timothy</FirstName><LastName>Gates
</LastName><EmailAddress>TGATES</EmailAddress><Telephone>650.505.3876</Telephone><StartDate>1998-07-11</StartDate><Position>Shipping
Clerk</Position><Salary>2900</Salary></Employee><Employee><Manager>122</Manager><Employee>189</Employee><FirstName>Jennifer</FirstN
ame><LastName>Dilly</LastName><EmailAddress>JDILLY</EmailAddress><Telephone>650.505.2876</Telephone><StartDate>1997-08-13</StartDate
<Position>Shipping Clerk</Position><Salary>3600</Salary></Employee><Employee><Manager>122</Manager><Employee>188</Employee><FirstName>Kelly</FirstName><LastName>Chung</LastName><EmailAddress>KCHUNG</EmailAddress><Telephone>650.505.1876</Telephone><StartDate>1997-
06-14</StartDate><Position>Shipping Clerk</Position><Salary>3800</Salary></Employee><Employee><Manager>122</Manager><Employee>136</E
mployee><FirstName>Hazel</FirstName><LastName>Philtanker</LastName><EmailAddress>HPHILTAN</EmailAddress><Telephone>650.127.1634</Tel
ephone><StartDate>2000-02-06</StartDate><Position>Stock Clerk</Position><Salary>2200</Salary></Employee><Employee><Manager>122</Mana
ger><Employee>135</Employee><FirstName>Ki</FirstName><LastName>Gee</LastName><EmailAddress>KGEE</EmailAddress><Telephone>650.127.173
4</Telephone><StartDate>1999-12-12</StartDate><Position>Stock Clerk</Position><Salary>2400</Salary></Employee><Employee><Manager>122
</Manager><Employee>134</Employee><FirstName>Michael</FirstName><LastName>Rogers</LastName><EmailAddress>MROGERS</EmailAddress><Tele
phone>650.127.1834</Telephone><StartDate>1998-08-26</StartDate><Position>Stock Clerk</Position><Salary>2900</Salary></Employee><Empl
oyee><Manager>122</Manager><Employee>133</Employee><FirstName>Jason</FirstName><LastName>Mallin</LastName><EmailAddress>JMALLIN</Ema
ilAddress><Telephone>650.127.1934</Telephone><StartDate>1996-06-14</StartDate><Position>Stock Clerk</Position><Salary>3300</Salary><
/Employee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>123</Employee>
<FirstName>Shanta</FirstName>
<LastName>Vollman</LastName>
<EmailAddress>SVOLLMAN</EmailAddress>
<Telephone>650.123.4234</Telephone>
<StartDate>1997-10-10</StartDate>
<Position>Stock Manager</Position>
<Salary>6500</Salary>
<Reports><Employee><Manager>123</Manager><Employee>195</Employee><FirstName>Vance</FirstName><LastName>Jones</LastName><EmailAddress
VJONES</EmailAddress><Telephone>650.501.4876</Telephone><StartDate>1999-03-17</StartDate><Position>Shipping Clerk</Position><Salary
2800</Salary></Employee><Employee><Manager>123</Manager><Employee>194</Employee><FirstName>Samuel</FirstName><LastName>McCain</LastName><EmailAddress>SMCCAIN</EmailAddress><Telephone>650.501.3876</Telephone><StartDate>1998-07-01</StartDate><Position>Shipping Cler
k</Position><Salary>3200</Salary></Employee><Employee><Manager>123</Manager><Employee>193</Employee><FirstName>Britney</FirstName><L
astName>Everett</LastName><EmailAddress>BEVERETT</EmailAddress><Telephone>650.501.2876</Telephone><StartDate>1997-03-03</StartDate><
Position>Shipping Clerk</Position><Salary>3900</Salary></Employee><Employee><Manager>123</Manager><Employee>192</Employee><FirstName
Sarah</FirstName><LastName>Bell</LastName><EmailAddress>SBELL</EmailAddress><Telephone>650.501.1876</Telephone><StartDate>1996-02-04</StartDate><Position>Shipping Clerk</Position><Salary>4000</Salary></Employee><Employee><Manager>123</Manager><Employee>140</Emplo
yee><FirstName>Joshua</FirstName><LastName>Patel</LastName><EmailAddress>JPATEL</EmailAddress><Telephone>650.121.1834</Telephone><St
artDate>1998-04-06</StartDate><Position>Stock Clerk</Position><Salary>2500</Salary></Employee><Employee><Manager>123</Manager><Emplo
yee>139</Employee><FirstName>John</FirstName><LastName>Seo</LastName><EmailAddress>JSEO</EmailAddress><Telephone>650.121.2019</Telep
hone><StartDate>1998-02-12</StartDate><Position>Stock Clerk</Position><Salary>2700</Salary></Employee><Employee><Manager>123</Manage
r><Employee>138</Employee><FirstName>Stephen</FirstName><LastName>Stiles</LastName><EmailAddress>SSTILES</EmailAddress><Telephone>65
0.121.2034</Telephone><StartDate>1997-10-26</StartDate><Position>Stock Clerk</Position><Salary>3200</Salary></Employee><Employee><Ma
nager>123</Manager><Employee>137</Employee><FirstName>Renske</FirstName><LastName>Ladwig</LastName><EmailAddress>RLADWIG</EmailAddre
ss><Telephone>650.121.1234</Telephone><StartDate>1995-07-14</StartDate><Position>Stock Clerk</Position><Salary>3600</Salary></Employ
ee></Reports></Employee><Employee><Manager>100</Manager>
<Employee>124</Employee>
<FirstName>Kevin</FirstName>
<LastName>Mourgos</LastName>
<EmailAddress>KMOURGOS</EmailAddress>
<Telephone>650.123.5234</Telephone>
<StartDate>1999-11-16</StartDate>
<Position>Stock Manager</Position>
<Salary>5800</Salary>
<Reports><Employee><Manager>124</Manager><Employee>196</Employee><FirstName>Alana</FirstName><LastName>Walsh</LastName><EmailAddress
AWALSH</EmailAddress><Telephone>650.507.9811</Telephone><StartDate>1998-04-24</StartDate><Position>Shipping Clerk</Position><Salary
3100</Salary></Employee><Employee><Manager>124</Manager><Employee>199</Employee><FirstName>Douglas</FirstName><LastName>Grant</LastName><EmailAddress>DGRANT</EmailAddress><Telephone>650.507.9844</Telephone><StartDate>2000-01-13</StartDate><Position>Shipping Clerk
</Position><Salary>2600</Salary></Employee><Employee><Manager>124</Manager><Employee>198</Employee><FirstName>Donald</FirstName><Las
tName>OConnell</LastName><EmailAddress>DOCONNEL</EmailAddress><Telephone>650.507.9833</Telephone><StartDate>1999-06-21</StartDate><P
osition>Shipping Clerk</Position><Salary>2600</Salary></Employee><Employee><Manager>124</Manager><Employee>197</Employee><FirstName>
Kevin</FirstName><LastName>Feeney</LastName><EmailAddress>KFEENEY</EmailAddress><Telephone>650.507.9822</Telephone><StartDate>1998-0
5-23</StartDate><Position>Shipping Clerk</Position><Salary>3000</Salary></Employee><Employee><Manager>124</Manager><Employee>144</Em
ployee><FirstName>Peter</FirstName><LastName>Vargas</LastName><EmailAddress>PVARGAS</EmailAddress><Telephone>650.121.2004</Telephone
<StartDate>1998-07-09</StartDate><Position>Stock Clerk</Position><Salary>2500</Salary></Employee><Employee><Manager>124</Manager><Employee>143</Employee><FirstName>Randall</FirstName><LastName>Matos</LastName><EmailAddress>RMATOS</EmailAddress><Telephone>650.121.
2874</Telephone><StartDate>1998-03-15</StartDate><Position>Stock Clerk</Position><Salary>2600</Salary></Employee><Employee><Manager>
124</Manager><Employee>142</Employee><FirstName>Curtis</FirstName><LastName>Davies</LastName><EmailAddress>CDAVIES</EmailAddress><Te
lephone>650.121.2994</Telephone><StartDate>1997-01-29</StartDate><Position>Stock Clerk</Position><Salary>3100</Salary></Employee><Em
ployee><Manager>124</Manager><Employee>141</Employee><FirstName>Trenna</FirstName><LastName>Rajs</LastName><EmailAddress>TRAJS</Emai
lAddress><Telephone>650.121.8009</Telephone><StartDate>1995-10-17</StartDate><Position>Stock Clerk</Position><Salary>3500</Salary></
Employee></Reports></Employee></Reports></Employee></Corporation>
1 row selected.

Similar Messages

  • Convert Non-Hierarchical data into Hierarchical data for Tree creation

    Hi guys,
    I've been trying to figure this out for about two entire days now and I'm still stuck and see no possible solution which doesn't involve a new table creation.
    Thing is that I want to create a Tree to navigate through Projects and Tasks, I'm using the "Task Manager" demo app, which I have customized a bit to fit my needs.
    Basically I cannot create the Tree 'cause the relation between Projects and Tasks is not a hierarchical relation, it's a 1:N relation as this:
    __Projects__
    ID (PK)
    PROJECT_NAME
    ___Tasks___
    ID (PK)
    PROJECT_ID (FK references Projects.ID)
    So what I need to do is "force" that 1:N relation to a a hierarchical relation by creating a query (view) that joins the two tables into a single one and that have 2 columns I can use as ID and PARENT_ID for the tree creation.
    This is the Data Model:
    CREATE TABLE "EBA_TASK_PROJECTS"
    (     "ID" NUMBER,
         "PROJECT_NAME" VARCHAR2(255),
         "CREATED_ON" DATE NOT NULL ENABLE,
         "CREATED_BY" VARCHAR2(255) NOT NULL ENABLE,
         "UPDATED_ON" DATE,
         "UPDATED_BY" VARCHAR2(255),
         "FLEX_01" VARCHAR2(4000),
         "FLEX_02" VARCHAR2(4000),
         "FLEX_03" VARCHAR2(4000),
         "FLEX_04" VARCHAR2(4000),
         "FLEX_05" VARCHAR2(4000),
         "PARENT_ID" NUMBER,
         "IS_ACTIVE" VARCHAR2(1),
         "DESCRIPTION" VARCHAR2(4000),
         CONSTRAINT "EBA_TASK_PROJECTS_ACTIVE_CC" CHECK (is_active in ('Y', 'N')) ENABLE,
         CONSTRAINT "EBA_TASK_PROJECTS_PK" PRIMARY KEY ("ID") ENABLE
    ) ;ALTER TABLE "EBA_TASK_PROJECTS" ADD CONSTRAINT "EBA_TASK_PROJECTS_FK" FOREIGN KEY ("PARENT_ID")
         REFERENCES "EBA_TASK_PROJECTS" ("ID") ON DELETE CASCADE ENABLE;
    CREATE TABLE "EBA_TASK_TASKS"
    (     "ID" NUMBER NOT NULL ENABLE,
         "PROJECT_ID" NUMBER NOT NULL ENABLE,
         "TASK_PRIORITY" VARCHAR2(400) NOT NULL ENABLE,
         "TASK_DIFFICULTY" VARCHAR2(400) NOT NULL ENABLE,
         "TASK_NAME" VARCHAR2(4000) NOT NULL ENABLE,
         "TASK_DETAILS" VARCHAR2(4000),
         "CREATED_ON" DATE NOT NULL ENABLE,
         "COMPLETED" DATE,
         "CREATED_BY" VARCHAR2(400) NOT NULL ENABLE,
         "STATUS" VARCHAR2(4000),
         "UPDATED_ON" DATE,
         "STARTED" DATE,
         "TASK_PREDEFINED_ID" NUMBER,
         "UPDATED_BY" VARCHAR2(255),
         "USER_NAME" VARCHAR2(255) NOT NULL ENABLE,
         "FLEX_01" VARCHAR2(4000),
         "FLEX_02" VARCHAR2(4000),
         "FLEX_03" VARCHAR2(4000),
         "FLEX_04" VARCHAR2(4000),
         "FLEX_05" VARCHAR2(4000),
         "PERCENTAGE" NUMBER,
         CONSTRAINT "EBA_TASK_TASKS_PK" PRIMARY KEY ("ID") ENABLE
    ) ;ALTER TABLE "EBA_TASK_TASKS" ADD CONSTRAINT "EBA_TASK_TASKS_PROJECTS_FK" FOREIGN KEY ("PROJECT_ID")
         REFERENCES "EBA_TASK_PROJECTS" ("ID") ON DELETE CASCADE ENABLE;
    I'm using APEX4.0
    That's pretty much it guys, hope you can help me with this. I'm really stuck on this and am about to give up.

    WOW Odie! You're awesome !! It worked like a charm, I created a view as you suggested:
    CREATE OR REPLACE FORCE VIEW "VIEW_TASKS_PROJECTS_TREE" ("ID", "PARENT_ID", "NODE_NAME") AS
    SELECT to_char(id) as id
    , null as parent_id
    , project_name as node_name
    FROM eba_task_projects
    UNION ALL
    SELECT to_char(id)
    , to_char(project_id)
    , task_name
    FROM eba_task_tasks;
    And then I created a new tree with the defaults and customized the Tree query a bit (just added the links really):
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NODE_NAME" as title,
    null as icon,
    "ID" as value,
    null as tooltip,
    'f?p=&APP_ID.:22:&SESSION.::NO::P22_ID,P22_PREV_PAGE:' || "ID" || ',3' as link
    from "#OWNER#"."VIEW_TASKS_PROJECTS_TREE"
    start with "PARENT_ID" is null
    connect by prior "ID" = "PARENT_ID"
    order siblings by "NODE_NAME"
    Thanks man, you saved me a lot of time and headaches :)

  • Converting a 2Dimensional Array(Hierarchical Data) into XML List/Xml/Xmlistcollection in Flex

    How to convert a flat/hierarchical data (which I get from Excel as 2D Array) to XML format in Flex. The following is my Hierarchical Data:(Table form)
    Asia
    India
    Chennai
    TN
    Category1
    Product1
    100
    Asia
    India
    Mumbai
    MH
    Category1
    Product1
    100
    Asia
    India
    Calcutta
    CT
    Category1
    Product1
    100
    Asia
    India
    Calcutta
    CT
    Category2
    Product2
    200
    EMEA
    UK
    London
    LN
    Category3
    Product1
    122
    EMEA
    UK
    London
    LN
    Category3
    Product2
    201
    EMEA
    UK
    Reading
    RN
    Category1
    Product1
    123
    EMEA
    UK
    Reading
    RN
    Category1
    Product2
    455
    I need to format/convert this to XML format so that I can populate that resulting xml as dataprovider to a Tree control.
    I need to populate the above data into Tree component such that I get the following output:
    Asia
             India
                   Chennai
                       TN
                           Category1
                                Product1
                                         100
        Mumbai
                        MH
                           Category1
                                 Product1
                                          100  
    .............goes on till last numerical data of above table

    Try this into json then to xml. I did similar one using PHP and JSON.

  • AdvancedDataGrid - create Array (cfquery) with children for hierarchical data set

    I'm trying to create an AdvancedDataGrid with a hierarchical
    data set as shown below. The problem that I am having is how to
    call the data from a ColdFusion remote call and not an
    ArrayCollection inside of the Flex app (as below). I'm guessing
    that the problem is with the CFC that I've created which builds an
    array with children. I assume that the structure of the children is
    the issue. Any thoughts?
    Flex App without Remoting:
    http://livedocs.adobe.com/labs/flex3/html/help.html?content=advdatagrid_10.html
    <?xml version="1.0"?>
    <!-- dpcontrols/adg/GroupADGChartRenderer.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var dpHierarchy:ArrayCollection= new
    ArrayCollection([
    {name:"Barbara Jennings", region: "Arizona", total:70,
    children:[
    {detail:[{amount:5}]}]},
    {name:"Dana Binn", region: "Arizona", total:130, children:[
    {detail:[{amount:15}]}]},
    {name:"Joe Smith", region: "California", total:229,
    children:[
    {detail:[{amount:26}]}]},
    {name:"Alice Treu", region: "California", total:230,
    children:[
    {detail:[{amount:159}]}
    ]]>
    </mx:Script>
    <mx:AdvancedDataGrid id="myADG"
    width="100%" height="100%"
    variableRowHeight="true">
    <mx:dataProvider>
    <mx:HierarchicalData source="{dpHierarchy}"/>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    <mx:AdvancedDataGridColumn dataField="total"
    headerText="Total"/>
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider
    dataField="detail"
    renderer="myComponents.ChartRenderer"
    columnIndex="0"
    columnSpan="0"/>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Application>
    CFC - where I am trying to create an Array to send back to
    the Flex App
    <cfset aPackages = ArrayNew(1)>
    <cfset aDetails = ArrayNew(1)>
    <cfloop query="getPackages">
    <cfset i = getPackages.CurrentRow>
    <cfset aPackages
    = StructNew()>
    <cfset aPackages['name'] = name >
    <cfset aPackages
    ['region'] = region >
    <cfset aPackages['total'] = total >
    <cfset aDetails
    = StructNew()>
    <cfset aDetails['amount'] = amount >
    <cfset aPackages
    ['children'] = aDetails >
    </cfloop>
    <cfreturn aPackages>

    I had similar problems attempting to create an Array of
    Arrays in a CFC, so I created two differents scripts - one in CF
    and one in Flex - to build Hierarchical Data from a query result.
    The script in CF builds an Hierarchical XML document which is then
    easily accepted as HIerarchical Data in Flex. The script in Flex
    loops over the query Object that is returned as an Array
    Collection. It took me so long to create the XML script, and I now
    regret it, since it is not easy to maintain and keep dynamic.
    However, it only took me a short while to build this ActionScript
    logic, which I quite like now (though it is not [
    yet ] dynamic, and currently only handles two levels of
    Hierarchy):
    (this is the main part of my WebService result handler)....
    // Create a new Array Collection to store the Hierarchical
    Data from the WebService Result
    var categories:ArrayCollection = new ArrayCollection();
    // Create an Object variable to store the parent-level
    objects
    var category:Object;
    // Create an Object variable to store the child-level
    objects
    var subCategory:Object;
    // Loop through each Object in the WebService Result
    for each (var object:Object in results)
    // Create a new Array Collection as a copy of the Array
    Collection of Hierarchical Data
    var thisCategory:ArrayCollection = new
    ArrayCollection(categories.toArray());
    // Create a new instance of the Filter Function Class
    var filterFunction:FilterFunction = new FilterFunction();
    // Create Filter on the Array Collection to return only
    those records with the specified Category Name
    thisCategory.filterFunction =
    filterFunction.NameValueFilter("NAMETXT", object["CATNAMETXT"]);
    // Refresh the Array Collection to apply the Filter
    thisCategory.refresh();
    // If the Array Collection has records, the Category Name
    exists, so use the one Object in the Collection to add Children to
    if (thisCategory.length)
    category = thisCategory.getItemAt(0);
    // If the Array Collection has no records, the Category Name
    does not exist, so create a new Object
    else
    // Create a new parent-level Object
    category = new Object();
    // Create and set the Name property of the parent-level
    Object
    category["NAMETXT"] = object["CATNAMETXT"];
    // Create a Children property as a new Array
    category["children"] = new Array();
    // Add the parent-level Object to the Array Collection
    categories.addItem(category);
    // Create a new child-level Object as a copy of the Object
    in the WebService Result
    subCategory = object;
    // Create and set the Name property of the child-level
    Object
    subCategory["NAMETXT"] = object["SUBCATNAMETXT"];
    // Add the child-level Object to the Array of Children on
    the parent-level Object
    category["children"].push(subCategory);
    // Convert the Array Collection to a Hierarchical Data
    Object and use it as the Data Provider for the Advanced Data Grid
    advancedDataGrid.dataProvider = new
    HierarchicalData(categories);

  • How to store, data of hierarchical in nature?

    Hi,
    We are designing a database for our office. Part of our data is
    hierarchical in nature, and I am not sure how to store that data in relational tables.
    we have many training courses, each belongs to many groups, sub-groups. Depth of this tree is not pre-determined and it may grow to maximum five to six levels.
    For Example:
    1. Consider five training courses A,B,C,D,E
    2. A,B,C belongs to Group G1 and D,E belongs to Group G2
    3. Group G1, G2 are part of Group GG1
    4. and this grouping is dynamic in nature.
    Is there any standard way to store this kind of group information
    in relational model.
    natrajv
    mumbai

    CREATE TABLE O_GROUP
    (id number,
    name varchar2(100),
    father_id number,
    constraint pk_o_group primary key(id),
    constraint fk_o_group foreign key(father_id)
    references o_group(id))
    -- father_id builds a hierarchical tree
    CREATE TABLE O_COURSE
    (id number,
    name varchar2(100),
    o_group_id number,
    constraint pk_o_course primary key(id),
    constraint fk_o_course_grp foreign Key(o_group_id)
    references O_GROUP(id))
    insert into 0_GROUP
    values(1,'GG1',NULL);
    insert into O_GROUP
    values(2,'G1',1);
    insert into O_GROUP
    values(3,'G2',1);
    insert into O_COURSE
    values(1,'A',2);
    insert into O_COURSE
    values(2,'B',2);
    insert into O_COURSE
    values(3,'C',2);
    insert into O_COURSE
    values(4,'D',3);
    insert into O_COURSE
    values(5,'E',3);
    commit;

  • Hierarchical data structure

    I am trying to represent the following data structure in hierarchical format ---- but I am not going to use any swing components, so jtree and such are out, and xml is probably out. I was hoping some form of collection would work but I can't seem to get it!
    Example Scenario
    Football League --- Football Team -- Player Name
    West
    ------------------------------Chiefs
    -------------------------------------------------------------xyz
    -------------------------------------------------------------abc
    -------------------------------------------------------------mno
    ------------------------------Broncos
    ------------------------------------------------------------asq
    ------------------------------------------------------------daff
    This hierarchical structure has a couple of layers, so I don't know how I can feasibly do it. I have tried to look at making hashmaps on top of each other so that as I iterate thru the data, I can check for the existence of a key, and if it exists, get the key and add to it.
    Does anyone know a good way to do this? Code samples would be appreciated!!!
    Thank you!

    Hi Jason,
    I guess you wouldn't want to use Swing components or JTree unless your app has some GUI and even then you would want to look for some other structure than say JTree to represent your data.
    You have got plenty options one is that of using nested HashMaps. You could just as well use nested Lists or Arrays or custom objects that represent your data structure.
    I don't know why you should exclude XML. There is the question anyway how you get your data in your application. Is a database the source or a text file? Why not use XML since your data seems to have a tree structure anyway and XML seems to fit the bill.
    An issue to consider in that case is the amount of data. Large XML files have performance problems associated with them.
    In terms of a nice design I would probably do something like this (assuming the structure of your data is fixed):
    public class Leagues {
        private List leagues = new ArrayList();
        public FootballLeague getLeagueByIndex(int index) {
            return (FootballLeague)leagues.get(index);
        public FootballLeague getLeagueByName(String name) {
            // code that runs through the league list picking out the league with the given name
        public void addLeague(FootballLeague l) {
            leagues.add( l );
    }Next you define a class called FootballLeague:
    public class FootballLeague {
        private List teams = new ArrayList();
        private String leagueName;
        public FootballTeam getTeamByIndex(int index) {
            return (FootballTeam)teams.get( index );
        public FootballTeam getTeamByName(String name) {
            // code that runs through the team list picking out the team with the given name
        public void addTeam(FootballTeam t) {
            teams.add( t );
        public void setTeamName(String newName) {
            this.name = newName;
        public String getTeamName() {
            return this.name;
    }Obviously you will continue defining classes for Players next following that pattern. I usually apply that kind of structure for complex hierarchical data. Nested lists would be just as fine, but dealing with nested lists rather than a simple API for you data structures can be a pain (especially if you have many levels in your hierarchy);
    Hope that helps.
    The Dude

  • Hierarchical Data Loading: XSD design for Native data

    We are working on native data received in the form of flat file (attaching a few lines below)
    FWDREF VXA04_X001_GC
    FWDREF VXA04_X010_GC
    FWDREF VXA04_X050_GC
    FWDREF VXA04_X051_GC
    FWDREF VXA04_X075_GC
    FWDREF VXA04_X100_GC
    FWDREF VXA04_X101_GC
    FWDREF VXA04_X150_GC
    SECTIDAVXBOSY SHELL AND PANELS
    SECTIDAGBBOSY SHELL AND PANELS
    SECTIDABKº¾À¿ÃÁ ½° º°À¾ÁµÀ¸Ï° ¸ ¿°½µ»¸
    SECTIDACZDKELET KAROSERIE A PANELY
    ILLREFBA1 A05_A1_B
    ILLREFBA1-1 A05_A1-1_B
    ILLREFBA1-2 A05_A1-2_B
    FWDREF VXB04_X101_GC
    FWDREF VXB04_X150_GC
    SECTIDBVXBOSY SHELL AND PANELS
    SECTIDBGBBOSY SHELL AND PANELS
    SECTIDACZDKELET KAROSERIE A PANELY
    ILLREFBA1 B05_A1_B
    ILLREFBA1-1 B05_A1-1_B
    This data is hierarchical.
    -FWDREF
    --SECTID
    ---ILLREF
    The challenge is that the number of occurrences of parent and child are not fixed and they might not occur at all
    for eg there might be a set of rows like this (in the example below, there is no SECTID)
    FWDREF VXB04_X150_GC
    ILLREFBA1 B05_A1_B
    How can the schema be designed in this case?
    Thanks in advance

    @rp0428
    Thanks for taking out the time to reply to this. If we talk in terms of a tree structure, in the normal scenario we would the hierarchy as described before.
    -FWDREF
    --SECTID
    ---ILLREF
    If we don't talk in terms of xml and xsd and just talk in terms of database and keys, FWDREF would be parent, SECTID would be child and ILLREF would be grandchild. Now, in case, SECTID does not appear, we would still want a key to be generated but have a default value corresponding to it so that the parent, child and grandchild relationship is mentioned.
    The whole purpose of this XSD design is to use it in ODI where this feed file will be automatically loaded into tables from the XML generated with the parent, child and grandchild relationship maintained.
    Also, I have taken a sample data set. In the actual case, the hierarchy goes upto a maximum of 20 levels.
    Thanks to everyone and anyone who takes out time for this!

  • Hierarchical data maintainance

    Hello,
    I have a table (Parent - Child).
    There is a requirement to maintain this table, thats the hierarchy of the oraganisation.
    So, every quater they will be updating the table.
    They will be importing the data through an excel and in that excel there are 3 action items,
    => Insert, Update and Delete (logical delete).
    CREATE TABLE PARENT_CHILD_TBL
       ( "ID" VARCHAR2(6 BYTE) NOT NULL ENABLE,
    "ID_DESC" VARCHAR2(200 BYTE),
    "ID_LEVEL" VARCHAR2(200 BYTE),
    "PARENT_ID" VARCHAR2(200 BYTE)
    For Update:
    Any ideas, What all validation can come for an updation of an hierarchical data in general.
    Like
    = how to derive the level value at database side when the id is updated to some other level.
    = How to maintain the relation.
    A -> B -> D ( A is the grand parent here).
    A -> C
    eg: if B is updated as parent node of A, then we should throw error (cyclic data).
    Any more validations for hierarchical data, anybody can suggest and the way to go for it will be helpful.
    Thanks !!

    Hi,
    You can use the LEVEL psudo-column in a CONNECT BY query:
    SELECT  p.*
    ,       LEVEL
    ,       CASE
                WHEN  TO_CHAR (LEVEL, 'TM') = id_level
                THEN  'OK'
                ELSE  ' *** BAD ***'
    END     AS flag
    FROM    parent_child_tbl  p
    START WITH  parent_id  = '0000'
    CONNECT BY  parent_id  = PRIOR id
    Output from the sample data you posted (where all the level_ids are correct):
                              PARENT
    ID    ID_DESC    ID_LEVEL _ID            LEVEL FLAG
    A     ROOT       1        0000               1 OK
    B     CHILD1     2        A                  2 OK
    D     SUB CHILD1 3        B                  3 OK
    C     CHILD2     2        A                  2 OK
    If you only want to see the rows where id_level is wrong, then you can use LEVEL in a WHERE clause.
    Maybe you shouldn't bother manually entering id_level at all, and just have a MERGE statement populate that column after all the other data is entered.
    Why is the id_level column defined as a VARCHAR2, rather than a NUMBER?
    Given that it must be a VARCHAR2, why does it need to be 200 bytles long?

  • Hierarchical DATA?

    I KNOW WHAT IS hierarchical DATA
    IN WHICH THE A RECORD HAVE A CHILD AND PARENT RELATION SHIP.
    IN WHICH A RECORD SHOULD HAVE ONLY ONE PARENT DATA.
    IS THIS RIGHT ANSWER??????
    AND I CAN DISPLAY EMP TABLE RECORDS IN hierarchical MODEL
    BUT THESE TABLES WILL HAVE THE EXACT MODEL OF hierarchical????????????
    IF A TABLE HAVE ONLY hierarchical DATA HOW CAN I RETRIVE THAT DATA???????

    I KNOW WHAT IS hierarchical DATA
    IN WHICH THE A RECORD HAVE A CHILD AND PARENT RELATION SHIP.
    IN WHICH A RECORD SHOULD HAVE ONLY ONE PARENT DATA.
    Not Necessary...there can be many to many relationships also
    IS THIS RIGHT ANSWER??????
    AND I CAN DISPLAY EMP TABLE RECORDS IN hierarchical MODEL
    BUT THESE TABLES WILL HAVE THE EXACT MODEL OF hierarchical????????????
    What do you mean by "exact model of hierarchy". Plz ask questions clearly...
    IF A TABLE HAVE ONLY hierarchical DATA HOW CAN I RETRIVE THAT DATA???????
    If i understood your point, then I think you want to ask that if in a table, 2 columns are sharing dependency. Eg: empid and manager_id relationship in employee table. In this case also, we can retrive the data using connect by
    select level, manager_id,empid
    from employees
    start with manager_id=null
    connect by prior employee_id = manager_id
    I hope this clarifies to you

  • How to read a file with data in Hierarchical Structure using XSD Schema

    Hi
    We have requirement in which we have to read a FIXED LENGTH file with FILE ADAPTER. File contains the data in hierarchical structure. Hierarchy in the file is identified by the first 3 characters of every line which could be any of these : 000,001,002,003 and 004. Rest files are followed after these. So structure is like:
    000 -- Header of File. Will come only once in file. Length of this line is 43 characters
    -- 001 -- Sub Header. Child for 000. Can repeat in file. Length of this line is 51 characters
    --- 002 -- Detail record. Child for 001. Can repeat multiple times in given 001. Length of this line is 43 characters 1353
    -- 003 -- Sub Footer record at same level of 001. Will always come once with 001 record. Child for 000. Length of this line is 48 characters
    004 -- Footer of file.At same level of 000. Will come only once in file. Length of this line is 48 characters
    Requirement is to create an XSD which should validate this Hierarchical Structure also i.e data should come in this hierarchy only else raise an error while parsing the file.
    Now while configuring the FILE ADAPTER to read this file we are using Native Schema UI to create the XSD to parse this structure using an example data file. But we are not able to create a valid XSD for this file which should validate the Hierarchy also on the file.
    Pls provide any pointers or solution for this.
    Link to download the file, file structure details and XSD that we have created:
    https://docs.google.com/file/d/0B9mCtbxc3m-oUmZuSWRlUTBIcUE/edit?usp=sharing
    Thanks
    Amit Rattan
    Edited by: user11207269 on May 28, 2013 10:16 PM
    Edited by: user11207269 on May 28, 2013 10:31 PM
    Edited by: user11207269 on May 28, 2013 10:33 PM

    Heloo.. Can anyone help me on this. I need to do Hierarchial read / validation while reading the file using File Adapter using Native XSD schema.

  • How to  fetch the relational  data from the xml file registered in xdb

    Hi,
    I have to register the xml file into the  xdb repository and i have to fetch the data of the xml file as relational structure  through the select statement .
    i used the below query to register the xml file in xdb.
    DECLARE
    v_return BOOLEAN;
    BEGIN
    v_return := DBMS_XDB.CREATERESOURCE(
    abspath => '/public/demo/xml/db_objects.xml',
    data => BFILENAME('XML_DIR', 'db_objects.xml')
    COMMIT;
    END;
    Now i have to fetch the values in the xml file as relational data .
    whether it is possible ?
    can any one help me.
    Regards,
    suresh.

    When you transform your XMLdata to a xmltype you can do something like this for example:
    select
    extractvalue(value(p),'/XMLRecord/Session_Id') session_id,
    extractvalue(value(p),'/XMLRecord/StatementId') StatementId,
    extractvalue(value(p),'/XMLRecord/EntryId') EntryId
    from
    table(xmlsequence(extract(xmltype('
    <XMLdemo>
    <FormatModifiers><FormatModifier>UTFEncoding</FormatModifier></FormatModifiers>
    <XMLRecord>
    <Session_Id>117715</Session_Id>
    <StatementId>6</StatementId>
    <EntryId>1</EntryId>
    </XMLRecord>
    </XMLdemo>
    '),'/XMLdemo/*'))) p
    where extractvalue(value(p),'/XMLRecord/Session_Id') is not null;
    For this sample I've put a readable XML in plain text and convert it to xmltype so you can run it on your own database.

  • Wanna learn to implement hierarchical data structure

    I want to learn the method of handling hierarchical data in Java
    For instance if there is some kind of data which contains 6 main nodes then every node contains 2 sub nodes and there are 4 nodes under the 3rd node where as the 5th one contains two more subnodes one under another.
    So how will that be implemented?
    Ofcourse it must be possible to implement it but how can I do the same if I do not know the depth and number of nodes and will get it during the runtime?
    I had attempted to do create some thing of this kind using Turbo C++ 3.5 but after two weeks of intensive programming I was left utterly confused with innumerable pointers and pointer to pointers and pointer to a pointer to a pointers and more. At last it was me who forgot which pointer was pointing to what.

    Well, just start by making a Node class. To allow Nodes to have children, make each Node have an array (or arraylist, vector, etc.) of other Nodes.
    for example:
    class Node{
      private ArrayList<Node> children;
    }Put whatever else you need in there.
    You can then traverse these through methods you write, to return child nodes. If you need the Nodes to have knowledge of their parents, add a Node parent; variable in your Node class.
    Essentially, keep things as simple as possible, and this will allow you to write cleaner code and also decide on the depth of the structure at runtime, like you describe.

  • What is hierarchical data transfer in functional location

    hai,
    i want to know indetail about hierarchical data transfer and horizontal data transfer in functional location.
    can any one help me in this regard....
    plz give information with some example if you dont mind...
    thanks in advance
    regards
    gunnu.

    Hi
    From SAP HELP
    Hierarchical Data Transfer
    Definition
    You can maintain data at a high level within a hierarchical object structure. The system will automatically transfer the data changes to the levels below that are affected.
    The maintenance planner group is changed for the clarification plant described in Functional Location. The employee responsible for maintaining the master data makes the change to the master record of the highest functional location C1 and saves the changes. The system automatically makes the same change for all affected functional locations below the functional location C1, and issues a message to inform the employee of these changes.
    Horizontal Data Transfer
    Definition
    With horizontal data transfer you can differentiate between:
    Data transfer from reference location to functional location
    Data transfer from functional location to installed piece of equipment
    The ABC indicator of the functional location C1-B02-1 "Ventilator" is to be changed for several clarification plants.
    The employee responsible for maintaining the master data makes the change in the master record of the reference functional location and saves the entries.
    The system automatically makes the same change for all affected functional locations that were assigned to this reference location and for the pieces of equipment that are installed at these locations. The system then issues a message informing the employee of the changes.
    Regards
    thyagarajan

  • How to load master data and hierarchies from R/3 systems

    HI all,
    how to load master data and hierarchies from R/3 systems.
    Please explain the steps.
    Thanks,
    cheta.

    HI,
    Its normally done following: Transferring the master datasources in RSA5 to RSA6 and then replicating the DS into BW and assignment of DS to Infosource and cretaion of Infopackage and load it into the master tables.
    Generally, the control parameters for data transfer from a source system are maintained in extractor
    customizing. In extractor customizing, you can access the corresponding source system in the source
    system tree of the SAP BW Administrator Workbench by using the context menu.
    To display or change the settings for data transfer at source system level, choose Business
    Information Warehouse &#8594; General Settings &#8594; Maintaining Control Parameters for Data Transfer.
    Note: The values for the data transfer are not hard limitations. It depends on the DataSource if these
    limits can be followed.
    In the SAP BW Scheduler, you can determine the control parameters for data transfer for individual
    DataSources. You can determine the size of the data packet, the number of parallel processes for
    data transfer and the frequency with which the status IDocs are sent, for every possible update
    method for a DataSource.
    To do so, choose Scheduler &#8594; DataSource &#8594; Default Settings for Data transfer.
    In this way you can, for example, update transaction data in larger data packets in the PSA. If you
    want to update master data in dialog mode, smaller packets ensure faster processing.
    Hope this info helps.
    Thanks,Ramoji.

  • How to model hierarchical data?

    I need a way to model hierarchical data. I have tried using an object so far, and it hasn't worked. Here is the code for the class I made: http://home.iprimus.com.au/deeps/StatsGroupClass.java. As you can see, there are 4 fields: 1 to store the name of the "group", 2 integer data fields, and 1 Vector field to store all descendants. Unfortunately, this this not seem to be working as the Vector get(int index) method returns an Object. This is the error I get:
    Test.java:23: cannot resolve symbol
    symbol  : method getGroupName  ()
    location: class java.lang.Object
          echo("Primary Structure with index 0: " + data.get(0).getGroupName());
                                                            ^
    1 error I figure I can't use the approach I have been using because of this.
    Can anyone help me out?

    Test.java:23: cannot resolve symbolsymbol  : method getGroupName  ()location: class java.lang.Object      echo("Primary Structure with index 0: " + data.get(0).getGroupName());                                                        ^1 errorYou need to cast the return value from get(0):
    ((YourFunkyClass)data.get(0)).getGroupName();Be aware that you're opening yourself up to the possibility of a runtime ClassCastException. You could consider using generics if you can guarantee that the data Vector will contain only instances of YouFunkyClass.
    Hope this helps

Maybe you are looking for

  • Excel cfcontent not working after 2003 upgrade

    Have a section of code that exports to excel using cfcontent tag: Worked fine for everyone, except now we started upgrading to excel/office 2003 and it no longer shows any data. Loads a blank spreadsheet everytime. Tried changing to: <cfcontent type=

  • Using Web.Show_Document

    When I use the web.show_document, I want to hide the toolbar, scrollbar, button bar on the browser. How can I do it?

  • Report document type in EHS

    Dear all, I am wondering what are the following differences and usage on the following document type (report): 1 - Report Template 2 - Report 3 - Ship-To Report 4 - Cover Sheet Template How is it being used in EHS. thanks,

  • Playing game in specific space

    Anyone know how to play a video game in a specific space on leopard? I want to be able to be online and toggle to a specific space and play my game.

  • Horror Stories about "Self Cracking" Screens

    Hi All!  I'm planning to upgrade from my Xperia P to a Z1 Compact. While reading up on the phone i came across so many posts about Cracking Screens of the Z series of phones including the Z1 Compact, which I was so interested in getting.  Durability