Insert Encoding tag into xml file. ?xml version="1.0"?

I am using oracle 10g.
I am using dbms_xmlgen.getxml function to generate xml data for oracle tables. I use utl_file to write data back into xml file.
Oracle is generating the file in the following manner...
<?xml version="1.0"?>
<ROWSET>
<ROW>
<RSLT_ID>1</RSLT_ID>
</ROW>
</ROWSET>
I want to change the following xml header to have encoding information in it as follows...
<?xml version="1.0" encoding = "AL32UTF8"?>
How do I achieve that?
Any suggestions?

I want to change the following xml header to have encoding informationIn 10g I think you could use a xmlroot hack:
SQL> select xmlroot(xmlelement(e, dummy), version '1.0" encoding="AL32UTF8') xml from dual
XML                                                    
<?xml version="1.0" encoding="AL32UTF8"?>              
<E>X</E>                                               
1 row selected.

Similar Messages

  • Insert BASE tag into HTMLDocument problem

    Hi,
    I've made a prog that read the HTML content from an URL, and write it into a file. But before writing it, I'd like to change the content to add <BASE href="http://www.site.com"></BASE> into the head part of the HTMLDocument. In my prog, I've made a insertBeforeEnd(...) to insert the <BASE> tag, but it's not inserted. I've made another insertBeforeEnd(...) to insert "hello world" (just for test) and it's inserted into the HTMLDocument. Can someone help me ? thanks a lot.
    My prog :
    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class InsertIntoHTML {
       public static void main(String[] args) {
          URL                  url = null;
          HttpURLConnection      conn;
          HTMLEditorKit         htmlKit;
          HTMLDocument         htmlDoc;
          InputStream            in;
          Element               head;
          boolean               ignoreCharSet = true;
          htmlKit = new HTMLEditorKit();
          htmlDoc = new HTMLDocument();
          try {
             url = new URL("http://www.google.com/");
          catch (java.net.MalformedURLException e) {}
          htmlDoc.putProperty(Document.StreamDescriptionProperty, url);
          htmlDoc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
          // read www.yahoo.com into HTML document
          try {
             conn = (HttpURLConnection) url.openConnection();
             in = conn.getInputStream();
             Reader reader = new InputStreamReader(in);
             Class c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
             HTMLEditorKit.Parser parser = (HTMLEditorKit.Parser) c.newInstance();
             htmlDoc.setParser(parser);
             HTMLEditorKit.ParserCallback htmlReader = htmlDoc.getReader(0);
             parser.parse(reader, htmlReader, ignoreCharSet);
             htmlReader.flush();
          catch (javax.swing.text.BadLocationException ex) {}
          catch (java.lang.ClassNotFoundException e) {}
          catch (java.lang.InstantiationException e) {}
          catch (java.lang.IllegalAccessException e) {}
          catch (java.io.IOException e) {}
          htmlDoc.setBase(url);
          // find <HEAD> tag into HTML document
          head = getHeadElement(htmlDoc);
          try {
             // insert <BASE> tag into <HEAD> element
             htmlDoc.insertBeforeEnd(head, "<BASE href=\"http://www.google.com/\"></BASE>");
             htmlDoc.insertBeforeEnd(head, "Hello world !");
          catch (javax.swing.text.BadLocationException e) {}
          catch (java.io.IOException e) {}
          // write HTML document into file named yahoo.html      
          try {
             htmlKit.write(new FileOutputStream(new File("google.html")), htmlDoc, 0, htmlDoc.getLength());
          catch (java.io.FileNotFoundException e) {}
          catch (java.io.IOException e) {}
          catch (javax.swing.text.BadLocationException e) {}
       // Find first element into HTML document equals to tag parameter
       public synchronized static final Element findElement(Element root, HTML.Tag kind) {
          if(root == null) return(null);
          if(matchElementType(root, kind)) {
             return(root);
          int count = root.getElementCount();
          if(count > 0) {
             for(int i = 0 ; i<count ; i++) {
                Element child = root.getElement(i);
                Element e = findElement(child, kind);
                if(e != null)
                   return(e);
       return(null);
       public synchronized static final boolean matchElementType(Element e, HTML.Tag kind) {
          return(e.getAttributes().getAttribute(StyleConstants.NameAttribute) == kind);
       // Find HEAD element into HTML document
       public synchronized static final Element getHeadElement(HTMLDocument doc) {
          return(findElement(doc.getRootElements()[0], HTML.Tag.HEAD));

    first, thanks dvorhra09 for your help. unfortunately, if I use &lt; and &gt; instead of '<' and '>', the <BASE> tag is no more interpreted by my browser when the file is loaded, and the <BASE> tag is displayed textually. below, is what I tested :
    htmlDoc.insertBeforeEnd(head, "&lt;BASE href=\"http://www.google.com/\"&gt;&lt;/BASE&gt;");

  • What is the efficient way of insert some bytes into a file?

    Hello, everyone:
    If I want to insert some bytes into a file (for example, insert the bytes before all the original content of the file, or append the bytes to a file), and the size of the original file is very big. I am wondering what is the efficient way? Where can I get some sample codes?
    regards,
    George

    Thanks, DrClap.
    I have tried your method and you are correct. I have written a simple program which can be used to insert "Hello World " to the start of a file ("c:\\temp\\input.txt"), and I have verified that it can work. Please help to see whether it is correct and whether it has a more efficient way.
    public class TestDriver {
         public static void main(String[] args) {
              byte[] back_buffer = new byte [1024];
              byte[] write_buffer = new byte [1024];
              System.arraycopy("Hello World".getBytes(), 0, write_buffer, 0, "Hello World".getBytes().length);
              int write_buffer_length = "Hello World ".getBytes().length;
              int count = 0;
              FileInputStream fis = null;
              FileOutputStream fos = null;          
              try {
                   fis = new FileInputStream (new File("c:\\temp\\input.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\output.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(write_buffer, 0, write_buffer_length);
                        System.arraycopy (back_buffer, 0, write_buffer, 0, count);
                        write_buffer_length = count;
                   //write the last block
                   fos.write(write_buffer, 0, write_buffer_length);
                   fis.close();
                   fos.close();
                   //copy content back into original file
                   fis = new FileInputStream (new File("c:\\temp\\output.txt"));
                   fos = new FileOutputStream (new File("c:\\temp\\input.txt"));
                   while ((count = fis.read (back_buffer)) >= 0)
                        fos.write(back_buffer, 0, count);
                   fis.close();
                   fos.close();
                   //remove temporary file
                   File f = new File ("c:\\temp\\output.txt");
                   f.delete();
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   try {
                        fis.close();
                   } catch (IOException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   try {
                        fos.close();
                   } catch (IOException e2) {
                        // TODO Auto-generated catch block
                        e2.printStackTrace();
    }regards,
    George

  • Use of XMP Custom Panel to automate insertion of metadata into PDF file.

    I'm new to the world of XMP so please bear with me.
    I'm exploring ways of automating the insertion of metadata into PDF files, either at the time of creation, or through a batch process. The metadata values for a given set of documents would be static, so these could be "hard coded" into the mechanism use to insert the metadata.
    Would an XMP Custom Panel be something I could use to achieve this goal. If so, can you please provide some details on how to go about doing this.
    Thanks in advance.
    Louis

    Were you able to find a solution to this problem? I am having the same issue.
    Jason

  • Inserting blockquote tags into a HTMLDocument

    G'Day,
    I'm having a bit of trouble inserting <blockquote> tags into a HTMLDocument.
    Basically I want the blockquote tags to implement an indent feature. ie, you click a button and all the text in the current paragraph gets surrunded by blockquote tags, which when rendered makes it indent.
    The code I'm using is:
    Element current = doc.getParagraphElement(pos);
    try
    doc.insertBeforeStart(current, "<blockquote>");
    doc.insertAfterEnd(current, "</blockquote>");
    catch (Exception e)
    lets say we have html like this:
    <p>
    hello
    </p>
    when this code runs, i get:
    <blockquote>
    </blockquote>
    <p>
    hello
    </p>
    I think that when I do the insertBeforeStart and insert the opening tag, after that completes the document is rendered and the end tag is put in there automatically???
    So, can anyone help me out here and suggest a better way?
    Cheers,
    Leighton.

    I've been trying to get <blockquote> insert working in an editor but it seems to be a quite difficult task even if it's only about inserting a couple of tags into the right slot! This is the closest I got:
    HTMLDocument doc = (HTMLDocument)editor.getDocument();
    int start = editor.getCaretPosition()
    int paraStart = doc.getParagraphElement(start).getStartOffset();
    int paraEnd = doc.getParagraphElement(start).getEndOffset();
    String insideBlockQuotes = doc.getText(paraStart, paraEnd - paraStart);
    doc.setOuterHTML(doc.getParagraphElement(start),"<blockquote><p>"+insideBlockQuotes+"</p></blockquote>");
    This is how it works: Get the current paragraphs start and end positions, read the text between the start and end into a string, replace the paragrapElement with <blockquote><p>..the text from string..</p></blockquote>.
    This works 'in about' but it's far from perfect.. it has the following problems:
    1. It looses all formatting from the quoted paragraph (bold etc. tags from the quoted part)
    2. It assumes that the paragraphElement was a <p> (could have been another element too!)
    3. It's ugly
    Anybody come up with a better way to use blockquote?

  • Lexical error WRITING XML file: which version JDK ? PLUS other issues

    Dear people,
    (1) here at uni2(spain) we just cannot seem to pass the extraction
    phase for any of our 7 ND proyects.
    The iMT gives a lexical / token error when attemting to WRITE the XML
    file. (see FLUSH BELOW)
    (2) Also, what version of the Java-SDK are you using for the IMT ?
    After installing 1.3 the iMT crashes (javaw.exe). Had to put the
    javaw.exe file of JDK1.2.2 in the bin directory to make it work, but
    the lexical error mentioned above just REMAINS there.
    (3) is it nesecary to provide the JAVA source for alle proyect files
    in order to do a correct extraction of the process ? E.g. if I have a
    proyect with 20% dependencies of another poryect, I can manage to
    COMPILE within ND supplying to referenced .CLASS files, but maybe the
    imt needs to JAVA source for all files of the proyect ??
    (4) is the next version of the IMT availabe somewhere for downloading
    ? Has it been released yet ??
    Regards,
    dino flores
    SEE FLUSH of question (1) BELOW
    =======================================================
    Application extraction summary:
    Element [Application], Name [NuestrasOfertasApp], Status [Success]
    Element [Project], Name [NuestrasOfertas], Status [Success]
    Element [UserModule], Name [fun], Status [Success]
    Tool invocations completed in 8 seconds
    Done.
    com.iplanet.via.xml.java.parser.TokenMgrError: Lexical error at line
    748, column 19. Encountered: <EOF> after : ""
    at
    com.iplanet.via.xml.java.parser.JavaSourceParserTokenManager.getNextTo
    ken(JavaSourceParserTokenManager.java:1656)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.jj_consume_token(Java
    SourceParser.java:9432)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.ClassBody(JavaSourceP
    arser.java:607)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.UnmodifiedClassDeclar
    ation(JavaSourceParser.java:499)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.Class(JavaSourceParse
    r.java:413)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.TypeDeclaration(JavaS
    ourceParser.java:368)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.CompilationUnit(JavaS
    ourceParser.java:230)
    at
    com.iplanet.via.xml.java.parser.JavaSourceParser.parse(JavaSourceParse
    r.java:43)
    at
    com.iplanet.via.xml.java.JavaXmlDocument.attachJavaSource(JavaXmlDocum
    ent.java:574)
    at
    com.iplanet.moko.netdyn.extract.adapters.JavaFileXmlAdapter.writeParse
    dJava(JavaFileXmlAdapter.java:194)
    at
    com.iplanet.moko.netdyn.extract.adapters.JavaFileXmlAdapter.addAttribu
    tes(JavaFileXmlAdapter.java:98)
    at
    com.iplanet.moko.netdyn.extract.adapters.JavaFileXmlAdapter.extract(Ja
    vaFileXmlAdapter.java:58)
    at
    com.iplanet.moko.netdyn.extract.adapters.CSpProjectXmlAdapter.addUserM
    oduleElements(CSpProjectXmlAdapter.java:847)
    at
    com.iplanet.moko.netdyn.extract.adapters.CSpProjectXmlAdapter.addChild
    Elements(CSpProjectXmlAdapter.java:249)
    at
    com.iplanet.moko.netdyn.extract.adapters.CSpProjectXmlAdapter.extract(
    CSpProjectXmlAdapter.java:131)
    at
    com.iplanet.moko.netdyn.extract.PseudoCP.createProjectNode(PseudoCP.ja
    va:412)
    at
    com.iplanet.moko.netdyn.extract.PseudoCP.createProjectNodes(PseudoCP.j
    ava:383)
    at
    com.iplanet.moko.netdyn.extract.PseudoCP.extract(PseudoCP.java:210)
    at
    com.iplanet.moko.netdyn.extract.PseudoCP.extract(PseudoCP.java:169)
    at
    com.iplanet.moko.netdyn.tools.ExtractTool.invoke(ExtractTool.java:114)
    at
    com.iplanet.moko.tools.gui.ToolInvocationThread.run(ToolInvocationThre
    ad.java:110)

    I am having this same issue. Should I just uninstall and reinstall? Or do they need to give me special instructions?

  • How to insert xmp metadata into jpeg files?

    Hi
    Is it possible to automatically insert the metadata
    with the script using text extracted from my database.
    I have to insert the metadata into lots of images which are uploaded to a site.
    Thanks
    [signature deleted bu host]

    A scripting tool you may use, although complex, is ImageMagick.  It allows loads of image manipulate but also handles data.
    Another options is DBGallery, which will very easily allow XMP data to be written to hundreds or thousands of files at a time, but not via script (it's a Windows application).  You can see a quick screenshot tour of it's IPTC/XMP capabilities here.
    Hope this helps,
    Glenn
    Developer of DBGallery: The Photo DATAbase

  • Inserting Spry Widget into Saved File

    I have recently encountered a propblem when inserting a Spry widget into a saved html file.  The .js and .css files are saved to file:///C|/Documents and Settings/dwilliams/Application Data/Adobe/Dreamweaver CS4/en_US/Configuration/Temp/Assets/eam75.tmp/%FILENAME% rather than %webroot%/spryassets.
    I know this can occur if the file is unsaved and code is inserted into the file, but in this case the file has been saved.
    Does anyone know how to to reset this back to its default setting?
    TIA,
    David

    Moved to Dreamweaver forums

  • Adobe Acrobat 9/Win7 - Inserting Word documents into PDF file intermittently leads to missing or garbled text?

    Heya.
    I have a user who is creating a PDF essentially compiled from inserting word documents into the position she wants inside of the PDF.
    The problem is that sometimes this leads to missing or garbled text. For example, 6-8.1 is displayed as 6- .1. Which is just plain weird.
    Other times, the text looks garbled or uneven. She turned off her PC but I took screenshots of both of these scenarios. I fear that I am not going to be able to retroactively fix the corruption in this document for her.
    She says she's using very standard fonts. Like Arial. I asked if she could locate the original Word document that produced the garbled text, just for a sanity check. The problem is that her co-worker may have been the only one with that particular word document (there are probably hundreds which compile this PDF...) and IF she has it, she might not be able to locate it on her PC TO check what the original text is. Yikes.
    Google-fu turns up very little. I tried the guidance in this document - https://answers.acrobatusers.com/We-combine-PDF-document-ends-corrupt-What-problem-q197619 .aspx[2] and a Save-As but no avail.
    This also turns up but is not applicable to Acrobat 9 I believe:  http://blogs.adobe.com/acrobatineducation/2010/02/get_rid_of_that_bloat_in_your.html[3]
    She states that she can manually fix the document but after a while it gets corrupted again? But I haven't observed that and she might have just fed me that to amplify the problem.
    I will be able to post screenshots when she turns on her computer tomorrow.

    Here are the two instances of corruption we have come across.
    http://imgur.com/nPztMYm
    http://imgur.com/wHM12e2
    Edit:  A LITTLE MORE INFO.  I am able to select the corrupted text, paste it into Notepad with all the characters intact.  So the characters are THERE.  they are just not being displayed correctly.
    Edit:  They also do not print correctly.  The page prints with characters missing, and she wants to print this document, so that is going to be an issue.

  • How to insert a picture into excel file using ALE AUTOMATION

    Hi every body,
    I have to write report that export data from abap to exel the data contain a logo but I don't know how to insert picture to excel using ALE AUTOMATION.
    Please help me!
    Thank you!

    Hi,
    you have to join into SAP Code Exchange and download this zip:
    [ABAP2XLSX_daily.nugg.zip|http://code.sdn.sap.com/spaces/abap2xlsx/documents/btFzHQ3vKr36tCeJe7bhNc/download/btFzHQ3vKr36tCeJe7bhNc]
    Regards,
    Ivan

  • Premiere Pro CC inserting single frame into exported files

    I have never had this issue before today.
    A project I have been compiling off and on for several months was exported using AME via PPCC.
    In previous exports this issue did not come up at all.
    Here is the problem:
    The rendered videos (using Apple ProRes 422 HQ, QT H.264, and MPEG2 DVD) have a single frame insert between two stills in a montage.
    The previous render it appeared on a different photo a few seconds later in the program, like this:
    Again, these are single frame artifacts not found in the timeline in PPCC. They only appear as "flash frames" in the exported video.
    Anybody else seeing this? Is there a solution?
    Thanks
    Jeremy Praegitzer
    Adobe Premiere Pro CS5/CS6 Certified Associate
    TV Department Manager - Love A Child, Inc.

    Hi Jeremy,
    Thanks for posting on Adobe forums,
    Please provide us details of your systems:
    What is the OS and version ?
    What is the Graphics Card installed on the system ?
    How much Ram do you have ?
    Do you use any external Hard Drive ?
    and if you are using GPU Acceleration on Open CL, You can these issue on Export.
    Please switch GPU acceleration on Software only mode, (if using cuda enabled card then Cuda )
    Regards,
    Sandeep

  • Insert line break into .txt file

    Alright, so I am writing out to a simple .txt file, and I
    need to force a line break in it. My immediate thought is to use
    "\n" as that is a line break. So, I write it out to the text file,
    and instead of a line break, I see the "complex character" symbol
    (you know, that square that shows up with unknown characters). I
    have tried the various ASCII values to no avail, tried \r, even
    tried copy-pasting a line break in from notepad. Nothing seems to
    be working for me. How do I do this?
    _logFile = "\n";
    stream = new FileStream();
    stream.open(file,FileMode.WRITE);
    stream.writeUTFBytes(_logFile);
    stream.close();

    in windows use "\r\n"
    i.e. _logFile = "\r\n";

  • How to parse xml file to read the tags

    Hi All,
    I am having a requirement to read the tags from the xml file(xml parsing).
    The main issue is *xml file is stored in the table with xml type column* (not placed directly in the server) and we have to read the tags from that xml file.
    Please help me to achieve it.
    Regards,
    Akshata
    Edited by: Akshata on Mar 21, 2013 3:44 AM

    Hi,
    Akshata wrote:
    The main issue is xml file is stored in the table clob/blob type column (not placed directly in the server) and we have to read the tags from that xml file.How is that an issue? On the contrary, it's better when the data already resides in the database, though it should be in an XMLType column to leverage the full capacity of the Oracle parser.
    What's the datatype of the column exactly? CLOB or BLOB?
    Either way you'll have to convert in to XMLType datatype using the XMLType constructor.
    Did you go through the countless examples on this forum? Examples with XMLTable should be helpful.
    Post some sample data and database version if you need additional guidance.
    Thanks.

  • Extract xml file with rowset schema using plsql

    I want to extract the rowsheet data from an xml file using plsql database procedure
    Here is an example of the xml file:
    <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
         xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
         xmlns:rs='urn:schemas-microsoft-com:rowset'
         xmlns:z='#RowsetSchema'>
    <s:Schema id='RowsetSchema'>
         <s:ElementType name='row' content='eltOnly'>
              <s:AttributeType name='Sheet_Number' rs:number='1' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Appl_Number1' rs:number='2' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Rating1' rs:number='3' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Criteria1' rs:number='4' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Appl_Number2' rs:number='5' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Rating2' rs:number='6' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Criteria2' rs:number='7' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:extends type='rs:rowbase'/>
         </s:ElementType>
    </s:Schema>
    <rs:data>
         <z:row Sheet_Number='32486' Appl_Number1='198970' Rating1='-2' Criteria1='RTG' Appl_Number2='198989' Rating2='5'
              Criteria2='RTG'/>
         <z:row Sheet_Number='12345' Appl_Number1='198970' Rating1='-3' Criteria1='RTG' Appl_Number2='198989' Rating2='3'
              Criteria2='RTG'/>
    </rs:data>
    </xml>
    I need to extract the values from all of the columns : sheet_number, appl_number1, rating1, criteria1, appl_number2, rating2, criteria2. Validate the data and insert into oracle tables.
    I'm having dificulties extrating the data from the "z:row" recordset
    Can anyone help with the syntax ?
    I'm use to extracting with tags using syntax like this
    declare
    v_xml_content XMLTYPE;
    begin
    v_xml_content := db_get_xml_from_file (p_file_name, p_directory, 'ISO-8859-1');
    FOR f IN (SELECT value(x) file_data
    FROM TABLE
    (xmlsequence
    (extract (v_xml_content,'/data'))) x) LOOP
    SELECT extractvalue(f.file_data,'/data/row') into v_row from dual;                                                                      END LOOP;

    I want to extract the rowsheet data from an xml file using plsql database procedure
    Here is an example of the xml file:
    <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
         xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
         xmlns:rs='urn:schemas-microsoft-com:rowset'
         xmlns:z='#RowsetSchema'>
    <s:Schema id='RowsetSchema'>
         <s:ElementType name='row' content='eltOnly'>
              <s:AttributeType name='Sheet_Number' rs:number='1' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Appl_Number1' rs:number='2' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Rating1' rs:number='3' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Criteria1' rs:number='4' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Appl_Number2' rs:number='5' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
              </s:AttributeType>
              <s:AttributeType name='Rating2' rs:number='6' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:AttributeType name='Criteria2' rs:number='7' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
                   <s:datatype dt:type='string' dt:maxLength='25'/>
              </s:AttributeType>
              <s:extends type='rs:rowbase'/>
         </s:ElementType>
    </s:Schema>
    <rs:data>
         <z:row Sheet_Number='32486' Appl_Number1='198970' Rating1='-2' Criteria1='RTG' Appl_Number2='198989' Rating2='5'
              Criteria2='RTG'/>
         <z:row Sheet_Number='12345' Appl_Number1='198970' Rating1='-3' Criteria1='RTG' Appl_Number2='198989' Rating2='3'
              Criteria2='RTG'/>
    </rs:data>
    </xml>
    I need to extract the values from all of the columns : sheet_number, appl_number1, rating1, criteria1, appl_number2, rating2, criteria2. Validate the data and insert into oracle tables.
    I'm having dificulties extrating the data from the "z:row" recordset
    Can anyone help with the syntax ?
    I'm use to extracting with tags using syntax like this
    declare
    v_xml_content XMLTYPE;
    begin
    v_xml_content := db_get_xml_from_file (p_file_name, p_directory, 'ISO-8859-1');
    FOR f IN (SELECT value(x) file_data
    FROM TABLE
    (xmlsequence
    (extract (v_xml_content,'/data'))) x) LOOP
    SELECT extractvalue(f.file_data,'/data/row') into v_row from dual;                                                                      END LOOP;

  • XML File in External Table - OS error permission denied.

    Hi.
    10g R2, Red Hat Linux
    I'm using the article (see below, taken from http://www.dbazine.com/olc/olc-articles/scardina1 by Mark Scardina) to create an external table where I'd store my XML file.
    So, I
    1. Created a directory xmlfile_dir
    2. Granted access to needed db user
    3. Created the table
    CREATE TABLE relayxml_xt (doc CLOB)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY xmlfile_dir
    ACCESS PARAMETERS
    FIELDS (lobfn CHAR TERMINATED BY ',')
    COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
    LOCATION ('xml.dat')
    REJECT LIMIT UNLIMITED;
    4. mv relay.xml /xmlfile_dir/xml.dat
    When I run SELECT * FROM relayxml_xt I get this:
    Error starting at line 1 in command:
    select * from relayxml_xt
    Error report:
    SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file RELAYXML_XT_28773.log
    OS error Permission denied
    ORA-06512: at "SYS.ORACLE_LOADER", line 19
    29913. 00000 - "error in executing %s callout"
    *Cause:    The execution of the specified callout caused an error.
    *Action:   Examine the error messages take appropriate action.
    What am I doing wrong?
    Thanks,
    Using External Tables
    Introduced in Oracle9i, Oracle’s external table feature offers a solution to define a table in the database while leaving the data stored outside of the database. Prior to Oracle Database 10g, external tables can be used only as read-only tables. In other words, if you create an external table for XML files, these files can be queries and the table can be joined with other tables. However, no DML operations, such as INSERT, UPDATE, and DELETE, are allowed on the external tables.
    Note: In Oracle Database 10g , by using the ORACLE_DATAPUMP driver instead of the default ORACLE_DRIVER, you can write to external tables. In Oracle Database 10g, you can define VARCHAR2 and CLOB columns in external tables to store XML documents. The following example shows how you can create an external table with a CLOB column to store the XML documents. First, you need to create a DIRECTORY to read the data files:
    CREATE DIRECTORY data_file_dir AS 'D:\xmlbook\Examples\Chapter9\src\xml';
    GRANT READ, WRITE ON DIRECTORY data_file_dir TO demo;
    Then, you can use this DIRECTORY to define an external table:
    CREATE TABLE customer_xt (doc CLOB)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY data_file_dir
    ACCESS PARAMETERS
    FIELDS (lobfn CHAR TERMINATED BY ',')
    COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
    LOCATION ('xml.dat')
    REJECT LIMIT UNLIMITED;
    The xml.dat file follows:
    customer1.xml
    customer2.xml
    If you describe the table, you can see the following definition:
    SQL> DESC customer_xt;
    Name Null? Type
    DOC CLOB
    Then, you can query the XML document as follows:
    SELECT XMLType(doc).extract('/Customer/EMAIL')
    FROM customer_xt;
    Though the query requires run-time XMLType creation and XPath evaluation, this approach is useful when applications just need a few queries on the XML data and don’t want to upload the XML data into database. In Oracle Database 10g, you cannot create external tables that contain pre-defined XMLType column types.
    Message was edited by:
    vi2167

    Your don't have the proper operating system privileges. Be sure that you (=oracle OS user / the OS Linux user that is starting the database) are allowed have read privs on the path and/or file.
    for example...
    chown -Rf /xxxxxxx/xxxx/etc
    ls -l file.xml
    file.xml    oracle:oinstall    rw-rw-rw

Maybe you are looking for

  • Incoming mail is going to a folder other than inbox. fix?

    Incoming mail is going to a folder instead of inbox.  How do I fix this?

  • Zip files won't unzip

    I have downloaded a couple of zip files, and am trying to use the default Archive utility to unzip them. Instead of opening the files within the zipped folder I'm getting a .cpgz folder with the exact same name... then when I try to open that file it

  • Style sheet administration

    I would like to see a new InDesign feature or add-on whereby I could administer and edit paragraph/character style sheets for multiple documents, rather than having to individually edit style sheets in all those documents. Rather than the style sheet

  • Error during Activating DC

    Hello Experts, I am getting an error while activating a DC on the track. There are no build errors nor any runtime errors, but after checkin, when I try to activate the DC, it gives me a generation error : ERROR: Unknown exception during generation n

  • Unable to add BP Master

    Hi All,            Iam Unable to add a customer. Error Msg:  Contact person is referenced by another object, Sales order [Message 3511-1]. Thankyou sree