Generate XML Urgent !!!!!

Hi all,
i have just problem with generating XML through database.
my code is
DECLARE
XML_DATA XMLTYPE;
BEGIN
FOR v_cur IN (SELECT * FROM EMPLOYEES)
LOOP
SELECT dbms_xmlgen.getxmltype('SELECT * FROM EMPLOYEES WHERE EMP_ID=' || v_cur.EMP_ID)
INTO XML_DATA
FROM DUAL;
INSERT INTO TEST_DATA VALUES (XML_DATA);
END LOOP;
END;
NOW i am getting out put like
<Rowset>
<Row>
<emp_id>101<emp_id>
<emp_name>King</emp_name>
<add1>160-2</add1>
<add2>Apex Appartment</add2>
<dept_id>10</dept_id>
<city>NJ</city>
</Row>
</Rowset>
But i want out put in following format :
<Rowset>
<Row>
<emp_id>101<emp_id>
<emp_name>King</emp_name>
<Address>
<add1>160-2</add1>
<add2>Apex Appartment</add2>
</Address>
<dept_id>10</dept_id>
<city>NJ</city>
</Row>
</Rowset>
also tell me if column has NULL value the only node disply like <add2></add2>( this is not mandatory)
please help me out
Thanks in advance

Here is a way to do it:
declare
XML_DATA XMLTYPE;
BEGIN
FOR v_cur IN (SELECT * FROM emp)
LOOP
SELECT dbms_xmlgen.getxmltype('select empno, ename, xmlforest (job, mgr) as ADDRESS from emp WHERE empno=' || v_cur.empno)
INTO XML_DATA
FROM DUAL;
INSERT INTO TEST_DATA VALUES (XML_DATA);
END LOOP;
END;
/change the emp to employees, and list out all the columns you want to include in xml.
in xmlforest (job, mgr), replace job, mgr columns to the columns you want to include in address segment.
Thanks
Edited by: PhoenixBai on Aug 23, 2010 11:16 PM

