Urgetnt:Generate XML Document from Oracle Tables.

Environment is :9i Release 2
Requirement : Generate XML document from the data which is vailable in Oracle tables at client location.
Could some body help me on how to get ahead on this.
Thanks in advance,
Kumar.

Implimentation in PowerBuilder7(Source is experimental.. need optimization):
kml_store = create datastore
selectblob kml into :kml_result from (select get_kml(:querry_type,:tmp_querry_value,1) as kml from dual) using sqlca;
if sqlca.sqlcode=100 then
MessageBox("INFO","No data found");
return false;
end if
if sqlca.sqlcode = -1 then
     MessageBox("INFO","Error in generating KMl file");
     return false
end if
li_FileNum = FileOpen("test.kml",StreamMode!, Write!, LockWrite!, Replace!);
b_len=Len(kml_result)
b_len=64244;
/*inserting in file :)*/
DO WHILE b_pos<=b_len
     s_pipe=String(BlobMid(kml_result,b_pos,i_str_len))
     ret = FileWrite(li_FileNum,s_pipe);
     s_pipe="";
     b_pos=b_pos+i_str_len;
LOOP
FileClose(li_FileNum);
Message was edited by:
user601564

Similar Messages

  • Generate XML Schema from oracle tables

    I am new to xml...We have a requirement to generate xml schemas for one or more oracle tables...Are there any tools availaible in oracle?.....I have tried xml spy which generates the schema but i want it like a batch process probably without user intervention...

    An XML document may be generated from a database table with XSU.
    http://www.devx.com/xml/Article/32046

  • Xml document to oracle tables - data is not fatching

    Hello,
    I am new to xml and trying to extract some fields from xml document to oracle tables to use them further in application. I have written following to extract values but nothing is fatching from document:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <dmsgo:DMS_GO_Interface xmlns:dmsgo="https://globalordering.daimler.com/start/dms/interface/DMS_GO_Interface/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://globalordering.daimler.com/start/dms/interface/DMS_GO_Interface/v1 DMS_GO_Interface_v1.xsd">
    <dmsgo:majorversion>1</dmsgo:majorversion>
    <dmsgo:identity context="CONFGOFR_OUT" datetimecreated="01/03/2011 10:51" source="go" sourceversion="1.410.1" />
    - <dmsgo:prospect>
    <dmsgo:requestresponse code="0" />
    <dmsgo:references />
    - <dmsgo:configurationcontext dataversion="2163" languageiso="en" orderingmarket="867" saleslevel="R">
    <dmsgo:configurationdate>01/03/2011</dmsgo:configurationdate>
    </dmsgo:configurationcontext>
    - <dmsgo:vehicle>
    <dmsgo:variant baumuster="2120482" manufacturercode="2120482" />
    <dmsgo:desc>E 200 CGI BlueEFFICIENCY Sedan RHD</dmsgo:desc>
    - <dmsgo:colorcombination>
    <dmsgo:interiorcolor codeowner="C" manufacturercode="4201" ppmtype="AU">Leather black</dmsgo:interiorcolor>
    <dmsgo:exteriorcolor codeowner="C" manufacturercode="2497" ppmtype="LU">Cuprite brown metallic</dmsgo:exteriorcolor>
    <dmsgo:paintzone manufacturercode="" preference="2" />
    </dmsgo:colorcombination>
    INSERT INTO p1 (flux_name, elment_1, elment_2, elment_3)
    SELECT flux_name, elment_1, elment_2, elment_3
    FROM XMLTable(
    XMLNamespaces ('https://globalordering.daimler.com/start/dms/interface/DMS_GO_Interface/v1' as "dmsgo"),
    'dmsgo:DMS_GO_Interface/prospect/vehicle'
    passing xmltype(bfilename('DMLDIR','prospect.xml'), nls_charset_id('CHAR_CS'))
    columns
    flux_name varchar2(20) path 'dmsgo:variant/@baumuster',
    elment_1 varchar2(20) path 'dmsgo:desc',
    elment_2 varchar2(20) path 'dmsgo:colorcombination/interiorcolor',
    elment_3 varchar2(20) path 'dmsgo:colorcombination/interiorcolor/@manufacturercode'
    Please help.
    Looking forward to early response.
    Thanks
    Usman

    Hi,
    You're missing the namespace prefix on some elements.
    This should work :
    SQL> SELECT flux_name, elment_1, elment_2, elment_3
      2  FROM XMLTable(
      3    XMLNamespaces ('https://globalordering.daimler.com/start/dms/interface/DMS_GO_Interface/v1' as "dmsgo"),
      4    'dmsgo:DMS_GO_Interface/dmsgo:prospect/dmsgo:vehicle'
      5    passing xmltype(bfilename('DMLDIR','prospect.xml'), nls_charset_id('CHAR_CS'))
      6    columns
      7      flux_name varchar2(20) path 'dmsgo:variant/@baumuster',
      8      elment_1  varchar2(40) path 'dmsgo:desc',
      9      elment_2  varchar2(20) path 'dmsgo:colorcombination/dmsgo:interiorcolor',
    10      elment_3  varchar2(20) path 'dmsgo:colorcombination/dmsgo:interiorcolor/@manufacturercode'
    11  );
    FLUX_NAME            ELMENT_1                                 ELMENT_2             ELMENT_3
    2120482              E 200 CGI BlueEFFICIENCY Sedan RHD       Leather black        4201

  • Generate PDF documents from Oracle PL/SQL

    Hi All,
    we are working on a PL/SQL project, named PL/PDF, for generate PDF documents from Oracle PL/SQL language. We are looking for PL/SQL programmers for beta testing. If you are an enquirer in this topic, please send an email to [email protected]
    Thanks,
    LL

    You will need to use form fields. You may be able to use adjustible size form fields in Designer. You might try to ask in the Designer forum for help.

  • To generate XML output from Oracle Apps 11

    Hi Anyone has the experience to generate the output from Oracle Apps 11 as XML file? Database is 8.17, Oracle Apps 11. The concurrent program can be written in PL/SQL or can report 2.5 generate the output as XML?
    The scenario is:
    1) Run a concurrent program in Oracle Apps 11
    2) Output generated is XML (.xml)
    Regards.

    This forum is for Oracle XML DB features. XML DB is only available as of database 9iR2.
    You may be better off in legacy XML Features forum...
    PL/SQL XML Programming

  • Generate PDF file from oracle Table

    We need to populate pdf file into oracle table of column blob through informatica by taking
    path\name(/path/filename.PDF) as input from source table.
    The pdf file is on some other server so, we need to create a stored procedure which will give pdf file as output from
    other server by taking path\name from source table column as mentioned above.
    So please suggest how we can create a stored procedure for that purpose.
    If possible please share some script.

    Dear all,am new to oracle report and oracle forms and i know the
    basics how to generate the report and to create the form, Now my doubt is, like generating report
    from oracle report how to generate the report from oracle from,should i add any command button? and where
    to add the coding and what coding ? when i click that command button the report should be generated like oracle
    report,what should i do?Please help me to learn.
    my table name is 'student' and it has the following columns,
    sid,sname,grade,result.
    Am using oracle from 10.1.2.0.2 version and
    oracle report version is 10.1.2.0.2.
    Please give step by step procss.
    Thank you.

  • Generating xml file from database table

    Could anyone please explain how to generate a xml file from a database table.examples will be highly appreciated.
    thanks in advance

    See the release notes for our XSQL Pages component of the Java XDK for a tutorial. There are also lots of examples in Building Oracle XML Applications.
    You use the XML SQL Utility component to accomplish the task. It's part of our Java XDK that you can download from http://otn.oracle.com/tech/xml

  • Need help for SQL SELECT query to fetch XML records from Oracle tables having CLOB field

    Hello,
    I have a scenario wherein i need to fetch records from several oracle tables having CLOB fields(which is holding XML) and then merge them logically to form a hierarchy XML. All these tables are related with PK-FK relationship. This XML hierarchy is having 'OP' as top-most root node and ‘DE’ as it’s bottom-most node with One-To-Many relationship. Hence, Each OP can have multiple GM, Each GM can have multiple DM and so on.
    Table structures are mentioned below:
    OP:
    Name                             Null                    Type        
    OP_NBR                    NOT NULL      NUMBER(4)    (Primary Key)
    OP_DESC                                        VARCHAR2(50)
    OP_PAYLOD_XML                           CLOB       
    GM:
    Name                          Null                   Type        
    GM_NBR                  NOT NULL       NUMBER(4)    (Primary Key)
    GM_DESC                                       VARCHAR2(40)
    OP_NBR               NOT NULL          NUMBER(4)    (Foreign Key)
    GM_PAYLOD_XML                          CLOB   
    DM:
    Name                          Null                    Type        
    DM_NBR                  NOT NULL         NUMBER(4)    (Primary Key)
    DM_DESC                                         VARCHAR2(40)
    GM_NBR                  NOT NULL         NUMBER(4)    (Foreign Key)
    DM_PAYLOD_XML                            CLOB       
    DE:
    Name                          Null                    Type        
    DE_NBR                     NOT NULL           NUMBER(4)    (Primary Key)
    DE_DESC                   NOT NULL           VARCHAR2(40)
    DM_NBR                    NOT NULL           NUMBER(4)    (Foreign Key)
    DE_PAYLOD_XML                                CLOB    
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    SELECT
    j.op_nbr||'||'||j.op_desc||'||'||j.op_paylod_xml AS op_paylod_xml,
    i.gm_nbr||'||'||i.gm_desc||'||'||i.gm_paylod_xml AS gm_paylod_xml,
    h.dm_nbr||'||'||h.dm_desc||'||'||h.dm_paylod_xml AS dm_paylod_xml,
    g.de_nbr||'||'||g.de_desc||'||'||g.de_paylod_xml AS de_paylod_xml,
    FROM
    DE g, DM h, GM i, OP j
    WHERE
    h.dm_nbr = g.dm_nbr(+) and
    i.gm_nbr = h.gm_nbr(+) and
    j.op_nbr = i.op_nbr(+)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++
    I am using above SQL select statement for fetching the XML records and this gives me all related xmls for each entity in a single record(OP, GM, DM. DE). Output of this SQL query is as below:
    Current O/P:
    <resultSet>
         <Record1>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <DM_PAYLOD_XML1>
              <DE_PAYLOD_XML1>
         </Record1>
         <Record2>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML2>
              <DM_PAYLOD_XML2>
              <DE_PAYLOD_XML2>
         </Record2>
         <RecordN>
              <OP_PAYLOD_XMLN>
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XMLN>
         </RecordN>
    </resultSet>
    Now i want to change my SQL query so that i get following output structure:
    <resultSet>
         <Record>
              <OP_PAYLOD_XML1>
              <GM_PAYLOD_XML1>
              <GM_PAYLOD_XML2> .......
              <GM_PAYLOD_XMLN>
              <DM_PAYLOD_XML1>
              <DM_PAYLOD_XML2> .......
              <DM_PAYLOD_XMLN>
              <DE_PAYLOD_XML1>
              <DE_PAYLOD_XML2> .......
              <DE_PAYLOD_XMLN>
         </Record>
         <Record>
              <OP_PAYLOD_XML2>
              <GM_PAYLOD_XML1'>
              <GM_PAYLOD_XML2'> .......
              <GM_PAYLOD_XMLN'>
              <DM_PAYLOD_XML1'>
              <DM_PAYLOD_XML2'> .......
              <DM_PAYLOD_XMLN'>
              <DE_PAYLOD_XML1'>
              <DE_PAYLOD_XML2'> .......
              <DE_PAYLOD_XMLN'>
         </Record>
    <resultSet>
    Appreciate your help in this regard!

    Hi,
    A few questions :
    How's your first query supposed to give you an XML output like you show ?
    Is there something you're not telling us?
    What's the content of, for example, <OP_PAYLOD_XML1> ?
    I don't think it's a good idea to embed the node level in the tag name, it would make much sense to expose that as an attribute.
    What's the db version BTW?

  • Generate XML file from DB table

    Hi all,
    I am trying to retrieve data from a DB table and generate an XML file.
    I am using Oracle8i and IIS 4.0. I have downloaded XML parser for PL/SQL and XSQL Servlet. Also I have Jrun to enable IIS to process Jservlets
    Here are my questions,
    1. Do I need any other software ?
    Also do I need both XML parser for PL/SQL and XSQL Servlet ??
    2. What is the next step I should do ?
    Please help me. Thanks in advance.
    Vikki

    You downloaded the wrong XML Parser!
    XSQL requires Java Parser. Well, there's a copy included with the XSQL package so you actually don't need to do another download.
    You really don't need XSQL if you just want a XML file from DB, you just needed a XML SQL Utility. Download that and run the samples.

  • Generate XML Schema from Oracle Database

    Is there a utility that would allow our team to generate XML Schemas directly from existing Oracle databases? Or do you have a suggestion on how to achieve this?
    Thank you.

    Hey, The Schema Processor is available in the Technologies section on this site. Just download it and see the samples. You will get the way for doing it. If you are having problems then just call me.
    Bye.
    null

  • How to generate XML file from oracle database query result

    Hi dudes,
    as stated on the subject, can anyone suggests me how can i achieve the task stated above??
    Here is a brief description of my problem:
    I need to create a XML file once i query from the oracle database, and the query result returned from the database will be stored in XML file.
    I'd searched around the JAXB, DOM, SAXP and the like basic concepts, but i still don't know how to start??
    Any suggestions ???

    Read this:
    http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
    You might have to read more of the book to understand that chapter.

  • XML in Oracle 9i (best method to return a xml file from a table query)

    Hello.
    What is the best method to query a table, or set of tables (that will return thousands of rows) using xml in oracle? (best performance)
    I'm currently using DBMS_XMLGen, is there a better method ?

    I think, if your talking about generating XML, that you should use XMLElement, XMLForest, etc. to create your XML.
    Lets assume that you base is relational data, then maybe the following great example will give you an idea how to do it : Re: Generate XML Schema from oracle tables
    As michaels pointed out (did you read the link/ URL given?), the general expectancy is that the packages will be less and less important. So also maintenance wise the XMLElement, etc way will be the best, also for the future, maintainable method.

  • Generating xml from oracle table

    Hi,
    I want to generate xml form an oracle table and using sql developer, oracle express 10g, xdk forler is also unzipped under oracle express folder, still getting following error: code used
    var g_clob clob;
    declare
         l_ctx  dbms_xmlquery.ctxHandle;
         l_clob clob;
        begin
          l_ctx := dbms_xmlquery.newContext('select * from scott.emp');
          dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
          :g_clob := dbms_xmlquery.getXml(l_ctx);
        end;
        /ORA-06550: line 2, column 14:
    PLS-00201: identifier 'DBMS_XMLQUERY.CTXHANDLE' must be declared
    Thanks in advance

    Hi,
    DBMS_XMLQUERY is a wrapper for methods from the Java class "oracle.xml.sql.query.OracleXMLStaticQuery".
    The problem is that Oracle 10g XE doesn't have a JVM, so you can't use this package.
    Use DBMS_XMLGEN instead, it provides similar functionalities and is more efficient (C-based) :
    SQL> var g_clob clob
    SQL> DECLARE
      2    l_ctx    dbms_xmlgen.ctxHandle;
      3  BEGIN
      4    l_ctx := dbms_xmlgen.newContext('select * from scott.emp');
      5    :g_clob := dbms_xmlgen.getXML(l_ctx);
      6    dbms_xmlgen.closeContext(l_ctx);
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SQL> set long 5000
    SQL> set pages 1000
    SQL> print g_clob
    G_CLOB
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7902</MGR>
      <HIREDATE>17/12/80</HIREDATE>
      <SAL>800</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>20/02/81</HIREDATE>
      <SAL>1600</SAL>
      <COMM>300</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>22/02/81</HIREDATE>
      <SAL>1250</SAL>
      <COMM>500</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7566</EMPNO>
      <ENAME>JONES</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>02/04/81</HIREDATE>
      <SAL>2975</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7654</EMPNO>
      <ENAME>MARTIN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>28/09/81</HIREDATE>
      <SAL>1250</SAL>
      <COMM>1400</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7698</EMPNO>
      <ENAME>BLAKE</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>01/05/81</HIREDATE>
      <SAL>2850</SAL>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09/06/81</HIREDATE>
      <SAL>2450</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17/11/81</HIREDATE>
      <SAL>5000</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7844</EMPNO>
      <ENAME>TURNER</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>08/09/81</HIREDATE>
      <SAL>1500</SAL>
      <COMM>0</COMM>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7900</EMPNO>
      <ENAME>JAMES</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7698</MGR>
      <HIREDATE>03/12/81</HIREDATE>
      <SAL>950</SAL>
      <DEPTNO>30</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7902</EMPNO>
      <ENAME>FORD</ENAME>
      <JOB>ANALYST</JOB>
      <MGR>7566</MGR>
      <HIREDATE>03/12/81</HIREDATE>
      <SAL>3000</SAL>
      <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7934</EMPNO>
      <ENAME>MILLER</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7782</MGR>
      <HIREDATE>23/01/82</HIREDATE>
      <SAL>1300</SAL>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>Or, using SQL/XML functions :
    SELECT XMLElement("ROWSET",
             XMLAgg(
               XMLElement("ROW",
                 XMLForest(empno, ename, job, mgr, hiredate, sal, comm, deptno)
           ).getClobVal()
    FROM scott.emp
    ;

  • Generate XML File from table

    How to generate XML file from a table without using UTL_FILE that too in local machine...

    You downloaded the wrong XML Parser!
    XSQL requires Java Parser. Well, there's a copy included with the XSQL package so you actually don't need to do another download.
    You really don't need XSQL if you just want a XML file from DB, you just needed a XML SQL Utility. Download that and run the samples.

  • Using "XML Document from XML Schema" in JDeveloper

    Hi Experts,
    I have a requirement to generate XML Document from XML Schema.
    For this I have used "XML Document from XML Schema" feature in JDeveloper. It is found in File->New->General->XML Document form XML Schema.
    I have registered a schema with jdev and got an XML document output for that successfully.
    Now, I want to implement this feature in my code for generating XML documents when XSD files are provided.
    Can any one please provide me with pointers to do that? I am sure there should be some libraries which can implement this feature.
    Thanks,
    Dilbagh

    Create an XML document from a Schema with the Oracle SchemaClassGenerator.
    import oracle.xml.classgen.SchemaClassGenerator;
    XMLSchema schema=new XMLSchema();
    XSDBuilder builder = new XSDBuilder();
    URL    url =  new URL(schemaUrl);     
    schema = (XMLSchema)builder.build(url);
    SchemaClassGenerator generator = new SchemaClassGenerator();
    Generate the Java classes from the example XML Schema.
    generator.generate(schema);With the java classes construct an XML document.

Maybe you are looking for

  • Replacing two full external hard drives and keeping Lightroom 5 happy. Help please!

    I use two external hard drives for storing photos and Lightroom backups - I do not have any photos stored on my Mac. As a result, they are almost full (25000 images) and I need to replace them with two higher capacity devices. I don't really know how

  • Ipad new3 does not appear as device in itunes but ipod touch does

    ipad appears in windows computer but not in itunes

  • Importing Date Class

    Hi,           I am importing java.util.* and java.sql.timestamp (not java.sql.*)           and defining a variable of type Date say :-           Date date;           It complains saying: Ambiguous class definition: java.util.Date vs           java.sq

  • First page prints higher than others

    I'm modifying a check RTF template for EBIS R12 that was given to me and I've been able to get everything working except for one thing - the first page of output prints one line higher than all the rest. Has anyone ever experienced this before? I'm q

  • Snow Leopard default color profile

    I seem to have lost the original color profile file while trying to calibrate my screen... How can I get it back? Can I download it somewhere?