XML file manipulation question

I have to generate a big xml file from oracle relational tables, write the output to server and then load it back into a LOB field in the database.
1) I am on Oracle version 11.2.0.3
2) I am able to write the file to a server directory
Is it possible to zip the xml file using oracle preprocessor , read it and then load it back into the database on demand?
Thanks
Kev

Why not just store the XML in an XMLTYPE column in the DB. As you are on 11.2.0.3, you will be using the default storage format of SECUREFILE BINARY XML and that provides a compressed form of the XML that is easier for future parsing efforts. I can't speak how it would compare to a .zip version of the XML.
Without knowing more why you think LOBs need to be involved, I would avoid them completely since they are not setup for efficient XML storage/usage and the XMLType datatype is.
As for the .zip abilities, some good reference point (that started from)
[url http://odieweblog.wordpress.com/2012/01/28/xml-db-events-reading-an-open-office-xml-document-xlsx/]XML DB Events : Reading an Open Office XML document (.xlsx)
and eventually leads you to
[url http://technology.amis.nl/2010/03/13/utl_compress-gzip-and-zlib/]Utl_compress, gzip and zlib
[url http://technology.amis.nl/2010/06/09/parsing-a-microsoft-word-docx-and-unzip-zipfiles-with-plsql/]Parsing a Microsoft Word docx, and unzip zipfiles, with PL/SQL

Similar Messages

  • Xml file manipulation using XI file adapter

    my requirement is to change an attribute value in an xml file using XI.
    example
    <County InternalID="24581" Action="None">
    should be changed to
    <County InternalID="24581" Action="Insert">
    I have used Adapter specific attributes to get thesame file name, which is looking at the target folder,
    but the problem is
    once it reached the target foelder
    it looks like this
    <ns0:County InternalID="24581" Action="Insert">
    I donot need ns0:
    Any thoughts please.

    I have single xsd which I uploaded as External defintion, with names ED_source and ED_target in Repository
    after that directly I created Message interfaces( no Message Type, no DataType)
    I tried to remove namespace in repository, do I need to remove name space in the XSD itself and then upload it in repository.

  • Unable to recreate replica as I cannot delete the xml files for the old VM on Hyper-v Cluster

    My setup
    There are 2 sites each running a Hyper-v 2012-R2 cluster comprising of 5 nodes each.
    All the machines are in a HA state and stored on the shared clustered resource.
    Initially we had replication working and it was replicating all the servers from Site A to Site B
    There were some replication issues which needed me to stop the replication and redo it again, in doing so I firstly removed replication on Fail-over cluster manager on Site A and did the same on Site B.
    On one of the servers I had to remove the VM, although the VM config and Disks still remain on the Site B Cluster.
    I was trying to recreate the replica but it always fails with the following error :
    Hyper-v failed to enable replication for virtual machine xxxxxxxx operation aborted (0x80004004).....
    I followed an article to stop the Hyper-V Virtual Machine Management Service and try delete the file,
    When i tried to stop the service it would restart automatically and I was unable to delete the file. I put the service in disabled which kept it stopped however I was still unable to delete the files. I also tried to get File assassin which can help delete
    and clear locked files but it too was unable to delete it while the service was running or stopped as well as its additional mode whereby it will delete it on next reboot.
    The  Article Https://social.technet.microsoft.com/Forums/windowsserver/en-US/4c4f2535-81ee-4a21-a920-b5632de2be37/hyperv-old-vm-folders-cannot-be-deleted?forum=winserverhyperv
     makes mention of stopping another service Hyper-V
    Image Management Service but I am unable to find it on 2012-R2 server.
    I have also tried to put the additional nodes in a paused drained roles state leaving only one node as the active one but it still will not let me delete the VM config
    files, without removing those files I cannot re-initiate the Replication.
    Any assistance would be greatly appreciated.

    Can you storage migrate any other vms or resources off of the CSV that contains the XML file in question? If so you may be able to then take that CSV offline, remove it from available storage, re-add as available storage, and add to CSV Volumes. Maybe
    that will clear your lock. 

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • Getting question marks in html output when xml file has an mdash or rsquo

    I have a java servlet that gets an xml file out of ifs, applies
    a style sheet to it, and sends it to the browser as html.
    I have:
    DOMparser parser = new DOMParser();
    parser.parse(XmlUrl);
    The characters ampersand, greater than, less than, and
    apostrophe work fine.
    HOWEVER, When the xml file has an mdash(&#X2014) or a rsquo
    (&#x2019) in it, my html output in IE shows up with question
    marks where these characters are supposed to be.
    Does anyone know what I can do to fix this? I don't understand
    why it would work with some special characters and not others?

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • Manipulating  XML file using flex 2.0

    Hi,
    how to add contents in to xml file using flex 2.0, ie i
    actually wants to write data in to a xml file, so that data to be
    appended at the end of the file.
    Kumar

    You can't! Well, at least Flex cannot do this. All Flex can
    do is send this data -- any data -- to the server and it's up to
    you how you want to append this data to a file on the server.
    You see, flex can't write to local files. If you looking for
    client side file manipulation, take a look at Flex's desktop
    brother call AIR!
    ATTA

  • Display extended ascii characters as question mark in xml file

    I am creating a XML file with encoding as UTF-8. Some tag values contain some extended ascii characters. When i run the java program to create the file in windows, the extended ascii characters are display correctly. But in linux it is displaying as ?(question mark).
    i am not able to rectify this. can anyone help me....
    Its urgent
    Thanks in advance.
    Message was edited by:
    Rosy_Thomas@Java

    Probably the locale is not set for the shell you are running in. The default 'C' locale uses the ASCII encoding which defines only 128 characters. See if giving the commandexport LC_CTYPE=en_US.UTF-8before starting the program fixes the issue.

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Basic question, how to create rtf template with a given xml file

    Hello guys
    I am new to BI publisher and I am learning how to create rtf templates using given xml fiel definitions by following the bi publisher guide
    The steps I am following is:
    1, create template using template builders, which is downloaded into MS words.
    2, In the empty template, map the xml columns with template field using BI publisher tag
    3, upload the template to BI Publisher as a layout.
    That's all I can understand.
    My question is:
    1,in which above step do I import XML file into template builder (if not bi publisher), how to do so?
    2,After template is created, how to associate this template layout with existing reports in BI Publisher, or is it necessary at all?
    3,In the template content in MS Word template builder, what should I enter other than BI publisher tags for mapping XML field to desired template field
    Or, if my understand of this process is entirely wrong, what's the right process of creating rtf template with a given XML file definition
    Thanks

    If you have a BI Publisher desktop installed, have a look a the demos,.. should answer most of your basic questions.
    (Windows) Start->Programs->Oracle BI Publisher Desktop->Demos
    Invoice Demo - good one for those with E-Business Suite
    Report Demo - Sample using BI Publisher

  • Newbie Question: Gererating a mapping xml file

    How is castor used, if even, to generate the mapping xml files from the classes generated by castor from an xsd? I have a(n) xsd that has many complex types and this called for the generation of many castor classes from that xsd...so, using these class files...how do I generate a single mapping xml file?
    Here is the means by wich we use these two (the xsd and mapping file) in one of our methods?
    xmlWriter.write(req, res, someDetail, "someDetail.castor.xml",
    "someDetail.xsd");
    Prior to this, the xsd files were simple and I created the mapping file by hand. I don't know how this translates when there are so many classes that were generated by caster.
    Can someone point me in the direction of more information on how to create this mapping file from all of these classes?
    Any advice would be appreciated.
    -abe

    Can do... I have been working on a readme.install to this end.  One question about the pre_upgrade script.  /usr/share/pacman/proto.install states:
    ## arg 1:  the new package version
    ## arg 2:  the old package version
    #post_upgrade() {
      # do something here
    I'm confused by the arg 1 and arg 2.  Is it simply the version number with nothing else.
    EDIT: ok.. I get it,  Assign a variable to them to capture and check.
    # $1: The new package version
    # $2: The old package version
    post_upgrade() {
    NEW=`echo $1`
    OLD=`echo $2`
    if [ "$OLD" = "1.0.1" ]; then
    do something
    fi
    Last edited by graysky (2010-02-11 22:01:03)

  • QUESTION: Where do I find the sessions.xml file?

    I am using JD 10.1.3. I used CMP entity beans from tables to create my EJBs. I also created a local client for my entity bean. When I try to run my local client I get a bunch of errors. I have a sample of the errors, below. I have the following questions:
    1. How do you resolve these?
    2. I tried to uncomment the code from the local client that refers to sessions.xml. I am unable to locate this file. Where can I get a sample of this file?
    3. Can anyone point me to a sample code of CMP entity beans from tables and sessions.xml file?
    Many thanks.
    Kannan
    Local Exception Stack:
    Exception [TOPLINK-59] (Oracle TopLink - 10g release 3 (10.1.3.0.0) (Build 050912)): oracle.toplink.exceptions.DescriptorException
    Exception Description: The instance variable [demandClassCode] is not defined in the domain class [model.OeTransactionTypesAllBean], or it is not accessible.
    Internal Exception: java.lang.NoSuchFieldException: demandClassCode
    Mapping: oracle.toplink.mappings.DirectToFieldMapping[demandClassCode-->OE_TRANSACTION_TYPES_ALL.DEMAND_CLASS_CODE]
    Descriptor: RelationalDescriptor(model.OeTransactionTypesAllBean --> [DatabaseTable(OE_TRANSACTION_TYPES_ALL)])
         at oracle.toplink.exceptions.DescriptorException.noSuchFieldWhileInitializingAttributesInInstanceVariableAccessor(DescriptorException.java:1058)
         at oracle.toplink.internal.descriptors.InstanceVariableAttributeAccessor.initializeAttributes(InstanceVariableAttributeAccessor.java:78)
         at oracle.toplink.mappings.DatabaseMapping.preInitialize(DatabaseMapping.java:954)
         at oracle.toplink.mappings.foundation.AbstractDirectMapping.preInitialize(AbstractDirectMapping.java:468)
         at oracle.toplink.publicinterface.Descriptor.preInitialize(Descriptor.java:2355)
         at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:350)
         at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:331)
         at oracle.toplink.publicinterface.DatabaseSession.login(DatabaseSession.java:512)
         at model.OeTransactionTypesAllBeanClient.main(OeTransactionTypesAllBeanClient.java:35)
    Caused by: java.lang.NoSuchFieldException: demandClassCode
         at java.lang.Class.getDeclaredField(Class.java:1854)
         at oracle.toplink.internal.security.PrivilegedAccessController.findDeclaredField(PrivilegedAccessController.java:33)
         at oracle.toplink.internal.security.PrivilegedAccessController.findDeclaredField(PrivilegedAccessController.java:39)
         at oracle.toplink.internal.security.PrivilegedAccessController.getDeclaredField(PrivilegedAccessController.java:231)
         at oracle.toplink.internal.helper.Helper.getDeclaredField(Helper.java:771)
         at oracle.toplink.internal.descriptors.InstanceVariableAttributeAccessor.initializeAttributes(InstanceVariableAttributeAccessor.java:76)
         ... 7 more

    Hi,
    create a session bean and run this bean with the embedded OC4J or external OC4J. Create a local client for the session ben
    Frank

  • XML Publisher question - Not generating a valid XML file

    I am working through an Oracle document that walks you through creating an XML Pub report. I am using HCM 8.9, Tools 8.49.15 and it has XML Pub installed and I have the Microsoft plug-in installed
    I have created a query and have downloaded an rtf template and now am on a page where you enter your data source and then click ‘Generate’ for the sample data file. I did it and it created ‘PERSONAL_DATA_PAY.XML’ which is created from a PS Query. However if I click on ‘PERSONAL_DATA_PAY.XML’ it generates a blocky text file that is not an XML file and I can’t go any further.
    Do you know why it’s not generating a valid XML file when I click on 'generate'?
    Thanks
    Allen H. Cunningham
    Data Base Administrator - Oracle/PeopleSoft
    Sonoma State University

    You mean to say that you create a new data source by specifying Data Source Type as 'PS Query' and Data Source ID as your query name, you are not able to generate a valid XML file (by clicking on Generate link).
    did you cross check your query by running it?
    On field change of Generate link, PeopleSoft uses PSXP_RPTDEFNMANAGER and PSXP_XMLGEN app packagaes and query objects to create the file
    It should work if you query is valid..

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]<HR></BLOCKQUOTE>
    Use:
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    sav.setDateFormat(<hier the date format in the XML-File>);

  • XML Question for web.xml file for LiteWebServer

    Hi,
    I have no clue of wut tags are required in the web.xml file.
    Currently the following code is in my web.xml file and i am trying to run servlets that are located under web-inf/*.class
    Pls tell me wuts wrong....
    Do i need those mime-mapping tags, session and welcome tags.......... ?
    Right now i just want those 2 servlets to work
    And wut is this encoding ="UTF-8" in the first line of the xml file. Wut does that do... ? ARe there any others
    Any help would b greatly appreciated
    Thanks
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app id="WebApp_1">
    <display-name>PDMPortal</display-name>
    <session-config id="SessionConfig_1">
    <session-timeout>60</session-timeout>
    </session-config>
    <mime-mapping id="MimeMapping_1">
    <extension>htc</extension>
    <mime-type>text/x-component</mime-type>
    </mime-mapping>
    <welcome-file-list id="WelcomeFileList_1">
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>HelloWorldExample</servlet-name>
    <servlet-class>HelloWorldExample</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>HelloWorld</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>HelloWorldExample</servlet-name>
    <url-pattern>HelloWorldExample</url-pattern>
    </servlet-mapping>
    </web-app>

    Try putting your servlets in the WEB-INF\classes directory.

  • Help: question on send XML file from java client to java server

    Hi, I am now to Java, and now I am going to set up a simple network in the lab.
    I have created a random array of data and transferred to XML file on my client. Now, I would like to send it to the server. I am wondering how I can put the XML file into my client, and do I need any parser to let the server show what random date it has received?
    Anybody can give me any idea or some basic code? Thank you.
    Now, I am referring the KnockKnock example in Java online tutorial. But, not clear how to deal with the XML File.
    Fengyuan

    There are several ways you can achieve this: one could be that you transfer data over HTTP, using Servlets for instance. Have a Servlet listening on the Server with content type 'text/xml', POST the XML data to the server and have the Servlet to receive the data and re-compose the XML file. This can be achieved with different libraries:
    1) JAXB --> this is good because is the JDK standard, also for web services
    2) Castor (http://www.castor.org/)

Maybe you are looking for