Similar Messages

  • HELP in Generating XML(PLz help its urgent)

    Hi,I need to generate XML FIle.Since i m new to XML.
    I had toregister the valid schema in my DB now i want to generate the XML file and with the refernce to this schema that xml file should be validated one against that schema.
    things i hav done till now
    ->i hav registered the scehma
    and the sample XML file provided by client
    <?xml version="1.0"?>
    <MEDMLDATA xmlns="PhaseForward-MedML-Inform4">
    <!-- Insert Trial/Study Information -->
    <STUDYVERSION UUID="id"
    STUDYNAME="name"
    VERSIONDESCRIPTION="text" />
    <!-- Insert Site Personnel Information -->
    <USER USERNAME="mmeyer"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "Marianne"
    LASTNAME = "Meyer"
    DISPLAYNAME = "Marianne Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <USER USERNAME="john"
    USERTYPE = "SITE"
    ACTIVESTATE = "TRUE"
    DELETESTATE = "FALSE"
    FIRSTNAME = "John"
    LASTNAME = "Meyer"
    DISPLAYNAME = "John Meyer"
    TITLE = ""
    HOMESCREENURL = "./Custom/HomeDefault.html"
    PHONE = "(555) 555-1212"
    FAX = "(555) 555-1212"
    ALTPHONE = ""
    EMAIL = "[email protected]"
    ADDRESS = ""
    ADDRESS2 = ""
    CITY = ""
    STATE = ""
    ZIPCODE = ""
    COUNTRY = ""
    BEEPER = ""
    USERMUSTRESETPASSWORD = "FALSE"
    DESCRIPTION = ""
    PASSWORD="changeme"/>
    <!-- Insert Site Information -->
    <SITE NAME=     "(01) Massachusetts General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <SITE NAME=     "(02) Boston General Hospital" MNEMONIC="01"
    ADDRESS = "1 Main Street"
    ADDRESS2 = ""
    CITY = "Boston"
    STATE = "MA"
    ZIPCODE = ""
    COUNTRY = "USA"
    PHONE = "(555) 555-1212"
    ALTPHONE = ""
    FAX = ""
    EMAIL = ""
    TIMEZONE="(GMT-05:00) Eastern Time (US & Canada)"
    SITEDATEFORMAT = "MONTH_DAY_YEAR"
    STARTDATE = "April 1, 2005">
    </SITE>
    <!-- Insert SITE and User Mapping Information -->
    <SITEGROUP SITENAME="(01) Massachusetts General Hospital">
    <USERREF USERNAME="mmeyer"/>
    </SITEGROUP>
    <SITEGROUP SITENAME="(02) Boston General Hospital">
    <USERREF USERNAME="John"/>
    </SITEGROUP>
    <!-- Insert User ROle Information -->
    <RIGHTSGROUP GROUPNAME="CRA">
    <!-- Insert Rights -->
    <RIGHTREF RIGHT="Print"/>
    <RIGHTREF RIGHT="Monitor"/>
    <RIGHTREF RIGHT="Canned Reports"/>
    <RIGHTREF RIGHT="View CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRF"/>
    <RIGHTREF RIGHT="View Signature History for CRB"/>
    <RIGHTREF RIGHT="Data Export Listings"/>
    <RIGHTREF RIGHT="Freeze a CRF"/>
    <RIGHTREF RIGHT="Unfreeze a CRF"/>
    <RIGHTREF RIGHT="Mark and Unmark a CRF as SVed"/>
    <RIGHTREF RIGHT="Freeze a CRB"/>
    <RIGHTREF RIGHT="Unfreeze a CRB"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Open"/>
    <RIGHTREF RIGHT="Change Query State from Candidate to Deleted"/>
    <RIGHTREF RIGHT="Change Query State from Answered to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Open to Closed"/>
    <RIGHTREF RIGHT="Change Query State from Reissued Candidate to Closed"/>
    <RIGHTREF RIGHT="Enter Query in Candidate State"/>
    <RIGHTREF RIGHT="Enter Query in Open State"/>
    <RIGHTREF RIGHT="Re-issue Query in Candidate State"/>
    <RIGHTREF RIGHT="Re-issue Query in Open State"/>
    <RIGHTREF RIGHT="Navigate by Visit"/>
    <RIGHTREF RIGHT="Navigate by Form"/>
    <RIGHTREF RIGHT="Reordering of Patients"/>
    <!-- Insert Users for role -->
    <USERREF USERNAME="mmeyer"/>
    <USERREF USERNAME="john"/>
    </RIGHTSGROUP>
    </MEDMLDATA>
    now i need to generate XML based on the above SAMple XML file,can anybody tell me how to generate XML file based on this..and after generating it should be validated against the registerd schema.

    Maybe I am wrong, but my understanding is that you have to generate the xml from your data source (usually tables) and then you validate it against your schema. I don't know if the schema has a magic that can generate the xml for you. Is that correct? Anyone please? At the beginning, I asked a .Net guy if his tool could "generate" an xml simply using the schema (I thought so). But he said they had to use many style sheets to create the xml.
    Ben

  • URGENT!! Generating XML in a PL/SQL stored proc

    Hi,
    I need to generate XML from a PL/SQL stored proc.
    I need to do it in Oracle 7.3.4 as well as 8.1.6 databases.
    I need to have my own defined tags in the xml.
    Say I have the table Person like
    Person (
    id number,
    fname varchar2(40),
    lname varchar2(40)
    I need a stored proc will will select * from Person and output the data in XML form as
    <Person Names>
    <Employee>
    <First Name personid="<<value from id field>>">
    <<value from fname field>>
    </First Name>
    <Last Name>
    << value from lname field>>
    </Last Name>
    </Employee>
    </Person Names>
    I want to minimise hard coding also.
    how can I do this ? any pointers ?
    Thanks in advance, Hari
    null

    Hi,
    We are not having a Web Agent here. So i am unable to use PLSXML utility.
    I installed XSU and is now able to create the XML, but with the table attribute names as the tags. So
    1. Is there a way I can transform this XML to another XML with custom tags ( using an XSL ) in a PL/SQL procedure ?
    2. Is there a way I can install and use PLSXML without the web agent ?
    Thanks, Hari

  • How to generate XML Publisher report from PLSQL Stored Procedure in APPS

    Hi,
    I have concurrent program of type PLSQL Stored procedure.I need to generate XML Publisher report from the same.I have changed the output of the concurrent program as "XML" but when I tried running it,the XML tags are not generated.Due to this I am unable to create the template.Its a urgent issue.
    Please help me out .
    Thanks in advance.
    Kaveri

    Hi Kaveri
    Sadly there is nothing magic about that output field. The only program type that you can flip it to XML and then magically get XML is for Oracle Reports. For plsql you will need to recode the plsql to generate XML rather than text that you have now.
    You have some options, best option first:
    1. Move the sql to a data template - check the user guide and blog for help or
    2. Use SQL XML or XMLGEN (not great for large datasets) or
    3. Use dbms_output.put_line and write the XML file manually - not performant at all
    Regards, Tim

  • Error while printing generated XML doc using DBMS_OUTPUT

    while generating XML document using XDK for PL/SQL i am getting " ORU-10027: buffer overflow, limit of 1000000 bytes " error even though i had set DBMS_OUTPUT to 1000000.
    Is there any way to getrid of this problem .
    i am using this code ..
    CREATE OR REPLACE procedure SQLToXML1 is
    queryCtx DBMS_XMLquery.ctxType;
    result CLOB;
    begin
    DBMS_OUTPUT.ENABLE (1000000);
    queryCtx := DBMS_XMLQuery.newContext ('select * from depolib_library' )
    result := DBMS_XMLQuery.getXML(queryCtx);
    printClobOut(result);
    DBMS_XMLQuery.closeContext(queryCtx);
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end;
    urgent help is needed
    Thanks
    null

    No, It is a PO Print only. Only for changes to PO that do not affect the value of the PO,this error occurs. When i select the entry for the PO and click on Output message, the output message fails. On clicking Display Message, it shows the message - No schedules exist for the Scheduling Agreement XXXXXX(the PO number".
    So,it is not for Scheduling Agreements but for PO only. I know it is weird to see such an error on the PO output message in ME9F.
    Pls help.

  • Issues in generating xml from Report Builder as per XSD provided

    Hi,
    We are provided with XSD's for each report. Now we need to generate XML's from report that are as per the XSD's provided to us.
    But the problem come's when we have to define hirearchies.
    Like for example
    1. Our Report is based on the following query:
    SELECT DISTINCT '' as DUMMY
    ,               fil.file_number
    ,      TO_CHAR (TO_DATE (RTRIM (LTRIM (fil.processing_date)), 'YYDDD'),'DD-MM-YY') Processing_Dt
    , rp_bsu.service_user_number
    , rp_bsu.service_user_name
    ,     rp_ac.account_number
    , rp_ac.account_name
    ,     rp_ac.account_type
    ,     rp_ac.sortcode
    , NVL(ovr_lmt.account_section_value,0) AS
    account_section_value
    ,     NVL(ovr_lmt.overlimit_amount,0) AS overlimit_amount1
    , (NVL(ovr_lmt.overlimit_amount,0) - NVL(ovr_lmt.account_section_value,0)
    ) value_to_date
    , (NVL(ovr_lmt.overlimit_amount,0) -
    NVL(lmt_usg.limit_amount,0)
    ) amount_overlimit
    , ovr_lmt.over_limit_id, NVL(lmt_usg.limit_amount,0) AS
    limit_amount
    , lmt_usg.period_type,lmt_usg.currency
    FROM v_rp_bacs3day_service_user rp_bsu,
    v_rp_bacs_service_office rp_bso,
    v_rp_account rp_ac,
    t_file fil,
    t_over_limit ovr_lmt,
    t_limit_usage lmt_usg
    WHERE rp_bso.handling_bank_code = :p_scheme_member
    AND rp_bsu.sponsoring_bank_code = rp_bso.owning_bank_code
    AND rp_ac.service_user_number = rp_bsu.service_user_number
    AND rp_bsu.service_user_number = fil.originator
    AND fil.status <> 'R'
    AND fil.processing_date = (SELECT cycle_date
    FROM t_cycle
    WHERE status = 1)
    AND lmt_usg.account_id = rp_ac.account_id
    AND ovr_lmt.limit_usage_id = lmt_usg.limit_usage_id
    AND TO_CHAR (ovr_lmt.exceeded_date, 'DD-MM-YYYY') =
    (SELECT TO_CHAR (TO_DATE (RTRIM (LTRIM (cycle_date)),
    'YYDDD'),'DD-MM-YYYY')
    FROM t_cycle
    WHERE status = 1)
    2.The hierarchy as per xsd that we need to define is :
    <ServiceUserAccount>
    <ServiceUser>
         <Name></Name>
    <Number></Number>
    </ServiceUser> <SortCode></SortCode>
    <AccountNumber></AccountNumber>
    <NearOrOverLimitDetail>
    <AccountType></AccountType>
    <ProcessingDate></ProcessingDate>
    …………………..(there is a list of elements below it)
    </NearOrOverLimitDetail>
    </ServiceUserAccount>
    In the xsd for the complex element type “ServiceUser” we need to display Service User Name and Number. For this I created a separate query Q2 in reports and joined it using data link with the parent Q1(which has data grouped on processing date) . So that it can be displayed as a separate element parallel to other elements like Sort code ,Account Numbers. But when we generate XML for this, then tags for Q2 query donot appear in xml.
    And we get this hierarchy with missing Service User element
    <ServiceUserAccount>
    <SortCode></SortCode>
    <AccountNumber></AccountNumber>
    <NearOrOverLimitDetail>
    <AccountType></AccountType>
    <ProcessingDate></ProcessingDate>
    …………………..(there is a list of elements below it)
    </NearOrOverLimitDetail>
    </ServiceUserAccount>
    Please let me know if you have any solution to implement this ASAP as its very urgent.
    Thanks & Regds
    Anuradha.

    Hi,
    We are provided with XSD's for each report. Now we need to generate XML's from report that are as per the XSD's provided to us.
    But the problem come's when we have to define hirearchies.
    Like for example
    1. Our Report is based on the following query:
    SELECT DISTINCT '' as DUMMY
    ,               fil.file_number
    ,      TO_CHAR (TO_DATE (RTRIM (LTRIM (fil.processing_date)), 'YYDDD'),'DD-MM-YY') Processing_Dt
    , rp_bsu.service_user_number
    , rp_bsu.service_user_name
    ,     rp_ac.account_number
    , rp_ac.account_name
    ,     rp_ac.account_type
    ,     rp_ac.sortcode
    , NVL(ovr_lmt.account_section_value,0) AS
    account_section_value
    ,     NVL(ovr_lmt.overlimit_amount,0) AS overlimit_amount1
    , (NVL(ovr_lmt.overlimit_amount,0) - NVL(ovr_lmt.account_section_value,0)
    ) value_to_date
    , (NVL(ovr_lmt.overlimit_amount,0) -
    NVL(lmt_usg.limit_amount,0)
    ) amount_overlimit
    , ovr_lmt.over_limit_id, NVL(lmt_usg.limit_amount,0) AS
    limit_amount
    , lmt_usg.period_type,lmt_usg.currency
    FROM v_rp_bacs3day_service_user rp_bsu,
    v_rp_bacs_service_office rp_bso,
    v_rp_account rp_ac,
    t_file fil,
    t_over_limit ovr_lmt,
    t_limit_usage lmt_usg
    WHERE rp_bso.handling_bank_code = :p_scheme_member
    AND rp_bsu.sponsoring_bank_code = rp_bso.owning_bank_code
    AND rp_ac.service_user_number = rp_bsu.service_user_number
    AND rp_bsu.service_user_number = fil.originator
    AND fil.status <> 'R'
    AND fil.processing_date = (SELECT cycle_date
    FROM t_cycle
    WHERE status = 1)
    AND lmt_usg.account_id = rp_ac.account_id
    AND ovr_lmt.limit_usage_id = lmt_usg.limit_usage_id
    AND TO_CHAR (ovr_lmt.exceeded_date, 'DD-MM-YYYY') =
    (SELECT TO_CHAR (TO_DATE (RTRIM (LTRIM (cycle_date)),
    'YYDDD'),'DD-MM-YYYY')
    FROM t_cycle
    WHERE status = 1)
    2.The hierarchy as per xsd that we need to define is :
    <ServiceUserAccount>
    <ServiceUser>
         <Name></Name>
    <Number></Number>
    </ServiceUser> <SortCode></SortCode>
    <AccountNumber></AccountNumber>
    <NearOrOverLimitDetail>
    <AccountType></AccountType>
    <ProcessingDate></ProcessingDate>
    …………………..(there is a list of elements below it)
    </NearOrOverLimitDetail>
    </ServiceUserAccount>
    In the xsd for the complex element type “ServiceUser” we need to display Service User Name and Number. For this I created a separate query Q2 in reports and joined it using data link with the parent Q1(which has data grouped on processing date) . So that it can be displayed as a separate element parallel to other elements like Sort code ,Account Numbers. But when we generate XML for this, then tags for Q2 query donot appear in xml.
    And we get this hierarchy with missing Service User element
    <ServiceUserAccount>
    <SortCode></SortCode>
    <AccountNumber></AccountNumber>
    <NearOrOverLimitDetail>
    <AccountType></AccountType>
    <ProcessingDate></ProcessingDate>
    …………………..(there is a list of elements below it)
    </NearOrOverLimitDetail>
    </ServiceUserAccount>
    Please let me know if you have any solution to implement this ASAP as its very urgent.
    Thanks & Regds
    Anuradha.

  • Generate xml source file for Oracle Order Capture Print Quote

    Hi,
    I am new to xml and need to work on creating templates for Print Quote.
    I am trying to generate the xml source file for which I enabled the report in system administrator and set the output to XML and assigned to Quoting Reports responsiblity. I then assigned XML Report Publisher to the same responsiblity.
    I ran the report (Print Quote) and then I am trying to run the XML Report Publisher but I cannot get the request id in the list of values.
    I am able to generate xml source file for other reports like Printed Purchase Order etc.,
    The view output for the (Print Quote) report is as follows:
    <?xml version="1.0" ?>
    - <!-- Generated by Oracle Reports version 6.0.8.26.0
    -->
    <ASOPQTER />
    How do I get the xml source file? Or are there seeded templates that I can use to create more templates? Any help would be appreciated. Thanks Ravi

    Hi, I am in the same position - did this issue ever ger resolved by anyone. I have done a few XMLP reports successfully now using the Word add-in, but customising the Quote output differs from other standard reports.
    If you look at the data definition for Quote it is a 'dummy' definition and has no XML file attached. Does anyone know how I can get the XML format for the report output?
    Also the template uses XSL-FO ?!?!?! rather than RTF - not sure how to work with this, the Oracle docs are not very helpful in this regard either.
    Has anyone successfully managed to customise the Quote print report? Many thanks,
    Roger

  • Unable to generate XML's for BLOB datatypes from Concurrent program

    Hi All,
    I've a requirement to print images on rtf layout. Images are uploaded by end user through attahments men
    there are getting stored in fnd_lobs tables.
    for printing blob images we need to convert them into CLOB and generate XML's.
    I've done the conversion through a function and calling the function in the select query which is generating XML when i run it from toad.
    SELECT xmlgen.getXml(
    'SELECT file_id,mob_getbase64String(file_data) photo
    FROM fnd_lobs
    WHERE file_id = 2490481'
    ,0
    ) FROM dual;
    But the same thing we i registered as concurrent program (SQL*Plus) the program is running into error.
    Output file
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'https://dbtdev5i.oracleoutsourcing.com/OA_CGI/FNDWRR.e...
    Input truncated to 17 characters
    ^
    Log file
    Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 10868311.
    Review your concurrent request log and/or report output file for more detailed information.
    Can anyone help me through on how to bypass this error and generate XML's.
    Thanks in Advance
    Jana

    Hi Priya..,
    I have changed the query and registered in apps and now i am able to generate XML's of the blob image and the same is getting printed on the tempate..
    DECLARE
    v_colb CLOB;
    v_query VARCHAR2(1000);
    BEGIN
    v_query := 'SELECT file_id,mob_getbase64String(file_data) photo
    FROM fnd_lobs fl,
    fnd_documents_vl fd
    WHERE fd.media_id = fl.file_id
    AND (fd.end_date_active IS NULL
    OR fd.end_date_active > SYSDATE)
    AND fd.security_type = 2
    AND fd.security_id = fnd_profile.value(''GL_SET_OF_BKS_ID'')';
    --FND_FILE.put_line( FND_FILE.LOG,v_query);
    v_colb := xmlgen.getxml (v_query, 0);
    --DBMS_OUTPUT.put_line (v_query);
    FND_FILE.put_line( FND_FILE.OUTPUT,v_colb);
    END;
    /

  • Problem with generating xml and nested cursor (ora-600)

    I have a problem with generating xml (with dbms_xmlquery or xmlgen) and nested cursors.
    When I execute the following command, I get a ORA-600 error:
    select dbms_xmlquery.getxml('select mst_id
    , mst_source
    , cursor(select per.*
    , cursor(select ftm_fdf_number
    , ftm_value
    from t_feature_master
    where ftm_mstr_id = pers_master_id ) as features
    from t_person per
    where pers_master_id = mst_id ) as persons
    from f_master
    where mst_id = 3059435')
    from dual;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: ORA-00600: internal error code, arguments: [kokbnp2], [1731], [], [], [], [], [], []
    </ERROR>
    The problem is the second cursor (t_feature_master).
    I want to generate this:
    <master>
    <..>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    <persons>
    <..>
    <features>
    <..>
    </features>
    </persons>
    </master>
    If i execute the select-statement in sql-plus, then I get the next result.
    MST_ID MST_SOURCE PERSONS
    3059435 GG CURSOR STATEMENT : 3
    CURSOR STATEMENT : 3
    PERS_MASTER_ID PERS_TITLE PERS_INITI PERS_FIRSTNAME PERS_MIDDL PERS_LASTNAME
    3059435 W. Name
    CURSOR STATEMENT : 15
    FTM_FDF_NUMBER FTM_VALUE
    1 [email protected]
    10 ....
    I use Oracle 8.1.7.4 with Oracle XDK v9.2.0.5.0.
    Is this a bug and do somebody know a workaround?

    Very simple...Drop all type objects and nested tables and create them again. You will get no error. I'll explain the reason later.

  • How to generate XML from relational data : PL/SQL or Java

    I'm new to Oracle XML and would appreciate some advice. I've been asked to generate XML documents from data stored in relational tables. The XML documents must be validated against a DTD. We will probably want to store the XML in the database.
    I've seen a PL/SQL based approach as follows :
    1.Mimic the structure of the DTD using SQL object types 2.Assign the relational data to the object type using PL/SQL as required
    3.Use the SYS_XMLGEN package to render the required XML documents from the SQL objects
    However, creating the object types seems to be quite time consuming (step 1 above) for anything other than the simplest of XML documents.
    I've also seen that there is the Java based approach, namely :
    1. Use the XML generator to build Java classes based on a DTD.
    2. Use these classes to build the required XML
    On the face of it, the Java based approach seems simpler. However, I'm not that familiar with Java.
    Which is the best way to proceed ? Is the PL/SQL based approach worth pursuing or should I bite the bullet and brush up my Java ?
    Is it possible to use a combination of PL/SQL and Java to populate the dtd generated java classes (step 2 of the Java approach) to reduce my learning curve ?
    Thanks in advance

    To help answer your questions:
    1) Now, in 9iR2, you can use SQL/XML as another choice.
    2) You can also use XSU to generate the XML and use XSLT to transform it to a desired format instead of using object views if possible.
    3) XDK provide Class generator support to populate XML data to Java classes.

  • Easiest and/or best methods for generating XML output (not with a report)

    Hi, several of our EBS customers (11.5.10) are converting their PDF reports to use XML/BI publisher to produce output. The data stream comes from a report that generates the XML output, and then the XML template is applied. This works great ... no problems, etc. From what I have read, however, Oracle intends to treat the traditional Forms and Reports Developers as legacy tools (although still supporting them, of course).
    My question is if I wanted to ditch using Reports to generate XML output, what, in your opinion or in your current usage, is the easiest way of getting this data? In Reports, the data modeler is excellent in providing a method to write your queries, split them into different repeating groups, write formula and summary columns, link multiple queries, etc, etc. If one were to become Reports Developer free, what comparable tools are available to take its place? I would expect this tool to handle a mix of GUI and coding like the Reports data modeler. Please note that I'm not looking for an EBS-specific solution -- say for a custom application using regular Oracle 10g DB and iAS, with BI Publisher for reporting.
    Thanks for your feedback,
    Ryan

    What I'm looking for is to not use Oracle Reports to generate the XML data output since Oracle's statement of direction is pushing BI Publisher rather than Oracle Reports as the preferred tool for reporting. That said, the data modeler in Reports provides a very flexible tool to construct and link multiple queries and to manipulate the queries into several levels of a master/detail relationship. Further, the mix of GUI and coding makes setting up the data model a lot more efficient. What I'm looking for (and I don't know if anything exists) is something comparable that can be used to generate XML output from the DB -- the idea being that I wouldn't use legacy tools, like Reports, for this task. I hope that is clearer.
    Really, another way of answering my question is, aside from Reports and the APIs mentioned so far, what are my fellow developers using, if anything, to extract XML data in a way that handles the features i list above?

  • Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf

    Hi,
    I have a requirement to display output from a particular table in XL format. Out of all the known possible options, I am planning to use the XML publisher to generate XL output.
    For the data source, instead of using the conventional way of creating XML data using rdf,I am planning to use DBMS_XMLGEN.getxmltype pl/sql procedure to generate the XML output. And from the output, call the template to generate the required Excel output.
    Now, I am using the following code to generate XML output but am not sure how to proceed from here. I need to first print the XML data in the FND Output file after which I was planning to call the 'XML Report Publisher' (XDOREPPB) program and use the current request id to get the excel output but I am not able to find the way to print the XML data in the output file as:
    fnd_file.put_line (fnd_file.output, l_xml_type); - is throwing an error as l_xml_type is an XML data output.
    PROCEDURE xml_main (
    errbuf OUT VARCHAR2
    ,retcode OUT VARCHAR2
    ,p_project_from IN VARCHAR2
    ,p_project_to IN VARCHAR2
    AS
    l_xml_type XMLTYPE;
    BEGIN
    SELECT DBMS_XMLGEN.getxmltype
    ('SELECT fnd_global.conc_request_id
    ,TO_CHAR (segment1)
    ,to_char(start_date,''MM/DD/RRRR'')
    ,to_char(xxmcc_project_details_pkg.current_profit_projection
    (project_id),''999,999,990.90'')
    ,to_char(xxmcc_project_details_pkg.cost_to_date (project_id),''999,999,990.90'')
    ,''1''
    FROM pa_projects_all
    WHERE segment1 BETWEEN NVL (p_project_from, segment1)
    AND NVL (p_project_to, segment1)')
    INTO l_xml_type
    FROM DUAL;
         fnd_file.put_line (fnd_file.output, l_xml_type);
    END xml_main;
    Can anyone point me as to how to publish XML output using a PL/SQL procedure (DBMS_XMLGEN.getxmltype)
    Thanks.

    Pl see if the example included in this presentation helps http://www.oracle.com/technology/products/applications/Events/OOW-2006/EBS/S281401_Sridhar_Bogelli.pdf
    Also, you do not need to explicitly call XDOREPPB in later versions of XML Publisher. If you set up everything correctly (as described in the presentation above and the link below) the Output Post Processor is called automatically after the XML file is generated successfully.
    Another excellent tutorial is at http://www.oracle.com/technology/obe/fusion_middleware/fusion/bi/xmlp_ebiz/index.html
    HTH
    Srini

  • How to generate XML from EBusiness suite ARXSGPO

    Could someone tell me how I can generate XML from the EBusiness Suite Accounts Receivable report ARXSGPO.rdf I understand this report is called by a C program. I have tried changing the concurrent request to output format to XML the result does not resemble XML. Does anyone have any suggestions how I can generate XML from the ARXSGPO report?
    Thanks,
    Mark

    Hi Mark
    the next release of XMLP will have last page only support. The problem is that at the template layer you do not know how many lines are going to fit on the page, so you never know what is going to be the last page. The only way around it for now is to specify the number of lines to a page and then check when all the lines have been rendered and then render the remit portion.
    I have a sample invoice that does the same, drop me a mail, you can work out the email from my name and the fact I work for XMLP Im sure.
    Tim

  • Using servlet to generate XML file

    What I want to do is simple but can't work. Hope you guys can give me a hint.
    I succesfully generate XML file in command line using Oracle XML parser and class generator. Then I was trying to do it using servlet. it compiles fine but generate NullPointer exception at the line:
    Emp e1= new Emp(); //Emp is the root of XML
    I suspect the Emp constructor can't correctly find the globalDTD in its superclass -CGDocument. Please note this only happens in servlet setting, not is command line setting. Any suggestion to get arounf this?
    Another unrelated question is that when I create a XML file using the Oracle XML parser, it seems all the elements a file has to be added once, otherwise the compiler will compalain about the missing element. this will be inconvinient when I constructing a big XML file, which I 'd liek to split into small piece and add them up. Maybe there is a good way but I just don't know it.
    my email: [email protected]

    Hi,
    I'm running into the same problem deploying the classes generated by the class generator. Code works fine from JDeveloper, but had to put my DTD in the directory where my classes are. Deploying the classes with Apache's JServ gives me a NullPointer exception on the first addNode method. I guess it can't find the DTD. I tried to put the DTD in many locations but this didn't fix the problem. Any suggestions?
    Steve,
    Did you fix this problem? Thanx!
    null

  • Generate XML report using MAX Generate report.vi

    Hi All,
    Caught in simple and wierd problem. I'm using a simle VI called MAX Generate Reoprt.vi to generate an XML report but getting error
    Error code -2147220553
     Error description :Incorrect report file extension provided.
    The image of the block diagram is attached. I'm able to generate HTML reoport from MAX(absolutely no probs).
    Thanks in advance
    Regards
    VDC
    Attachments:
    Error_in_MAX.JPG ‏7 KB

    You must have the correct file extention. Here's what is wirtten in the detailed help of the function:
    output filename specifies the filename of the generated report.
    You must have the correct extension for the type of report to generate (.xml, .htm, .html, or .zip).
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

Maybe you are looking for