How to convert Oracle Collection(Objects) to XML dynamically?

Dear members,
As a requirement I need to pass the collection of values(typically a object or a table type) to a procedure and generate a XML file on the fly basing on these collection values.I am not sure how to do it.Can anyone please guide me on that?
Thanks

Hi,
depending on how often/how complex the programming job is:
--- complex Xml structure, lots of changes: Have a look at [Oracle XML DB Developers Guide|http://download-west.oracle.com/docs/cd/B28359_01/appdev.111/b28369/toc.htm], chapter 3: Using Oracle XML DB
--- simple:
Here's a quick sample for generating Xml from SQL collection types. Works (at least) >= 10g.
create type xxp_foo_type as object (
a number
instantiable
create type xxp_foo_tab as table of xxp_foo_type
declare
v_table xxp_foo_tab := xxp_foo_tab();
v_xml xmltype;
begin
v_table.extend(2);
v_table(1) := xxp_foo_type( 1 );
v_table(2) := xxp_foo_type( 2 );
select xmlelement( "MyXml",
xmlagg(
xmlelement( "SomeValue", t.a )
into v_xml
from table( v_table ) t
dbms_output.put_line( v_xml.getStringVal() );
end;

Similar Messages

  • How to Convert Oracle Apps Report into XML Publisher

    Hi
    How to Convert Oracle Apps Report into XML Publisher?
    Thanks

    In Brief :
    Re: XML Publisher
    In Details :
    http://www.oracle.com/technology/products/xml-publisher/docs/XMLEBSRep.pdf

  • How to convert Oracle table(s) in XML OR to transfer Table Schema in XML

    I am using Oracle 8i (8.1.6) on the win 2000 Prof server. I want to use the Oracle database in the .NET but i am not able to connect with the Oracle.Is there any way to get the Oracle table details in .Net and generate the Table schema for that table(s)?
    Please help me
    Message was edited by:
    user515242

    i think
    Wrong place to ask this ?
    please look out for answer in Database or SQL forum.

  • How to convert Oracle reports previewer output into delimited file.

    How to convert Oracle reports previewer output into delimited file if the report has more than 1000 pages.
    I tried with previewer option File --> Generate to file --> Delimited file, but the report engine is crashing.Not generating .TXT file.
    I observed that this option is not working for more than 400 pages.
    I am using Oracle reports 6i version.
    Plz suggest me to generate .TXT file from Report previewer.

    You can specify a delimiter (a character or string of characters) to separate the data (boilerplate or field objects) in your report output in either of the following ways:
    On the command line using the DELIMITER keyword.
    In the Delimited Output dialog box or DelimitedData Output dialog box (displayed with File > Generate to File > Delimited or File > Generate to File > DelimitedData) in Reports Builder.
    for further information goto this link
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_concepts2.htm#sthref760

  • Oracle TopLink Object-to-XML - issue JAXBException: Provider not found...

    Env:
    OS:XP
    Java dev env: JDev 10.1.2 production
    Toplink Workbench - 10g Developer Preview 3 (10.1.3.0) build 041116
    I am attempting to use the toplink object to xml functionality through carefully following the tutorial titled Oracle TopLink Object-to-XML on OTN (link: http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/ox/index.htm)
    The first 11 steps are nice and clear and very easy to follow. However, when I hit 12 I run into problems. I believe I have done all I am required to do.
    My demo test code falls over on the attempting to create the JAXB context:
    JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model");
    The exception I get is:
    javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory not found
    - with linked exception:
    [java.lang.ClassNotFoundException: oracle.toplink.ox.jaxb.JAXBContextFactory ]
    The code is capable of loading the jaxb.properties file, and has toplink.jar in the classpath. I am able to create a is located JAXBContextFactory prior to calling the new instance logic, illustrating that the class is in the classpath.
    Using google I have seen it mentioned that the newInstance call could be making use of a different JVM to the Application (https://jaxb.dev.java.net/faq/#classloader) hence may not be able to pick up the JAXBContextFactory class. I have attempted to follow their advice of passing in a class loader - but this makes no difference.
    I.E. JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model", this.getClass().getClassLoader());
    Does anyone recognise this issue and have a solution.
    Here is my code:
    try
    File file = new File("D:\\Toplink\\demo\\Customer-data.xml");
    JAXBContext jaxbContext = JAXBContext.newInstance("examples.ox.model);
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    Customer customer = (Customer) unmarshaller.unmarshal(file);
    System.out.println(" customer.getFirstName() : "+customer.getFirstName());
    catch(Exception e)
    System.out.println("Error: "+ e.toString());
    As mentioned earlier it falls over on JAXBContext.newInstance("examples.ox.model);
    cheers
    Nick

    Hi Blaise,
    thanks for your response.
    My session.xml file is located:
    D:\Toplink\demo\classes\session.xml
    And contains:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <toplink-sessions version="10g Developer Preview 3 (10.1.3.0 )" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <session xsi:type="database-session">
    <name>examples.ox.model</name>
    <event-listener-classes/>
    <primary-project xsi:type="xml">D:/Toplink/demo/classes/CustomerProject.xml</primary-project>
    <login xsi:type="xml-login"/>
    </session>
    </toplink-sessions>
    My classpath references only jars downloaded with the links on the How To tutorial titled Oracle TopLink Object-to-XML on OTN (link: http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/ox/index.htm)
    This is the JDev output indicating the classpath and error:
    D:\Jdev1013Preview\jdk\bin\javaw.exe -ojvm -classpath D:\Toplink\demo\classes;D:\Toplink\lib\xml.jar;D:\Toplink\lib\xmlparserv2.jar;D:\Toplink\toplink\jlib\tljaxb.jar;D:\Toplink\toplink\jlib\toplink.jar examples.ox.model.RunDemo
    Error: javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory not found
    - with linked exception:
    [java.lang.ClassNotFoundException: oracle.toplink.ox.jaxb.JAXBContextFactory
    Process exited with exit code 0.
    Any more suggestions?
    In the meantime I will go through the information on the link that you have sent and see if I can get anyfurther.
    Thanks
    Nick
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HOW TO CONVERT PDF FILE IN TO XML FILE?

    HOW TO CONVERT PDF FILE IN TO XML FILE

    No Office programs can open a pdf and edit the contents so you will have to get a different app to convert teh pdf into xls format. There are plenty to be found on the web.
    Rod Gill
    The one and only Project VBA Book
    Rod Gill Project Management

  • How to convert oracle timestamp to java timestamp

    Hi,
    I need to convert oracle timestamp that i got from oracle database to java timestamp.I tried to use getTimestamp() to get timestamp value from oracle, but am getting NumberFormatException.
    Could any of suggest how to convert oracle timestamp to java timestamp.

    Thanks jverd ,
    then my code will be like:
    String oracleTS="11-MAR-05 11.19.20.625 AM";
    // am looking for yyyy-MM-dd HH:mm:ss format
    SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd
    HH:mm:ss");           
    Timestamp javaTimestamp=Timestamp.valueOf(oracleTS);
    System.out.println("javaTimestamp----->>
    "+javaTimestamp);
    ving java.lang.NumberFormatException: For input
    string: "MAR"Well, the SimpleDateFormat has to actually match the format you're trying to parse, for one thing. Then you have to actually USE the SDF, which you didn't.
    You really haven't made it clear what you're trying to do, and it doesn't appear that you bothered to study the links I provided.
    DateFormat df = new SimpleDateFormat("dd-MMM-yy HH.mm.ss.SSS aa");
    Date date = df.parse(oracleTS);
    Timestamp ts = new Timestamp(date.getTime());

  • How to convert Oracle Report Output to Excel Spread Sheet..

    Hello Sir,
    How to convert Oracle Report Output to Excel Spread Sheet..
    Thanks..

    Hello,
    Please give us more information what kind of report(s). Sample example etc.,
    Sri

  • How to convert oracle form fmb file to java swing file using Jdeveloper

    how to convert oracle form fmb file to java swing file using Jdeveloper.Please explain with detailes steps if possible or please give a link where it is available
    thanks
    Message was edited by:
    user591884

    There is no automatic way to do this in JDeveloper. I know there are some Oracle Partners offering forms to java conversion, I don't know how much of their tools are automated and done with JDeveloper. With JDeveloper+ADF you basically rewriting the Forms application from scratch (and using ADF is helpful during this process).

  • How to convert HL7 file into an XML

    Hi All,
    I am new to HL7,can any one tell how to convert HL7 file into an XML.Give sample demo or related links.
    My sample HL7 file is as follows how can I convert.
    FHS|^~\&||Tax ID123^Lab Name123^L|||201110191435||HL7.txt||1234567|123||
    PID|seqno|123||john^chambers^^Dr^Dr|2456 california ave^San jose^CA^85254|19601212|M
    FHS|^~\&||Tax ID123^Lab Name123^L|||File Creaqted Date|File Security|FileName||File HeaderComment||Facility|FileCreatedDateTime|File Security|File Name|File Header Comment|FileControlId|Reference File Control ID|
    PID|seqno|patientId||LastName^FirstName^MiddleName^Title^Degree|Street^City^State^zip|patientDOB|gender
    <Report>
    <FileHeader>
    <FileSendingApplication> </FileSendingApplication>
    <TaxID>Tax ID123</TaxID>
    <LabName>Lab Name123</LabName>
    <FileSendngFacilityType>L</FileSendngFacilityType>
    <FileReceivingApplication></FileReceivingApplication>
    <FileReceivingFacility></FileReceivingFacility>
    <FileCreatedDateTime>201110191435</FileCreatedDateTime>
    <FileSecurity></FileSecurity>
    <FileName>HL7.txt</FileName>
    <FileHeaderComment></FileHeaderComment>
    <FileControlId>1234567</FileControlId>
    <ReferenceFileControlID></ReferenceFileControlID>
    <FileHeader>
    <Patient>
    <seqno> </seqno>
    <patientId>Tax ID123</patientId>
    <LastName>Lab Name123</LastName>
    <FirstName>L</FirstName>
    <MiddleName></MiddleName>
    <Title> </Title>
    <Degree></Degree>
    <Street></Street>
    <City></City>
    <State>HL7.txt</State>
    <Zip></Zip>
    <patientDOB>1234567</patientDOB>
    <gender></gender>
    <Patient>
    </Report>
    Thanks
    Mani

    Hi Prabu,
    With input as in single line I'm able to get the the output but with the multiple lines of input,error was occured.Any suggestions.
    Error while translating. Translation exception. Error occured while translating content from file C:\temp\sampleHL7.txt Please make sure that the file content conforms to the schema. Make necessary changes to the file content or the schema.
    The payload details for this rejected message can be retrieved.          Show payload...
    Thanks
    Mani

  • How to convert Oracle database to XML standard?

    I have a project to convert oracle database to XML standard.And get it to show in webpage.Please tell me for do it.Tell about the way to do it.Tell me some kit to do it.

    Hi,
    otn says like this
    "You can use the XML SQL Utility to generate a DTD based on the schema of the underlying table being queried. You can use the generated DTD as input to the XML Class Generator for Java, which will generate a set of classes based on the DTD elements. You can then write Java code that use these classes to generate the infrastructure behind a web-based form. Based on this infrastructure, the web form will capture user data and create an XML document compatible with the database schema."
    use 'mlsql utility'
    regards
    raghavan

  • How to use oracle collection type with JDBC?

    I try to use oracle collection type in java program. So I made some package and java program, however Java program was not found "package.collectiontype"(JDBC_ERP_IF_TEST.NUM_ARRAY) . please, show me how to use this.
    Java Version : Java 1.4
    JDBC Driver : Oracle Oci Driver
    DB: Oracle 9i
    No 1. Package
    ===========================================
    create or replace package JDBC_ERP_IF_TEST AS
    type NUM_ARRAY is table of number;
    procedure JDBC_ERP_IF_ARRAY_TEST(P_NUM_ARRAY IN NUM_ARRAY, ERR_NO OUT NUMBER, ERR_TEXT OUT VARCHAR2);
    procedure TEST(ABC IN NUMBER);
    END JDBC_ERP_IF_TEST;
    ==================================================
    No 2. Package Body
    ===============================================
    CREATE OR REPLACE package BODY JDBC_ERP_IF_TEST is
    procedure JDBC_ERP_IF_ARRAY_TEST(p_num_array IN NUM_ARRAY,
    ERR_NO OUT NUMBER,
    ERR_TEXT OUT VARCHAR2) is
    begin
    ERR_NO := 0;
    ERR_TEXT := '';
    dbms_output.enable;
    for i in 1 .. p_num_array.count() loop
    dbms_output.put_line(p_num_array(i));
    insert into emp (empno) values (p_num_array(i));
    commit;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    ERR_NO := SQLCODE;
    ERR_TEXT := ERR_TEXT ||
    ' IN JDBC INTERFACE TEST FOR ORACLE ERP OPEN API..';
    ROLLBACK;
    RETURN;
    end JDBC_ERP_IF_ARRAY_TEST;
    procedure TEST(ABC IN NUMBER) IS
    begin
    insert into emp(empno) values (ABC);
    commit;
    end TEST;
    end JDBC_ERP_IF_TEST;
    ===============================================
    NO 3. Java Program
    ===============================================
    ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("JDBC_ERP_IF_TEST.NUM_ARRAY", getConnection());
    ARRAY array = new ARRAY(descriptor, getConnection(), arrs);
    cstmt = getConnection().prepareCall(LQueryFactory.getInstance().get("Meta/Basic/testJdbcErpArrayIf").getSql());
    cstmt.setArray(1, array);
    cstmt.registerOutParameter(2, Types.INTEGER);
    cstmt.registerOutParameter(3, Types.VARCHAR);
    ====================================================
    couldn't find this phase => JDBC_ERP_IF_TEST.NUM_ARRAY
    what can i do for this package and program? please help me..

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to convert oracle DDL to mysql DDL

    Dear friends,
    I have Oracle 9.2.0 DDL, (not complexity, no BLOB or CLOB data type, but have foreign key constrains), I want to convert it to mysql DDL, so I can create mysql database using this DDL. could someone give a hint of how to convert it? thank you very much in advance!
    besides, could some one tell me if I can get oracle 9.2.0 DDL through JDBC? how?
    thanks again!

    Hi Sammy,
    I'm not sure what you're looking for when you say you'd like to retrieve Oracle DDL. Would you like to know the table definitions (e.g., table names with associated column names and types)? I think java.sql.DatabaseMetaData might be able to help you out if that's what you mean.
    I usually just go into SQL*Plus and ask Oracle to describe the tables I need. But perhaps I'm not understanding you.
    Yes, I think it's best combine XDoclet and Hibernate. I've been adding XDoclet javadoc tags to my Java classes. There's an Ant task that generates the *.hbm.xml descriptor files for all my classes. There's another Ant task that will take those descriptors and put out the DLL for you. You can change from Oracle to MySQL just by changing the hibernate.properties file.
    I agree - Hibernate is terrific stuff. I hope it can help you. Sincerely, MOD

  • API for converting a Java object into XML?

    Do you know of any Java API that I could use to convert a Java
    object into its equivalent XML representation?
    For example if I have a class called "Foo" with variables va, vb
    and I have an instance of Foo with va having the value 1 and vb
    having the value 2, I would like be able to generate the
    following XML fragment:
    <Foo>
    <va>1</va>
    <vb>2</vb>
    </Foo>
    Thanks,
    -- Rob
    null

    Rob Tan (guest) wrote:
    : Do you know of any Java API that I could use to convert a Java
    : object into its equivalent XML representation?
    : For example if I have a class called "Foo" with variables va,
    vb
    : and I have an instance of Foo with va having the value 1 and
    vb
    : having the value 2, I would like be able to generate the
    : following XML fragment:
    : <Foo>
    : <va>1</va>
    : <vb>2</vb>
    : </Foo>
    : Thanks,
    : -- Rob
    There is none that I know of.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • How to convert oracle report in html form into excel form?

    Hi friends !! I m trying to convert oracle 10g report into excel form.Its coming in excel form but not with all formats.How to solve the problem?

    Hello,
    Please give us more information what kind of report(s). Sample example etc.,
    Sri

Maybe you are looking for

  • Set and Get parameters using SAP memory.

    I have an ALV grid list that I want to transfer to a detail report when the user doubleclicks.  I have set up a parameter transaction associated with the detail report.  My problem is the transfer does not take place.  After the "CALL TRANSACTION" th

  • Video playback on flash plugin is very bad

    This is double post from safari forum. I am not shure if this is a macbook, grapic card, safari or flash10 plugin isue. My guess is the grapich card. When I try to play a video made by Norwegian Broadcasting, it doesent play. It only shows purple noi

  • Folder size is not at the bottom of the folder when opened as in previous version,

    I have always like the feature that showed the size of items within any folder as shown from that screen. With Mountain Lion, I noticed that it does not show a bottom bar with the size of the folder. I have attempted numerous times to open this featu

  • Folder Action + Move Finder Items = Zero KB files

    I've got a folder action set that is supposed to run the Automator Action "Move Finder Items" on any file that gets placed in a specific folder (called "Folder A") and move it to "Folder B". I'm having an issue with larger files though. As soon as I

  • Is it possible to create 2 Date objects with different hashcode.

    Hi, I want to create 2 java.util.Date objects with different hashcodes. Is it possible?? Regards, Farooq