Traversing the ParseTree

The 'getParseTree()' method of ElementDecl returns the ROOT of the ParseTree, of type XMLNode.
How can I traverse the entire tree?
bcos this method is a part of ElementDecl and u cannot type cast XMLNode to ElementDecl (bcos ElementDecl extends XMLNode and making a new object will erase the old info about the Parse tree)
I am doing all this to detect the presence of an ASTERISK, PLUS for an ELEMENT!!!!
Can you please ask the implementors of the XML Java Parser about this issue?

Hi Srikanth
Check this post on the context serializer
Re: converting context-tree to xml?
You can conditionalize some aspects of this code like checking for the attribute name against a defined string to derive the value for that particular attribute
Regards
Pran

Similar Messages

  • Traversing the entire nodes of an xml document ?

    Hi,
    I want to traverse through the entire nodes of an if_ixml_document. which is the best way to do this?
    Please find the sample document.
    <text>
        <id>
             <guid auto="false">
                   432543254543
             </guid>
        </id>
         <title>
             <short_title italics="on">
                    <bold language = "german">
                         "Hello"
                   </bold>
            </short_title>
         </title>
    </text>
    In this document, i need to traverse through the nodes <text>, <id>, <guid> , <title>, <short_title>, <bold> etc.
    Thanks in advance
    Regards,
    Ishara

    Hi,
    there are lots of examples in SDN. Could you try, and revert back in case of specific issue?
    There are also examples in SAP library: [SAP Library: Parsing an XML document DOM-based|http://help.sap.com/saphelp_nw70/helpdata/en/86/8280d212d511d5991b00508b6b8b11/frameset.htm ], [SAP Library: Traversing the DOM tree|http://help.sap.com/saphelp_nw70/helpdata/en/86/8280de12d511d5991b00508b6b8b11/frameset.htm ], [SAP Library: Traversing the DOM tree with iterators|http://help.sap.com/saphelp_nw70/helpdata/en/86/8280e112d511d5991b00508b6b8b11/frameset.htm ], ...
    And there is demo program: BCCIIXMLT12
    Sandra

  • Traversing the Java Jar file

    Hi,
    This might sound like a weird question, but I need to traverse the Java Jar file and create respective Java objects into objects in some other language using reflection.
    Is it possible to find the path for the class files located in any jar file? Does Java supports traversing or reading and finding jar contents?
    Thanks

    I found a way to traverse the Jar, using java.util.zip, one can create a zip file for the given jar file and using ZipEntry it is possible to findout the properties associated with the jar/zip entries.

  • Traversing the context

    Hi,
    Looking for some information on traversing the view context.
    Using a different version of the same example in one of my previous posts
    NodeA
    NodeA1
    ********attribute1
    ********NodeA11
    *************attribute2
    The context structure described above is created at design time. I create and populate node elements from NodeA, at runtime.
    Need code to access value of 'attribute1', and the value of selected element of NodeA11. NodeA11 can have multiple attributes, that is added at runtime.
    Example of context at runtime is as follows
    CommonFields
    Field (node element)
    *******name (attribute)
    *******ValueSet (node element)
    3A (attribute)
    3B (..)
    3C (..)
    If you get any headache solving this question, I apoligise upfront.
    Thanks !

    Hi Srikanth
    Check this post on the context serializer
    Re: converting context-tree to xml?
    You can conditionalize some aspects of this code like checking for the attribute name against a defined string to derive the value for that particular attribute
    Regards
    Pran

  • How to count the number of calls that traversed the DB lookup node successfully

    Hi All,
    I need to obtain the number of calls that successfully traversed the DB  lookup node.
    Can you please let me know, what is the variable I need to add after the DB lookup node to capture the number of succesful calls.
    Kindly help.

    Hi Nirmala,
    I hope you are looking for how many calls passed the DBLookupnode in script.
    In DBLookup node you have a Right Branch and Wrong Branch.
    1) After the right branch, set an unused peripheral variable and store the Value "Success"
    2) For the wrong branch, set the same variable with the Value "Failure".
    You can execute a query against the HDS and have the numbers.
    Else you can setup a CallType as well before and after the node.
    Regards,
    Senthil

  • Traverse the children of an given element

    Give the element, I want to traverse the children of the element
    <?xml version = "1.0"?>
    <persons>
    <person>
         <name>Joe</name>
         <age>22</age>
         <dept>HR</dept>
    </person>
    </persons>
    Caller: traverseElementChildren("person");
    Here's my attempt, but it yield null pointer exception on node.getNodeValue();
    public static void traverseElementChildren(String nodeName)
         NodeList rootNode = doc.getElementsByTagName(nodeName);
         Element elem = (Element)rootNode.item(0);
         NodeList n = elem.getChildNodes();
         for (int i=0; i<n.getLength(); i++)
         {     Node node = rootNode.item(i);
              //Exception in thread "main" java.lang.NullPointerException
              System.out.println(node.getNodeValue());
    }

    OK, now I do the following but surprising return
    null
    null
    nullMaybe you should rebuild your JAVA file(s).
    And also verify that the parsed xml file is the one you have posted.
    With the following xml file:
    <?xml version = "1.0"?>
    <persons>
    <person>
    <name>Joe</name>
    <age>22</age>
    <dept>HR</dept>
    </person>
    </persons>
    The following statement:
            traverseElementChildren("person");With the following method:
        public static void traverseElementChildren(String nodeName)
            NodeList rootNode = doc.getElementsByTagName(nodeName);
            Element elem = (Element)rootNode.item(0);
            NodeList n = elem.getChildNodes();
            for (int i = 0; i < n.getLength(); i++)
                Node node = n.item(i);
                System.out.println(node.getNodeName());
        }Gives the following output at the console:
    #text
    name
    #text
    age
    #text
    dept
    #text
    So it IS working perfectly well. No starnge behaviour at all.
    Next time please paste your code between code tags exactly like this:
    &#91;code&#93;
    your code
    &#91;/code&#93;
    Thank you

  • TM froze while deep traversing the node?

    After several successful backups to time capsule, time machine writes
    Event store UUIDs don't match for volume: OSX
    Node requires deep traversal:/ reason:kFSEDBEventFlagMustScanSubDirs|kFSEDBEventFlagReasonEventDBUntrustable|
    in log and them seems to be sitting forever in "preparing backup" state.
    I've started backup at 8pm, now it's nearly 8am, and still no noticeable changes.
    I've tried to connect to TC via ethernet, but neither AirPort Utility, nor TM finds it in this case (I have all the global Bonjour announcing checkboxes set).
    The last problem, is that running TM backup makes OSX quite unresponsive. Programs like iPulse (generic system monitoring) and Quicksilver just float without updating their GUI. So it's hard to continue working, while TM is re-indexing all the HDD.

    Farcaller,
    Welcome to the Apple discussions!
    *_Time Machine May Report "Preparing..." For a Long Time_*
    Consider these factors regarding an extended period of "Preparing...". Consider each topic separately and do not attempt to act on all of them at once.
    *Recent Crash or Other Major System Event* (Deep Traversal)
    The reasons for this process are described in an article by George Schreyer. “During the preparation step it checks the FSEvents log for consistency. If it determines that something isn't quite right it has to rescan the whole disk. This can take quite awhile. A full rescan is always triggered by a crash, an unplanned shut down event or by booting from some other bootable disk between backups…. After a crash, Time Machine must scan the whole disk to determine what it has to do because it cannot trust the information that it left behind. Connected via an Ethernet connection, this phase would typically take 20 minutes on an older PowerBook. Being connected wirelessly stretches this phase out to over 3 hours.” [http://www.girr.org/mac_stuff/backups.html]
    According to the following KB article it can sometimes take a very long time if Time Machine begins this “deep traversal” and has to compare data inventories. This may apply to your situation, particularly if many Gigs of data are involved. (http://support.apple.com/kb/TS1516)
    *Anti-Virus Software*
    Running anti-virus software can interfere with the backup process. Either disable it altogether, or try the suggestion outlined here, “If you use third-party anti-virus scanning software and have issues, make sure your Time Machine back up folder (Backups.backupdb on the Time Machine disk) is excluded from virus scanning.” (http://support.apple.com/kb/TS1516)
    *Software Updates* #
    Installing new software, upgrading existing software, or updating Mac OS X system software can create major changes in the structure of your Macs directories. Time Machine will backup every file that has changed since the installation.
    If you take a look at the Console logs Time Machine may be reporting that your backups need "deep traversal". That's fine. Time Machine knows what is wrong and how to fix it. If you have a great deal of data, it may take quite awhile.
    After an OS update (like 10.5.5) Time Machine realizes the system no longer matches what it looked like during the previous backup. So it has determined that it's earlier catalogue of what-should-be-where is 'untrustable'. So it is going to go item-by-item comparing the before and after of your system. If you have just performed an OS Update then Time Machine knows what it's doing - let it do it!
    *Spotlight Keeps Indexing Backup Drive* #
    It may be that Time Machine can’t proceed or complete a backup due to a Spotlight indexing error. During this period, take a look at the Spotlight icon in the upper right corner of your screen. Is there a tiny dot pulsating in the center of the spyglass? Click on the icon. Is there a progress bar displayed? Generally Spotlight indexing is a good thing. But at time it may hang and never progress, preventing backups from taking place.
    Go to System Prefs --> Spotlight --> Privacy Tab.
    Drag your Time Machine disk into the window. It should now be among the items to exclude from indexing.
    Now quit System Prefs.
    Reopen System Prefs and remove ("-") the Time Machine disk from the window.
    This should clear out Spotlights cache. Naturally, Spotlight should begin indexing again (maybe even for a few hours depending on how much data there is), but it should eventually stop.
    *Reboot Time Capsule* #
    Stop the backup from the Time Machine menu.
    When the Time Machine icon stops spinning, unplug the TC from the wall outlet.
    Wait 10-15 seconds.
    Re-plug it in again.
    After it has restarted (30-60 seconds), attempt another backup.
    Time Machine will report “Preparing…” again, but it shouldn’t be lasting more than a couple of hours.
    Let us know if any of the suggestions above helped in your case.
    Cheers!

  • Crystal Report Formula for traversing the Hierarchy

    Hi Friends,
    I have a Hierarchy Node Variable in Query Designer and I use the same in my Crystal Report.
    I need to create a formula, which will traverse and find all of the child nodes of the selected Hierarchy Node (through the variable). Could you please let me know if this is possible and send me the code.
    Thanks in Advance!
    Regards,
    Vinaya Paulraj.

    Hi Vinaya
    In Crystal, under the 'Report' menu, there is an item called ''Hierarchical Grouping Options'. This item allows you to sort information based on the relationship between two fields.
    For example:
    The following example is based on using the sample database called Xtreme that ships with Crystal Reports and Xtreme's Employee table.
    There is an {Employee ID} field and {Reports to} field in the Employee table. These fields both contain an Employee ID number. There can be employees with employees that report to them. In other words, there can be employees that report to a higher level of management. You want to see the overall hierarchy of the employees. To do so, you would use the 'Hierarchical Grouping Option' in Crystal Reports.
    To view the employee hierarchy from the Employee table, complete the following:
    1. Create a group and group on {Employee ID}. You want to group on {Employee ID} because you want to see the overall hierarchy of employees.
    · From the 'Insert' menu, select 'Group'.
    · From the 'Insert Group' dialog box, select {Employee.Employee ID} in the first drop-down list.
    · Click 'OK'.
    2. Create a hierarchical group.
    · From the 'Report' menu, select 'Hierarchical Grouping Options'.
    · Select 'Sort Data Hierarchically'.
    · Select {Reports to} from the drop-down list for 'Parent ID'. In this example, the {Reports to} field is the parent field; therefore, we must select it in the 'Parent ID' field.
    3. Indenting the hierarchical group, you must enter a value between 0 and 4 inches.
    The 'Group Indent' setting only affects the display of the report. If you enter a value other than zero (0) the various levels of hierarchy will appear indented when the report is previewed. Thus making it easier to see the various groups of employees, managers, etc.
    For more information, search the online help for 'Grouping data hierarchically'.
    Regards
    Girish

  • How to traverse the XML tree.

    hi ,
    i would like to know if there is a sample code snippet
    showing how to walk through the Document object tree
    generated by the DOM parser for a given XML input.
    Thanks.
    Sandeep.
    null

    sandeep (guest) wrote:
    : hi,
    : can you please tell as to where is the selectNodes() method
    : defined. I could not locate it.
    : Thanks.
    : Sandeep.
    : Oracle XML Team wrote:
    : : Sandeep (guest) wrote:
    : : : hi ,
    : : : i would like to know if there is a sample code snippet
    : : : showing how to walk through the Document object tree
    : : : generated by the DOM parser for a given XML input.
    : : : Thanks.
    : : : Sandeep.
    : : Take a look at the selectNodes() method. It takes XPath
    syntax
    : : to navigate through the XML document.
    : : Oracle XML Team
    : : http://technet.oracle.com
    : : Oracle Technology Network
    selectNodes() is part of oracle.xml.parser.v2.XMLNode. You can
    find any method by opening AllNames.html in the doc directory.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • How to traverse the tree in reverse direction?

    How do I roll up numbers up a tree? Suppose I have the following tree (diagram #1). Each node is designated with an ID number,
    representing a primay key in a table. Only leaf nodes have a number (preceded by the @ sign) associated with it (see
    diagram #1). How do I write an efficient SQL that will add up numbers from the leaf nodes and roll up the numbers
    up the entire tree all the way to the root node so the final tree looks like that depicted in diagram #2?
    Diagram #1
                                (1)
                                 |
                                 |
                       |         |            |
                       |         |            |
                      (2)       (3)          (4)@10
                       |          |
                       |           |
                  -------           |
                  |     |           |
                  |     |             |
                 (5)   (6)@20   (7)(@null)
                  |
                  |
                 (8)@30
    Diagram #2
                                (1)@60
                                 |
                                 |
                       |         |            |
                       |         |            |
                      (2)@50    (3)@0        (4)@10
                       |         |(if null)
                       |             |
               ----------             |
               |        |              |
               |        |               |
              (5)@30   (6)@20   (7)(@null)
               |
               |
              (8)@30DB version is 10.2 and OS is Windows server 2008
    create table ad_treenode
    (ad_client_id number(10),
    ad_org_id number(10),
    node_id number(10), --PK
    parent_id number(10)
    INSERT INTO ad_treenode VALUES (11,11,709,704);
    INSERT INTO ad_treenode VALUES (11,11,710,709);
    INSERT INTO ad_treenode VALUES (1000000,0,1000001,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000002,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000003,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000004,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000005,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000006,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000070,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000071,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000072,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000073,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000074,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000075,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000076,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000077,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000078,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000079,0);
    INSERT INTO ad_treenode VALUES (1000000,0,1000080,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000081,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000082,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000083,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000084,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000085,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000086,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000087,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000088,1000070);
    INSERT INTO ad_treenode VALUES (1000000,0,1000089,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000090,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000091,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000092,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000093,1000076);
    INSERT INTO ad_treenode VALUES (1000000,0,1000094,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000095,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000096,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000097,1000071);
    INSERT INTO ad_treenode VALUES (1000000,0,1000098,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000099,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000100,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000101,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000102,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000103,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000104,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000105,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000106,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000107,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000108,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000109,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000110,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000111,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000112,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000113,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000114,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000115,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000116,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000117,1000075);
    INSERT INTO ad_treenode VALUES (1000000,0,1000118,1000072);
    INSERT INTO ad_treenode VALUES (1000000,0,1000119,1000072);
    INSERT INTO ad_treenode VALUES (1000000,0,1000120,1000077);
    INSERT INTO ad_treenode VALUES (1000000,0,1000000,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000001,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000002,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000003,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000004,1000372);
    INSERT INTO ad_treenode VALUES (1000000,0,1000005,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000006,1000141);
    INSERT INTO ad_treenode VALUES (1000000,0,1000007,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000008,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000009,1000168);
    INSERT INTO ad_treenode VALUES (1000000,0,1000010,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000011,1000168);
    INSERT INTO ad_treenode VALUES (1000000,0,1000012,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000013,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000014,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000015,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000016,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000017,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000018,1000092);
    INSERT INTO ad_treenode VALUES (1000000,0,1000019,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000020,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000021,1000141);
    INSERT INTO ad_treenode VALUES (1000000,0,1000022,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000023,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000024,1000092);
    INSERT INTO ad_treenode VALUES (1000000,0,1000025,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000026,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000027,1000077);
    INSERT INTO ad_treenode VALUES (1000000,0,1000028,1000116);
    INSERT INTO ad_treenode VALUES (1000000,0,1000029,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000030,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000031,1000139);
    INSERT INTO ad_treenode VALUES (1000000,0,1000032,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000033,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000034,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000035,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000036,1000093);
    INSERT INTO ad_treenode VALUES (1000000,0,1000037,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000038,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000039,1000192);
    INSERT INTO ad_treenode VALUES (1000000,0,1000040,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000041,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000042,1000192);
    INSERT INTO ad_treenode VALUES (1000000,0,1000043,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000044,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000045,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000046,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000047,1000083);
    INSERT INTO ad_treenode VALUES (1000000,0,1000048,1000139);
    INSERT INTO ad_treenode VALUES (1000000,0,1000049,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000050,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000051,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000052,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000053,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000054,1000091);
    INSERT INTO ad_treenode VALUES (1000000,0,1000055,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000056,1000116);
    INSERT INTO ad_treenode VALUES (1000000,0,1000057,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000058,1000079);
    INSERT INTO ad_treenode VALUES (1000000,0,1000059,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000060,1000106);
    INSERT INTO ad_treenode VALUES (1000000,0,1000061,1000083);
    INSERT INTO ad_treenode VALUES (1000000,0,1000062,1000076);
    INSERT INTO ad_treenode VALUES (1000000,0,1000063,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000064,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000065,1000117);
    INSERT INTO ad_treenode VALUES (1000000,0,1000066,1000120);
    INSERT INTO ad_treenode VALUES (1000000,0,1000067,1000112);
    INSERT INTO ad_treenode VALUES (1000000,0,1000068,1000108);
    INSERT INTO ad_treenode VALUES (1000000,0,1000069,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000121,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000122,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000123,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000124,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000125,1000080);
    INSERT INTO ad_treenode VALUES (1000000,0,1000126,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000127,1000380);
    INSERT INTO ad_treenode VALUES (1000000,0,1000128,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000129,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000130,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000131,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000132,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000133,1000128);
    INSERT INTO ad_treenode VALUES (1000000,0,1000134,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000135,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000136,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000137,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000138,1000135);
    INSERT INTO ad_treenode VALUES (1000000,0,1000139,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000141,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000142,1000081);
    INSERT INTO ad_treenode VALUES (1000000,0,1000143,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000144,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000145,1000082);
    INSERT INTO ad_treenode VALUES (1000000,0,1000146,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000147,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000148,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000149,1000150);
    INSERT INTO ad_treenode VALUES (1000000,0,1000150,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000151,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000152,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000153,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000154,1000151);
    INSERT INTO ad_treenode VALUES (1000000,0,1000155,1000084);
    INSERT INTO ad_treenode VALUES (1000000,0,1000156,1000155);
    INSERT INTO ad_treenode VALUES (1000000,0,1000157,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000158,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000159,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000160,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000161,1000085);
    INSERT INTO ad_treenode VALUES (1000000,0,1000162,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000163,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000164,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000165,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000166,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000167,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000168,1000086);
    INSERT INTO ad_treenode VALUES (1000000,0,1000169,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000170,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000171,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000172,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000173,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000174,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000175,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000176,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000177,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000178,1000087);
    INSERT INTO ad_treenode VALUES (1000000,0,1000179,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000180,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000181,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000182,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000183,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000184,1000179);
    INSERT INTO ad_treenode VALUES (1000000,0,1000185,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000186,1000088);
    INSERT INTO ad_treenode VALUES (1000000,0,1000187,1000229);
    INSERT INTO ad_treenode VALUES (1000000,0,1000188,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000189,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000190,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000191,1000230);
    INSERT INTO ad_treenode VALUES (1000000,0,1000192,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000193,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000194,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000195,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000196,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000197,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000198,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000199,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000201,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000202,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000203,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000204,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000205,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000207,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000208,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000209,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000210,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000211,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000212,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000213,1000096);
    INSERT INTO ad_treenode VALUES (1000000,0,1000214,1000096);
    INSERT INTO ad_treenode VALUES (1000000,0,1000215,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000216,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000217,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000218,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000219,1000097);
    INSERT INTO ad_treenode VALUES (1000000,0,1000220,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000221,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000222,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000223,1000118);
    INSERT INTO ad_treenode VALUES (1000000,0,1000225,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000226,1000119);
    INSERT INTO ad_treenode VALUES (1000000,0,1000229,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000230,1000094);
    INSERT INTO ad_treenode VALUES (1000000,0,1000231,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000232,1000095);
    INSERT INTO ad_treenode VALUES (1000000,0,1000233,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000234,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000235,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000236,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000237,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000238,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000239,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000240,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000241,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000242,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000243,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000244,1000121);
    INSERT INTO ad_treenode VALUES (1000000,0,1000245,1000073);
    INSERT INTO ad_treenode VALUES (1000000,0,1000247,1000122);
    INSERT INTO ad_treenode VALUES (1000000,0,1000248,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000249,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000250,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000251,1000089);
    INSERT INTO ad_treenode VALUES (1000000,0,1000252,1000089);
    INSERT INTO ad_treenode VALUES (1000000,0,1000253,1000090);
    INSERT INTO ad_treenode VALUES (1000000,0,1000254,1000074);
    INSERT INTO ad_treenode VALUES (1000000,0,1000255,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000256,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000257,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000258,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000259,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000260,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000261,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000262,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000263,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000264,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000265,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000266,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000267,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000268,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000269,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000270,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000271,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000272,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000273,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000274,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000275,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000276,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000277,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000278,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000279,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000280,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000281,1000098);
    INSERT INTO ad_treenode VALUES (1000000,0,1000282,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000283,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000284,1000099);
    INSERT INTO ad_treenode VALUES (1000000,0,1000285,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000286,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000287,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000288,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000289,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000290,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000291,1000100);
    INSERT INTO ad_treenode VALUES (1000000,0,1000292,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000293,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000294,1000101);
    INSERT INTO ad_treenode VALUES (1000000,0,1000295,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000296,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000297,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000298,1000102);
    INSERT INTO ad_treenode VALUES (1000000,0,1000299,1000103);
    INSERT INTO ad_treenode VALUES (1000000,0,1000300,1000103);
    INSERT INTO ad_treenode VALUES (1000000,0,1000301,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000302,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000303,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000304,1000104);
    INSERT INTO ad_treenode VALUES (1000000,0,1000305,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000306,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000307,1000105);
    INSERT INTO ad_treenode VALUES (1000000,0,1000308,1000105);
    create table c_elementvalue
    (ad_client_id number(10),
    ad_org_id number(10),
    c_elementvalue_id number(10), --PK     and   ad_treenode.node_id = c_elementvalue.c_elementvalue_id
    name varchar(100)
    INSERT INTO c_elementvalue VALUES (1000000,0,1000070, 'Assets');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000073, 'Sales');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000074, 'Cost of Goods Sold');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000075, 'Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000076, 'Other Income');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000077, 'Other Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000078, 'Costing');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000079, 'Commitment Accounting');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000080, 'Cash');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000081, 'Account Receivable');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000082, 'Investments');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000083, 'Inventory');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000085, 'Land And Building');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000087, 'Accumulated Depriciation');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000088, 'Other Assets');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000089, 'Returns');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000090, 'Inventry CoGs');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000091, 'CoGs Variances');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000092, 'CoGs Discounts');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000093, 'Currency gain');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000094, 'Account Payables');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000095, 'Accrued Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000096, 'Current Note Payables');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000097, 'Long Term liabilities');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000098, 'Payroll Expenses');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000099, 'Occupancy Cost');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000384, 'Late Fee Charge Revenue');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000385, 'Cash Transfer to Tower');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000386, 'Cash Transfer From B.Ed College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000387, 'Cash Transfer from BHM College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000388, 'Cash Transfer from Engg College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000389, 'Cash Transfer from MBA College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000390, 'Cash Transfer from Polytechnic College');
    INSERT INTO c_elementvalue VALUES (1000000,0,1000391, 'Cash Transfer from School');
    create table t_trialbalance
    (ad_client_id number(10),
    ad_org_id number(10),
    account_id number(10), --PK   and   t_trialbalance.account_id = t_trialbalance.t_trialbalance_id   or   ad_tree.node_id  =   t_trialbalance.account_id
    amtsourcecr number(10),
    amtsourcedr number(10)
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 21000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 21000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 15900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 15200);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 10500);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 18500);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 40400);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 100500 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000012, 34550 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 34550);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 20000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 20000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 20000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 20000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000012, 6400 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 6400);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 39695);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 39695 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 1160);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 1160 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 580);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 48);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000008, 628 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 23.34);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000023, 1000 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 0 , 1000);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 63650);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 63650 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 63650);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 63650 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 35795);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 35795 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000017, 0 , 51900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 51900 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 51900);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 51900 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000051, 0 , 35795);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000029, 35795 , 0);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 13700);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 8120);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 13700);
    INSERT INTO t_trialbalance VALUES (1000000,1000002,1000061, 0 , 36200);
    I had two sql's but not upto mark
    SELECT LPAD(' ', 2*level-1)||SYS_CONNECT_BY_PATH(node_id, '/') "Path"
          FROM ad_treenode
          START WITH parent_id = 0
          CONNECT BY PRIOR node_id = parent_id;
    select ad_client_id, ad_org_id, rpad('*',2*level,'*') || node_id , parent_id,
             (select sum(amtsourcecr)
                    from t_trialbalance t2
                       start with t2.account_id = t1.node_id
                       connect by prior node_id = parent_id) amtsourcecr,
             (select name from c_elementvalue where c_elementvalue_id=t1.node_id) name
    from ad_treenode t1
    start with parent_id = 0
    connect by prior node_id = parent_id;The o/p i want according to diagram-2 is
    node_id    node_name(from c_elementvalue)      amtsourcecr(from t_trialbalance)
    1                     aaa                                            60
    2                     bbb                                            50
    3                     ccc                                               0
    4                     ddd                                            10
    5                     eee                                            30
    6                     fff                                               20
    7                     ggg                                             null
    8                      hhh                                            30Edited by: Navneet Singh on Mar 6, 2012 4:02 PM
    Edited by: Navneet Singh on Mar 6, 2012 4:03 PM

    I tried according the upper suggestions. The below query is too slow that i made. It takes 10 minutes to fetch the result. I think the data is too much thats y. Is there any other method that it can fetches out the result with in 1-2 minutes.
    SELECT     e.ad_client_id, e.ad_org_id,
                  LPAD (' ', LEVEL * 2) || e.NAME AS NAME, e.node_id, e.parent_id,
                  amtcr,
                  NVL ((SELECT     SUM (amtcr)
                              FROM (SELECT   a.ad_client_id, a.ad_org_id,
                                             a.node_id, a.parent_id,
                                             SUM (b.amtsourcecr) AS amtcr,
                                             SUM (b.amtsourcedr) AS amtdr, c.NAME,
                                             b.c_acctschema_id, b.c_period_id,
                                             b.dateacct, b.account_id,
                                             b.accountvalue, b.postingtype,
                                             b.ad_pinstance_id
                                        FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                                             ON b.account_id = a.node_id
                                             LEFT OUTER JOIN c_elementvalue c
                                             ON c.c_elementvalue_id = a.node_id
                                    GROUP BY a.ad_client_id,
                                             a.ad_org_id,
                                             a.node_id,
                                             a.parent_id,
                                             NAME,
                                             b.c_acctschema_id,
                                             b.c_period_id,
                                             b.dateacct,
                                             b.account_id,
                                             b.accountvalue,
                                             b.postingtype,
                                             b.ad_pinstance_id) e2
                              WHERE e2.ad_pinstance_id = e.ad_pinstance_id
                               AND e2.dateacct = e.dateacct
                               AND e2.postingtype = e.postingtype
                               AND e2.c_acctschema_id = e.c_acctschema_id
                               AND e2.ad_org_id = e.ad_org_id
                               AND e2.ad_client_id = e.ad_client_id
                        START WITH e2.node_id = e.node_id
                        CONNECT BY e2.parent_id = PRIOR e2.node_id),
                       0
                      ) amt_cr2,
                  amtdr,
                  NVL ((SELECT     SUM (amtdr)
                              FROM (SELECT   a.ad_client_id, a.ad_org_id,
                                             a.node_id, a.parent_id,
                                             SUM (b.amtsourcecr) AS amtcr,
                                             SUM (b.amtsourcedr) AS amtdr, c.NAME,
                                             b.c_acctschema_id, b.c_period_id,
                                             b.dateacct, b.account_id,
                                             b.accountvalue, b.postingtype,
                                             b.ad_pinstance_id
                                        FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                                             ON b.account_id = a.node_id
                                             LEFT OUTER JOIN c_elementvalue c
                                             ON c.c_elementvalue_id = a.node_id
                                    GROUP BY a.ad_client_id,
                                             a.ad_org_id,
                                             a.node_id,
                                             a.parent_id,
                                             NAME,
                                             b.c_acctschema_id,
                                             b.c_period_id,
                                             b.dateacct,
                                             b.account_id,
                                             b.accountvalue,
                                             b.postingtype,
                                             b.ad_pinstance_id) e2
                              WHERE e2.ad_pinstance_id = e.ad_pinstance_id
                               AND e2.dateacct = e.dateacct
                               AND e2.postingtype = e.postingtype
                               AND e2.c_acctschema_id = e.c_acctschema_id
                               AND e2.ad_org_id = e.ad_org_id
                               AND e2.ad_client_id = e.ad_client_id
                         START WITH e2.node_id = e.node_id
                        CONNECT BY e2.parent_id = PRIOR e2.node_id),
                       0
                      ) amt_dr2,
                  e.c_acctschema_id, e.c_period_id, e.dateacct, e.account_id,
                  e.accountvalue, e.postingtype, e.ad_pinstance_id
             FROM (SELECT   a.ad_client_id, b.ad_org_id, a.node_id, a.parent_id,
                            SUM (b.amtsourcecr) AS amtcr,
                            SUM (b.amtsourcedr) AS amtdr, c.NAME,
                            b.c_acctschema_id, b.c_period_id, b.dateacct,
                            b.account_id, b.accountvalue, b.postingtype,
                            b.ad_pinstance_id
                       FROM ad_treenode a LEFT OUTER JOIN t_trialbalance b
                            ON b.account_id = a.node_id
                            LEFT OUTER JOIN c_elementvalue c
                            ON c.c_elementvalue_id = a.node_id
                   GROUP BY a.ad_client_id,
                            b.ad_org_id,
                            a.node_id,
                            a.parent_id,
                            NAME,
                            b.c_acctschema_id,
                            b.c_period_id,
                            b.dateacct,
                            b.account_id,
                            b.accountvalue,
                            b.postingtype,
                            b.ad_pinstance_id) e
        where e.ad_org_id=1000002
       START WITH e.parent_id = 0
       CONNECT BY e.parent_id = PRIOR e.node_id
         ORDER SIBLINGS BY e.NAME;
    SQL> select count(*) from t_trialbalance;
      COUNT(*)
        108384
    SQL> select count(*) from ad_treenode;
      COUNT(*)
          1366
    SQL> select count(*) from c_elementvalue;
      COUNT(*)
           971Is there any way to get out this hangout?

  • How can traverse the  xpath attribute name having namespace?

    tell application "Adobe InDesign CS5"
        set Xpath to {"//*/ext-link[@xlink:href !='']"}
        set myXPath to {Xpath}
        set myRuleProcessor to make XML rule processor with properties {rule paths:Xpath}
        set myRootXMLElement to XML element 1 of active document
        tell myRuleProcessor
            set myMatchData to start processing rule set initial element myRootXMLElement
            repeat while myMatchData is not equal to nothing
                set myParentElement to get element of myMatchData
                select myParentElement
                set myMatchData to find next match
            end repeat
        end tell
    end tell
    -- error occur........

    Here's an idea. Have your error page (in the hidden frame), look something like this:
    <%
      String strErrorMessage = ... // get your error message text here
    %>
    <html>
    <head>
      <script language="JavaScript">
        parent.mainframe.location = "ErrorPage.jsp";
      </script>
    </head>
    </html>So the error page loads in the hidden frame, which then extracts the error information from the exception object. Then, using javascript, the hidden frame tells the main frame (using window references) to reload to the desired page. The only issue is how to get the error message text to the new page since your exception object is lost. You can store it as a session variable, and then pass the id of the message in the url to the new page, or you could just pass the text in the url itself.
    I hope that gives you some ideas!
    Michael

  • JavaCC - jjTree - Give the code a good structure..

    Hi...
    I am new to JJTree (but i knew a little bit JavaCC).
    I'd like to realize a parser for particular guarded FOL formulas.
    I need to write a recursive method that traverses the parsing tree and tells me if the formula is guarded.
    Since the logic is obviously different for any type of non-terminals, i think i need a specialized version of the method (we can call it "checkGuard") in any class belonging a non-terminal and then i can call something like:
    ASTStart parseTree = parser.Start();
    parseTree.checkGuard();I'd like to realize something that respects the Visitor design pattern, but i can't find some huge example about jjTree. I guess i need to set to true VISITOR and MULTI options..
    How can I structure my code?
    Someone can help me?
    Thanks..

    Instead pass a 2 dim array which holds an object at an index i,j and that ?object should know how to show itself. use style class to control this aspect.
    A 2D array would be no better than what i am using now. The same problem would occur if the query is changed to include another field or one less. Or the fields are switched around. Basically i'm thinking that structiure relies too heavily on the structure of the query and changing the query would require some important changes in the jsp
    (1) Load the ResultSet into a List of Value Objects that map to the particular query,
    (2) Load the ResultSet into a List of Maps, where each Map represents a row in the query result. The keys are the column names (from ResultSetMetaData), and the values are the column results from the query,
    (3) Load the ResultSet into a Map of Lists, where each List represents a column in the query result. The keys are the column names (from ResultSetMetaData), and the values are Lists of column results from the query,
    (4) Load the ResultSet into a CachedRowSet and use that.
    what is the prefered method, most common and easiest to use. What method do you use?
    You're using JSTL and no scriptlet code in your JSPs, right?
    yes i do use scriptlet code in my jsp. is there some problem with that?
    You mention using the ResultSet in a JSP. Is this to create a table? Does this table have to provide any functionality besides just displaying the data?
    Sometimes the results are for a table and yes it would be nice if the table could be sorted based on any field
    Do you have any experience creating custom tags? They are quite handy once you get use to them.
    I have absoluately no experience with custom tags

  • A tree-view in HTML page with nodes generated with java script in run time is not visible in the UI Automation Tree. Need Help

    I have a HTML page with an IFrame. Inside the Iframe there is a table with a tree view
    <iframe>
    <table>
    <tr>
    <td>
    <treeview id="tv1"></treeview>
    </td>
    </tr>
    </table>
    </iframe>
    In UIA, i am able to traverse till the tree view but not able to see it.
    I have used the TreeWalker.RawViewWalker Field to traverse the node from the desktop Automation.RootElement. 
    I tried to use AutomationElement.FromPoint method to check whether i am able to get that element. Fortunately i was able to get the automation element. 
    i tried to get the path to root element from the node element using the TreeWalker.RawViewWalker. I was able to get the parent path to the root element.
    But trying the reverse way like navigating from root element to tree node, was not getting the element for me. 
    Please help me with suggestions or inputs to resolve this issue. 

    Thanks Bernard,
    It works fine with JInitiator but not working with
    the JPI. For JPI what settings I need to do ??hi TKARIM and Bernard, i am having similar problem even with the Bernard's recommended setup. could you post the webutiljini.htm (i presume you are using config=test) ?
    i am actually using jinitiator 1.3.1.28 with Oracle HTTP Server of OAS 10gR2) calling Forms Server 6i (f60cgi). After setting up according to Bernard's recommended setup steps, the java console showed that it loaded the icon jar file when it could not read the form, but it skipped the loading of the icon jar file once it read and started the form. How do we specify in the form to pick up the icon from the jar file instead from a directory ? Or do we need to specify ? Any ideas ?
    Thx and Regards
    dkklau

  • How do I restrict the source trying to access a port?

    I have VoIP phones in my office and I am experiencing dozens of hacking attempts per day.  I received the following email from the company that I purchase service from:
    Hi ,
    Based on our research and experience with these type of calls, these are hacking attempts usually using a program called SIP Vicious or a variant. You can  check the link below about SIP Vicious.
    http://threatpost.com/hackers-pushing-sipvicious-voip-tools-malicious-attacks-08 3111/
    These attacks for the most part do not affect users behind our managed routers since we have security features in place to block them.
    The calls that the remote users are getting do not  traverse the Broadcorenetwork at all. Meaning even if the user put the phone on  DND or we try to block calls through the Web portal, calls will still go through because the call does not go through our Session Border Controller ( SBC ) .
    The call is directly hitting the IP of the remote users router (bypassing Broadcore completely) and scanning the ports for a SIP device which is the Polycom Phone. Once they get an answer back from the phone, the hacker  now has a target to attack. What they want to do is get the credentials for the user so they can authenticate a soft phone for example and make free calls.
    Unmanaged network /Router limits us of how we can block these calls  , however we have a suggestion which could help you eliminate these calls.
    What the remote user can do is to implement this policy . Allow UDP protocol on port 5060 but the only source should be west.broadcore.com.
    Since the remote user uses his/her own router, you might need help from their respective support team.
    Thank you,
    How do I set up the port mapping to only allow incoming traffic from the specified source west.broadcore.com?
    Also, is there some sort of documentation, manual, web site or book that covers what the settings of the Airport are?  In detail?  So, that I can learn for myself what is what and be able to answer my own questions such as:  Timed Access - Does this only apply to Wi-Fi or does it disable to whole router during the restricted period?
    Thanks in advance,
    Noa
    By the way I'm using the  Airport Express 802.11n Wi-Fi (2nd Generation), Firmware 7.6.4, Airport Utility 6.3.4 on my Mac or the latest version on my iPhone 6.

    What the remote user can do is to implement this policy . Allow UDP protocol on port 5060 but the only source should be west.broadcore.com.
    Unfortunately, Apple routers are quite simple, and do not have the features and settings that you would need to do this.
    However, if you are using a modem/router or gateway device with the AirPort Express, then you might be able to set up the modem/router to do what you need. What is the make and model number of the device that you likely call your "modem"?

  • Changing the value of a row from bean code.

    Hello,
    I apologies for my bad English, and my bad knowledge of jdeveloper...
    I had never work with Oracle, jdeveloper, adf... before this Month, but I have to migrate one "window" from forms to jdeveloper 11g r2 for my Internship...
    The problem I am encountering:
    This in the "window": http://imageshack.us/f/268/configp.png/
    There is a master detail link between the top form, and the center table Table1.
    When i click on a row of Table1, the layout at the right (at the top of the picture) will display an inputText, a slider, ... or a Table, depending of the row selected in Table1.
    When it displays a table (Table2), i want, when i doubleClick on a line of Table2 , that it retrieves the value "VoarArtiCode" of the selected line, to the column OvpdOvprCode of the selected line od Table1.
    I tried this:
    public void DoucleClickTable2((ClientEvent clientEvent))
    System.out.println("DoucleClickTable2 START");
    //Affect the value needed to voarArtiCode
    JUCtrlHierNodeBinding nodeBinding = this.getSelectedColumnOfTable((RichTable)clientEvent.getComponent());
    String voarArtiCode = (String)nodeBinding.getAttribute("VoarArtiCode");
    //Set the new value
    AttributeBinding ovpdOvprCode = (AttributeBinding)getBindings().getControlBinding("OvpdOvprCode");
    ovpdOvprCode.setInputValue(voarArtiCode);
    System.out.println("DoucleClickTable2 END");
    Or this
    public void DoucleClickTable2((ClientEvent clientEvent))
    System.out.println("DoucleClickTable2 START");
    JUCtrlHierNodeBinding nodeBinding = this.getSelectedColumnOfTable((RichTable)clientEvent.getComponent());
    String voarArtiCode = (String)nodeBinding.getAttribute("VoarArtiCode");
    getQuestionSelectedRow().setAttribute("OvpdOvprCode", voarArtiCode);
    System.out.println("DoucleClickTable2 END");
    But that DIDN'T WORK :S
    The row in my Table1 didn't change...
    So I created the classe Table1ViewRowImpl.java
    Put a print in this method:
    public void setOvpdOvprCode(String value) {
    System.out.println("setOvpdOvprCode(): value= " + value);
    setAttributeInternal(OVPDOVPRCODE, value);
    And when i double click on a row of Table2 with the value "1" in VoarArtiCode in the Table2 and the value "2" on OvpdOvprCOde in the Table 1 get :
    DoucleClickTable2 START
    setOvpdOvprCode(): value= 1
    DoucleClickTable2 END
    setOvpdOvprCode(): value= 2
    The value is reset to the original value 2, automatically ...
    I tried lots of things, but none works...
    To sum up:
    How can i change a current data Binding attributeValue from java ?
    Someone have a solution for me ?
    Thank you in advance
    Julien
    Edited by: 870381 on 5 juil. 2011 16:23
    Edited by: 870381 on 5 juil. 2011 16:25

    You should try to avoid traversing the tree especially in the case that you have selected rows. I think what you should try to first is ensure that your current row on the detail is updated on-select of the master. After you have that figured out, an attributeBinding will directly represent your selected row on that iterator.
    With that, it's as easy as using ControlBindings to update your value.
    => It is well updated
    So, basically, you should try to simplify your usecase to the point where you're working in one record at a time, if you have a table then its much better that you configure all the time (which is by default it already does that) the currentRow, then use attributeBindings.
    Ok I did this:
    DCIteratorBinding iteratorBinding = (DCIteratorBinding) getBindings().get("Table1View1Iterator");
    iteratorBinding.getCurrentRow().setAttribute("OvpdOvprCode", "test");
    But that still don't work !!
    It is like that the value that i change is automatically reset to the original...
    Is it caused by the master-detail link ?
    Haaaaa my 2nd day of work on that "little" problem :'(

Maybe you are looking for

  • Backing up and restoring app data of an App World (BlackBerry World) app

    I'd like to do a security wipe on my old Bold 9700 and then reinstall/restore an App World (BlackBerry World) app that I purchased with the same BlackBerry ID. 1. Can I reinstall an app via App World after a security wipe? 2. WIll the app data (e.g. 

  • I'm try to install mac os x 10.5.6 on my imac a1224 and it won't install

    its say Mac os x cannot be install on computer, why?

  • .rsp file

    Greetings, I'm trying to see the samples provided by the SDK. When I complie most of the samples without changing the .rsp file as suggested by the documentation (Adding READER_PLUGIN, removing PI_ACROCOLOR_VERSION=0x00060000, and set the value of AC

  • IPhone 5 geht dauernd aus

    Ich habe ein Problem mein iPhone 5 ,  geht dauernd von selber aus obwohl der Akku nicht leer ist und dann dauert es manchmal 10 Minuten und dann schaltet es sich wieder von selber ein das passiert fast jeden Tag was kann ich da machen ?

  • Transfer ipad to ipad air

    How do I transfer my data from my old iPad to my new iPad Air?