Need to read parent tag data even if child fragment doesnot have data

Hi, I am using Binary method of XML Storage,
Here is my Oracle installation details
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
"CORE 11.2.0.3.0 Production"
XML Structure Details ---> The provided sample xml has repetitive Party tag under which a PolicyNumber tag might be present, under the Party tag a AddressList may or not be present.
I have 3 such Party tags, the first one has no PolicyNumber tag altough the AddressList tag and has multiple Adress under the same, the second Party tag has the PolicyNumber however it doesnot have the AdressList data in it, 3rd party tag is irrelevant for this issue.
What i want to acheive ---> Even though there are no Address present for the PolicyNumber tag i want PolicyNumber to appear in my result set, since the PolicyNumber's Party tag doesnot have a Address tag i guess the result set is ignoring the PolicyNumber in the final result set.
In a nut shell i need all these data i cannot miss the PolicyNumber neither the Address
Please go through the XML and the subsequent query for further assitance
Inserting a sample XML
INSERT INTO XML_TEST
VALUES
(XMLTYPE('<?xml version="1.0"; ?>
<workfile>
<claimnumber>abcdefgh</claimnumber>
<Party>
<AutoInsurancePolicy>
<AddressList>
<Address>
<Address1>data1 goes here</Address1>
<Address2>data1 goes here</Address2>
</Address>
<Address>
<Address1>data2 goes here</Address1>
<Address2>data2 goes here</Address2>
</Address>
</AddressList>
</AutoInsurancePolicy>
</Party>
<Party>
<AutoInsurancePolicy>
<PolicyNumber>123456</PolicyNumber>
</AutoInsurancePolicy>
</Party>
<Party>
<AutoInsurancePolicy>
<ContactList>
<ContactNumber>
<Phone>917656723</Phone>
</ContactNumber>
</ContactList>
</AutoInsurancePolicy>
</Party>
</workfile>
Query that i am using to extract CLAIM, PolicyNumber and Corresponding Addresses
select
m.CLAIM,
n.PolicyNumber,
l.ADDRESS_1,
l.ADDRESS_2
from XML_TEST,
xmltable(
'$WK/workfile' passing XMLDATA as "WK"
columns
CLAIM VARCHAR2 (4000) PATH 'claimnumber',
Party_fragment XMLTYPE PATH 'Party'
) m,
XMLTABLE(
'$PY/Party' passing m.Party_fragment as "PY"
columns
PolicyNumber VARCHAR2 (4000) PATH 'AutoInsurancePolicy/PolicyNumber',
Address_Fragment XMLTYPE PATH 'AutoInsurancePolicy/AddressList/Address'
) n,
XMLTABLE(
'$AD/Address' passing n.Address_Fragment as "AD"
columns
ADDRESS_1 VARCHAR2 (4000) PATH 'Address1',
ADDRESS_2 VARCHAR2 (4000) PATH 'Address2'
) l;
But this query returns no PolicyNumber, since the address under the Party node where the PolicyNumber is present does not have a corresponding Address value
Heres the result set returned:-
CLAIM POLICY_NUMBER Address1 Address2
abcdefgh <NULL> data1 goes here data1 goes here
abcdefgh <NULL> data2 goes here data2 goes here
Is there a way to specify to the above query to fetch all the data even if its corresponding Address fragment does not have data against the tag.
Result set that i want to acheive:-
CLAIM POLICY_NUMBER Address1 Address2
abcdefgh 123456 <NULL> <NULL>
abcdefgh <NULL> data1 goes here data1 goes here
abcdefgh <NULL> data2 goes here data2 goes here
Regards,
Arghyadip
Edited by: beta32c on May 9, 2013 2:06 AM

beta32c wrote:
Howver i think i am unable to express my problems correctly , let me try again i need both the policynumber and the address details in my result set No problem, you expressed your problem correctly, and the query I've suggested should have worked.
However, there seems to have a bug when the outer join is only used at the deepest level.
Try with outer joins at every level :
SQL> select m.CLAIM,
  2         n.PolicyNumber,
  3         l.ADDRESS_1,
  4         l.ADDRESS_2
  5  from XML_TEST,
  6       xmltable(
  7         '$WK/workfile' passing XMLDATA as "WK"
  8         columns
  9           CLAIM VARCHAR2 (4000) PATH   'claimnumber',
10           Party_fragment XMLTYPE PATH 'Party'
11       ) (+) m,
12       XMLTABLE(
13         '$PY/Party' passing m.Party_fragment as "PY"
14         columns
15           PolicyNumber VARCHAR2 (4000) PATH  'AutoInsurancePolicy/PolicyNumber',
16           Address_Fragment XMLTYPE PATH 'AutoInsurancePolicy/AddressList/Address'
17       ) (+) n,
18       XMLTABLE(
19         '$AD/Address' passing n.Address_Fragment as "AD"
20         columns
21           ADDRESS_1 VARCHAR2 (4000) PATH 'Address1',
22           ADDRESS_2 VARCHAR2 (4000) PATH 'Address2'
23       ) (+) l
24  ;
CLAIM        POLICYNUMBER    ADDRESS_1          ADDRESS_2
abcdefgh                     data1 goes here    data1 goes here
abcdefgh                     data2 goes here    data2 goes here
abcdefgh     123456                            
abcdefgh                                       

Similar Messages

  • Bapi or FM needed to read contract (vendor) data  in 4.7 version

    Hello Folks,
    I am working in 4.7 version ... I checked in se37 but couldn't find suitable bapi for reading the contract data(vendor contract).In ecc 6.0 we do have bapi_contract_getdetail bapi for reading the contract data.. I couldn't find any bapi or FM to read the contract data in 4.7 version.. Can anyone help me in reading the contract data either from BAPI or FM?
    Regards,
    Raj

    Hi,
          Please check PO_ITEM LIKE BAPIMEPOITEM (Item Data)   " tables
    This table contains the item data for an purchase order (e.g. material, order quantity, net price, plant)."
    POHEADER LIKE BAPIMEPOHEADER  " import parameter
    This table contains the header data of  purchase order (e.g. purchasing organization, vendor, currency, terms of payment).
    Regard's
    Smruti

  • How do you make iTunes read updated tag data from a file?

    This is such basic functionality that I'm sure I'm just missing it. It used to be the when I modified a file using a third party application (or editing a shared library using iTunes running on a different machine), all you had to do to get those updates into iTunes was select, hit "get info" and click OK without changing anything. That broke in 9.2 - it still recognized that the file has changed and adjusts the Date Modified field, but doesn't actually update any of the fields.
    The revised tags don't get updated until you either Get Info individually on each file, play the file, or modify the files. So realistically, there are no workarounds - the first two aren't realistic for a full library and the latter trashes your modification date and causes the refresh to take hours to complete if the library is on a remote server, rather than the ten minutes it used to take.

    turingtest2 wrote:
    Hi,
    I've written a script called UpdateTagInfo which should do the trick for you. Just select a bunch of tracks or an appropriate playlist and call the script. It will process each track, updating the tags if they've been changed externally. When complete it will tell you how many tracks were processed & how many were updated.
    More scripts at http://samsoft.org.uk/iTunes/scripts.asp
    tt2
    This is great! Thanks for posting and letting us know...
    Sandy

  • I can't read in a date from a txt file

    Im not sure of the code needed to read in a date from the text file, this is an example of the text file:
    1
    2
    2003
    ie,
    day
    month year
    I have to read in this date, this is the set method for the date:
    public void setPurchaseDate (int d, int m, int y)
    new Date(d,m,y);
    And this is the code that I have tried using to readin the date:
      PurchaseDate=(Integer.parseInt(line),Integer.parseInt(line),Integer.parseInt(line));now i know its wrong, I just dont know what the code should be!!
    Cheers

    ok, I am going to go through it and see what values I can and cant read in, here is the code i am trying to use:
    private void addx()
           FileReader fin;
           int noBooks;
           int itemNum;
           String title;
           String subject;
           double costNew;
           double costPaid;
           String isbn;
           double sellingPrice = 0;
           int noAuthors;
           int day;
           int month;
           int year;
            String seperator = "#";
            Book[] book = new Book[9];
            try
                fin = new FileReader("Books.txt");
                BufferedReader buff = new BufferedReader(fin);
                String line = buff.readLine();
                int count= 0;
                //read in Number of books
                noBooks=Integer.parseInt(line);
                while( line != null)
                    //Read in item number
                    itemNum = Integer.parseInt(line);
                    //Read in title
                    title = buff.readLine();
                    //Read in number of authors
                    noAuthors=Integer.parseInt(line);
                    //Read each line in as an author until number of authors reached
                    ArrayList authors = new ArrayList();
                    for(int i=0; i < noAuthors ; i++)
                        authors.add(buff.readLine());
                    //Read in cost new
                    costNew = Double.parseDouble(line);
                    //Read in subject
                    subject = buff.readLine();
                    //Read in ISBN
                    isbn = buff.readLine();              
                    //Read in purchase day
                    day = Integer.parseInt(line);
                    //Read in purchase month
                    month=Integer.parseInt (line);
                    //Read in purchase year
                    year = Integer.parseInt (line);
                    //Read in cost paid
                    costPaid = Double.parseDouble(line);
                    line = buff.readLine();
                    //Pass date, month and year values to array
                    Date purchaseDate =new Date(day,month,year);
                    //Pass values to constructor
                    if (line.equals(seperator))
                        book[count++] = new Book(itemNum, title, authors, subject, purchaseDate,costNew,costPaid,isbn, sellingPrice,noAuthors);
                  // line = buff.readLine();
                System.out.println(book.toString());
            catch(Exception ex)
                System.out.println(ex.toString());
             }

  • How to read CSS message data

    Hi,
    I have a requirement here. When working as a Dev angel for multiple customers its really difficult to manage the message inflow and status with accuracy. Hence i am planning to develop an application which can retrive(only reading) the data from CSS and interpret the same to quickly arrive at decisons for the message. As a first set i need to read the message data from CSS. Are there any APIs available for the same. I guess SAP developer dashboard has some what similar functionality but with very limited scope. May be if somebody can comment on the technology/machanism behind pulling the data into dashboard?
    Any comments here?
    Regards,
    Paul

    http://gizmodo.com/5070368/caps-lock-trainer-key-painfully-punishes-poor-netiquette
    Also, there is no native way to display a PDF in flash. You will need to use a utility that converts it. SWFTools has one that works pretty well.

  • How to delete parent table data even though it has child records

    hi all,
    How to delete parent table data even though it has child records.
    ex: delete from pa_request cascade constraints;
    But this command is not working .
    Regards,
    P Prakash

    833560 wrote:
    ex: delete from pa_request cascade constraints;cascade constraints is DROP table option. It can't be used with DELETE. You need to delete child rows first or drop foreign keys and recreate them with ON DELETE CASCADE. Then:
    delete from pa_request will automatically delete child rows. However, personally I don't like ON DELETE CASCADE. You can, by mistake, delete half of your database without even realizing it.
    SY.

  • Need to read Hex data format for Handheld device. (SAP AII RFID )

    Hello,
    we developed a custom screens for packing, unpacking, tag commission.. etc for handheld device for my client. the Serial number field  type is /ain/barcode. Its working fine. but for the new system need to read the Hex format. I created a new field in the screen. but the handheld device is not reading the Serial number in Hex format.
    Could anyone suggest me how to read Hex data in Handheld devices. We are using Motorola MC9090 Series.
    Regards,
    Kamal

    Hi
    Are you using the reader to read an RFID tag or for reading barcodes.
    Ideally, if you read an EPC Gen2 RFID tag, for example, the 96 bit encoded EPC is read and that can be converted to its equivalent  HEX format for posting the observation to SAP AII.
    In case of barcodes, the string is read as is printed on the barcode.

  • How to read value within XML Tag data using IO Stream in Java

    We have xml data into a Stream and we need to extract values again into a Stream from the particular XML tag <Data> inside the Stream. PFB the sample XML which will be contained inside the stream and can someone help us to hint the java code for this. We require it using the IO API only and we need to look <DATA> for the begining of the stream and </DATA> as the end of the stream.
    Please note that input is stream and output require also is a stream.
    <?xml version = "1.0" encoding="UTF-8" ?>
    <GenericDataEnvelope>
    <DataFormat>PlainText</DataFormat>
    <Name>1111</Name>
    <Security>NA</Security>
    <senderName>abc</senderName>
    <Protocol>HTTP</Protocol>
    <Data>
    SElQRlhDVElQRlBCTktERUZGMDYxMDAyMDc0MzUyMDAwMTA2MTAwMjA3NDM1MlRDSEFTVVMzMzAw
    MDAwMDAwMDAwMTc4LDEyMDAwMTc4MTIKezQ6TVQxMDM6CjoyMDowMDYwMDQ5MjQxMDA2NzcwCjoy
    M0I6Q1JFRAo6MjNFOlNEVkEKOjMyQTowNjEwMDVDQUQwLDAxCjozM0I6RVVSMCwwMQo6MzY6MSwz
    TNzcwQU5WLVJFTlRFIE9DVCAwNgowLDAxLzEsMTcxOQo6NzFBOlNIQQo6NzI6L1JFQy84NDM2MTU3
    MTA2Ci19ClRJUEYK
    </Data>
    <DataType>INVOICE</DataType>
    </GenericDataEnvelope>

    The example you've showed is valid and it is also text.
    Think seriously about this ... for example, do you have a rule that says </DATA> can't appear in the binary data?
    But in any case I can't see the problem. If you want to use IO classes directly, just read lines until you see <DATA>, then read data until it ends with </DATA>, and remove that.
    But I would certainly use SAX myself until proven otherwise that it won't work..

  • Need to read data from a jsp and insert in other jsp

    Hi,
    I have a jsp where i need to read from another jsp(which has data " header ---insert -----footer") and find a string "insert" in it and replace that string with a some value in the current jsp.
    Thanx in Advance.
    Sridhar.

    I have a jsp
    which needs to take headers and footers dynamically and insert them into my jsp.
    currently what i am doing is, using a script to get these header and footer and using document.write
    MYJSP.jsp looks this way
    <script src="/../Headerfooter.jsp"/>
    <script language="javascript">
    document.write(header); -->defined in -> /HeaderFooter.jsp
    document.write("<table>...</table>");
    document.write(footer);-->defined in -> /HeaderFooter.jsp
    </script>
    /HeaderFooter.jsp looks this way
    header = "<html>...<table width=\"100\">....";
    footer ="....</html">
    i dont want to use script bcoz i am getting problems in nestcape...

  • Need to read data from a text file

    I need to read data from a text file and create my own hash table out of it. I'm not allowed to use the built in Java class, so how would I go implementing my own reading method and hash table class?

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need to read data from pipe separated file using POJO?

    Hi,
    I need to read data from pipe separated file using POJO.
    There is config.properties file which consists of the
    data mapping.
    Can you help me with sample code or help?
    Regards
    Regards
    Taton
    Edited by: Taton on Mar 7, 2009 4:41 PM

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Have installed creative cloud, but while the apps read "up to date," they are not even installed and cannot be opened. Have uninstalled and reinstalled Creative Cloud/Adobe.

    Have installed creative cloud, but while the apps read "up to date," they are not even installed and cannot be opened. Have uninstalled and reinstalled Creative Cloud/Adobe. Horribly frustrating. This is my second computer for installing creative cloud. Does that make a difference?

    Hi Jakegosselin,
    Please refer to the below article.
    http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html
    Thanks

  • I need to read data from MQ? any example of OFSML   ?

    I need to read data from MQ so what I should know about this MQ properties ?? such ip,name,....
    I'm new in MQ programming
    and it can be over internet or local network only ?
    I will used the OFSML
    any one know any thing about OFSML or any example ?? Open Financial Services XML interface
    (http://dts.temenos.com/ofsml/)

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I need to read a reference inside of a data object

    Hi Developers,
    I need to read some data that is nested deep inside a method. My situation looks like this:
    data object
         IREF_MDO_DATA       Type    Reference
              v
             OREF_MDO_HANDLER   Type    Reference
                  v
                 STR_DOF_FILTER_VALS   Type   Deep Structure(232)
                      v
                   ASSIGNMENT_TYPE
                   SALES_AREA
                   DOC_NUMBER
                   SALESORG
    My question is how do i access  OREF_MDO_HANDLER  and then access STR_DOF_FILTER_VALS  ?
    Please let me know if you need more information? I will do my best to explain better?
    Thanks,
    Patrick

    Hi Adrian,
    I forgot to mention that the second Reference Variable (OREF_MDO_HANDLER) is a TYPE REF TO. I believe this is my problem. I can not use the statement GET REFERENCE OF IREF_MDO_DATA-> OREF_MDO_HANDLER. because OREF_MDO_HANDLER is a TYPE REF TO. Is there way i can access the reference TYPE REF TO?
    Thanks,

  • I need to read data from a text file and display it in a datagrid.how can this be done..please help

    hey ppl
    i have a datagrid in my form.i need to read input(fields..sort of a database) from a text file and display its contents in the datagrid.
    how can this  be done.. and also after every few seconds reading event should be re executed.. and that the contents of the datagrid will keep changing as per the changes in the file...
    please help as this is urgent and important.. if possible please provide me with an example code as i am completely new to flex... 
    thanks.....  

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Purchase Price Variances

    Hi, I am new to SAP.  What is the best way to look at all the purchase price variances for a whole month? Thanks

  • Windows Local (\) vs. Server (/) link path translation

    I am new at this so forgive my ignorance. I am having problems maintaining a site that I recently inherited because the links have "\" in the relative links rather than "/" which is causing Firefox to fail to find the links. Internet Explorer works j

  • CA with SAP FICO  and Japanese Language

    Hello Friends, I am Kapil studying  ( final group ) to become a Chartered Accountant.I want to do SAP FICO Module from SAP Certified Education Center in Delhi,India.I  have also done One Year Intensive Advanced Diploma in JAPANESE Language from Delhi

  • Regarding  Measurement Documents

    Dear All,    I am Nagesh working as SAP PM consultant and this is my first SAP implementation project.    My project is about fleet maintenance of transport vehicles. I have struck with preventive maintenance configuration.    My client wants the pre

  • Error while installing Windows server 2008 R2

    Hi, I am trying to install Windows server 2008 r2 (7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso). While installing i am getting the below error. Please help.