Using XML in Oracle

Good Morning!
I wanted to insert some xml Data into my Orcale XML DB:
First of all I registered 2 Schemas required for the XML, like this:
Begin
DBMS_XMLSCHEMA.registerSchema(
schemaURL => 'Mailpiece_Processing/oif_dtypes',
schemaDoc => bfilename('XML_TEST','oif_dtypes.xsd'));
End;
then Created a table:
Create table XML_default auf XMLType
then inserted XML like this:
insert into xml_default
values
XMLTYPE
Bfilename ('XML_TEST', 'Test.xml'),
nls_charset_id('AL32UTF8'
Now to my question: Oracle is offering more than one possebility to save XML into its DB. If I import XML like this, is it called CLOB Storage or object relational?
Thanks in advance
runkel

Hi ,
I can only give u a few examples here but for the full sytanx and features of this powerful feature u may have to refer to some documentation online or read a book on XML within Oracle Database.
Let me try a few examples here
1) To extract the data from XML document an SQL plus command is available in XML DB. This feature is available from 10G onwards
example : select xmlelement(name,ename) from emp
Output will look like
<NAME>SMITH </NAME>
<NAME> JOHN </NAME>
<NAME> JONES </NAME>
2) CREATE TABLE FAMILIES (F_ID NUMBER(3), F_XML XMLTYPE);
insert into families values(1,xmltype('<XML.....>'));
or
insert into families values(1,''<XML>......' ));
Hope this helps !!!
Regards
Faiz

Similar Messages

  • Problem while using XML with Oracle

    I have a problem using XML with oracle applications
    The process I am following
    1. Making a XML string.
    2. Parsing it to get a document
    3. Free the parser using xmlparser.freeparser
    4. Traversing through nodes .
    5. Freeing the document.
    The whole Process is executed in batch mode.
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")
    Can you please help me out to overcome this problem
    It's urgent
    I have
    Oracle version 8.1.7.0.0
    XML version 1.2
    OS Windows NT
    To resolve the problem I have increase shared memory size and java initialization parameters ,which seems OK
    Looking forward for your answer.

    Hello, Reena
    Your process flow seems to be correct in term of getting/freeing memory.
    Following error
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")may be caused by memory leaks in xdk or memory fragmentation(due to get/free memory cycle)
    To find out if this is an memory leak issue you could try to monitor V$SGASTAT from one session while running your batch process in another session.
    To prevent (or lower its impact) fragmentation issues try to PIN objects, and adjust java_pool_size and shared_pool_reserved_size.
    Anyway, counsult your Oracle DBA.
    Oracle version 8.1.7.0.0I think, you should apply database patch first of all. The latest one (8.1.7.4.x) could be accured from Metalink.

  • Oracle  - Using XML in Oracle/ SORRY double Post

    SORRY for double Post!
    Good Morning!
    I wanted to insert some xml Data into my Orcale XML DB:
    First of all I registered 2 Schemas required for the XML, like this:
    Begin
    DBMS_XMLSCHEMA.registerSchema(
    schemaURL => 'Mailpiece_Processing/oif_dtypes',
    schemaDoc => bfilename('XML_TEST','oif_dtypes.xsd'));
    End;
    then Created a table:
    Create table XML_default auf XMLType
    then inserted XML like this:
    insert into xml_default
    values
    XMLTYPE
    Bfilename ('XML_TEST', 'Test.xml'),
    nls_charset_id('AL32UTF8'
    Now to my question: Oracle is offering more than one possebility to save XML into its DB. If I import XML like this, is it called CLOB Storage or object relational?
    Thanks in advance
    runkel
    Message was edited by:
    user623693
    Message was edited by:
    user623693

    Hi ,
    I can only give u a few examples here but for the full sytanx and features of this powerful feature u may have to refer to some documentation online or read a book on XML within Oracle Database.
    Let me try a few examples here
    1) To extract the data from XML document an SQL plus command is available in XML DB. This feature is available from 10G onwards
    example : select xmlelement(name,ename) from emp
    Output will look like
    <NAME>SMITH </NAME>
    <NAME> JOHN </NAME>
    <NAME> JONES </NAME>
    2) CREATE TABLE FAMILIES (F_ID NUMBER(3), F_XML XMLTYPE);
    insert into families values(1,xmltype('<XML.....>'));
    or
    insert into families values(1,''<XML>......' ));
    Hope this helps !!!
    Regards
    Faiz

  • Can I use XML in Oracle 8.1.7?

    Hi there,
    Just wanna know is it possible to select the data from the table to XML file? Or can I export the data as XML?
    Version: Oracle8i Enterprise Edition Release 8.1.7.4.0
    Please help!
    Thanks,
    Abraham

    Thanks.
    I found that there's a tool - PLSXML :
    http://otn.oracle.com/tech/xml/htdocs/plsxml/xml4plsql.htm

  • 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.

  • Ascii to xml to oracle

    My name is robert and I am a PhD student at UCLA. I am a novice in using XML and Oracle. I would like to know what utilities and/or drivers I need to go from ascii to xml to oracle.
    I am using Oracle 8, Windows 2000 and Ie5. Any suggestions would be greatly appreciated.
    Thanks,
    Robert

    May I know what delimiters are you using? Seems like payload is not UTF-8 encoded and hence SOA is not able to understand the character. Make sure that payload is UTF-8 encoded.
    Regards,
    Anuj

  • Printing Arabic text in Oracle Application(R12i) using XML Publisher.

    Hi,
    I am using Oracle Application R12i version with Oracle database as 10g, base language as English and installed language as Arabic.
    I am trying to print the data which is there in English/Arabic in Oracle Application(using XML Publisher).
    I've created a rdf using Report Builder 10g and registered as concurrent program (XML as Output format). There after i executed the concurrent program and generated the XML file.
    Based on the XML file, i created a rtf file using XML Desktop(in Ms word) and register the same rtf file in XML Publisher Administrator for creating the XML definition and Template and Output as PDF.
    After creating a XML template, when i executed the Concurrent program, english text is shown in english but arabic text is shown some ascii characters like Question Mark(up side down).
    Could anyone please let us know the steps for doing the same or plz let us know are we missing any step.
    Quiet urgent.
    You could also reply to [email protected]
    Thanks in advance
    Your help will be appreciated.
    Edited by: user10772035 on Aug 20, 2009 10:23 PM

    Same Problem here, if you are able to solve it, please also help me.

  • Use of XML in Oracle 10G

    Hi,
    I am using Oracle 10 G.
    i am having a scenario that, I am getting 2 files as input. I have do full outer join on some columns.
    Prior I don't know on what columns I am going to apply join. The input file structure may changes.
    I would like to configure these type of scenario.
    I thought, I can acheive this using XML.
    So, Can we do this using Oracle XML?
    Any suggestion or help would be appreciated greatly.
    Thanks in advance.
    Thank you,
    Regards,
    Gowtham Sen.

    Thanks Billy.
    Yes you are right.
    Here why I discarded that option is,
    I may get the source files with changing layouts.
    My Actual scenario is as follows.
    Initially we developped all the things using PL/SQL packages. Its working fine.
    But as per the inputs we received from requirements group, the file structure changes dynamically. and we would able to consider those new columns also. We should be able to changes the rules dynamically.
    Lets say, we doing fullouter join on Src_A and Src_B. on columns col1_A and col1_B.
    Now the requirement changes in a way that, the join should be done on Src_A and Src_C. on columns col1_A and col_C.
    For this I need to define a new package.
    Instead of that, I would like to do everything dynamically based on configuration parameters given as input.
    Thank you,
    Regards,
    Gowtham Sen

  • Using XML DB with Oracle Drive as Webdav client

    Hi all -
    I'm looking into using XML DB (10g) to store files so we can query their content via SQL/XPATH and then access/edit them via Webdav.
    Windows Vista makes this easy, since it can map a drive to a Webdav URL. Mac OSX can do a similar thing.
    Windows XP however can't do the drive mapping for WebDav on a port other than port 80, which is our setup.
    So I tried out Oracle Drive, which I stumbled across on some site somewhere, and it worked. But it was an old version, so I downloaded the "official" version from Oracle, which is v10.2.0.0.22. This version refuses to connect to XML DB no matter what I do. I've fiddled with authentication, proxies, and so on (there are several posts elsewhere with hints on this) but so far no joy.
    Has anyone had any experience making the latest version of Oracle Drive talk to XML DB?
    Many Thanks

    Thanks for replying.
    Yes, we may decide to move XML DB to port 80, but there are other services running on our server and such a move would be a significant hassle.
    As for Windows XP, it is not possible to do this: net use * http://server:8080/public
    This works on Vista, but it only works on XP if you use port 80.
    Note that XP has TWO built in Webdav clients: Web Folders (= Network Places) which is a feature in Explorer, and the Webdav Mini-Director which works at the file-system level. I don't think Web Folders can work for us since we need to be able to create a real filepath to give to our editor application. Maybe I'm wrong on that, but I can't figure it out.
    Oracle Drive seems to be a great solution, but I can't make the most recent version work (the old version worked but was buggy).
    Edited by: user10775425 on Jan 9, 2009 12:03 AM

  • Exp/imp using xml files in oracle 9i

    hello,
    I need to export tables data (only) from oracle 9i DB into xml files, and the import the xml file into another oracle 9i DB.
    I can't use any other format then XML.
    can you tell me what is the best way for doing that?
    thanks.

    If the source and the target DB of the operation are both Oracle 9i, you should use export/import. This is an one-stop operation.
    Otherwise you would need to build your own tools, using XMLQuery in Oracle 9i, which is a waste of time and resources.
    Sybrand Bakker
    Senior Oracle DBA

  • Generating multi-level XML in Oracle 8i using XML-SQL utility

    Oracle 8i has a limitation when it comes to the object types. Only one-level nesting of collection is allowed. Oracle 9i apparently removes this limitation.
    I am trying to generate XML for a hierarchical (conceptually) structure. To do that I am using XML-SQL utility (XSU) running agains an object view build on top of the relational data. The problem is the limit to onelevels of colelction nesting. Oracle 8i gives you a way to create a view with more levels of nesting by using references (REF). The problem is that when XSU runs agains a view with the references, it inserts the references into the XML document (instead of dereferencing them).
    Is there a way to generate XML with Oracle 8i with more than two levels of collection nesting?
    Thank you.
    Michael

    Oracle 8i has a limitation when it comes to the object types. Only one-level nesting of collection is allowed. Oracle 9i apparently removes this limitation.
    I am trying to generate XML for a hierarchical (conceptually) structure. To do that I am using XML-SQL utility (XSU) running agains an object view build on top of the relational data. The problem is the limit to onelevels of colelction nesting. Oracle 8i gives you a way to create a view with more levels of nesting by using references (REF). The problem is that when XSU runs agains a view with the references, it inserts the references into the XML document (instead of dereferencing them).
    Is there a way to generate XML with Oracle 8i with more than two levels of collection nesting?
    Thank you.
    Michael

  • Using XML extraction from Oracle and XSLT data transformation

    Hi
    How can transfer data ie: Using XML extraction from Oracle and XSLT data transformation with java application?
    usually i use to do querying sql, getting data from table assinging to model class then send it to UI. how can i go for XML extraction form oracle?
    thanks

    Sorry, I don't understand what exactly you want to do. And I'm under the impression that you might not know exactly what you want to do as well. Could you explain a bit more detailed what you want to achieve?

  • Accessing Oracle 7.3 database using XML-RPC

    Hi All
    I am a beginner to XML. I am looking for a solution to access my database oracle 7.3 using XML-RPC. Has anybody already tried to do this. Please! Could anybody help me by giving a tip?
    Thanks.
    Marcelo R. Braga.
    Sao Jose dos Campos - Brazil.

    You should check in 9iAS XML-RPC support in mid-tier

  • How to achive in this data in oracle using xml tag ?

    hi All ,
    i am using sql 3.1
    i have one question that how can i achieve this below XML tag using XML query. this below  whatever i am showing here data is one table . how can i achieve this things using XML tag like xml forest or whatever may be
    please help me .
    ---code
    <Metadata>
    <Dept Deptno="10">
      <Name>Administration</Name>
      <Location>Seattle</Location>
      <Employees>
       <Emp empid="200">
        <FirstName>Jennifer</FirstName>
        <LastName>Whalen</LastName>
       </Emp>
      </Employees>
    </Dept>
    <Dept Deptno="20">
      <Name>Marketing</Name>
      <Location>Toronto</Location>
      <Employees>
       <Emp empid="201">
        <FirstName>Michael</FirstName>
        <LastName>Hartstein</LastName>
       </Emp>
       <Emp empid="202">
        <FirstName>Pat</FirstName>
        <LastName>Fay</LastName>
       </Emp>
      </Employees>
    </Dept>
    </metadata>
    Thanks
    Damby

    please reply

  • New to XML and Oracle

    Just trying to clarify some issues as I try and learn about XML, and specifically how it integrates into the DB.
    1 - Is there a way with Oracle tools for me to get an XSD of an existing 9i relational schema? We are not currently using the XML DB, but our middleware developers would like to have an up to date XSD to use for their internal mapping.
    2 - Is there any way that I can keep that XSD up-to-date automatically, so I get a new one whenever the schema gets updated?
    3 - If I wanted to investigate storing XML docs within the DB in native XML format, I need to have an XML DB, correct? Is this DB construct maintained seperatelly from my "normal" relational schema? or are they kept in sync by Oracle?
    I know these may all be real basic questions, but as I said, I'm new to XML and Oracle. I am reading as much as I can, but there are a lot of docs out there.
    Thanks,
    Mike

    Hi
    1. On my opinion such a tool doesn't exists. Some parts can be implemented elsewhere, but not as described by you... e.g. with XSU if you specify the parameter "withschema" the XSD of the executed statement is generated. Another example is to use DBMS_METADATA to dump the data dictionary in XML (but not XSD, of course you could write your own XSLT to do this transformation...).
    2. -
    3. If you use XSD-based tables the XSD and the relational model are stored separately in the data dictionary. Therefore if you change the XSD you have to drop/create the XSD-based table... no schema evolution yet.
    Chris

Maybe you are looking for