Problem writing xml do disk ORA-29285

I have an issue when I write larger xml files. I get ORA-29285 when i flush it to disk.
The strange thing is that the code works when I use this code:
xmlText clob := xml.extract('/*').getClobVal(); But It is very slow.
instead of this:
xmlText clob := xml.getClobVal();
Anyone know the reason why the first statement works?
The code I use when it works:
procedure writeToFile (xml xmltype, filename varchar2)
is
fHandle utl_file.File_Type;
xmlText clob := xml.extract('/*').getClobVal();
/*xmlText clob := xml.getClobVal();*/
xmlTextSize binary_integer := dbms_lob.getLength(xmlText)+1;
offset binary_integer := 1;
buffer varchar2(32767);
linesize binary_integer := 32767;
byteCount binary_integer;
directory_name constant varchar2 (80) := 'RDFEXPORT';
begin
fhandle := utl_file.fopen(directory_name, filename,'w', linesize);
while (offset < xmlTextSize) loop
if (xmlTextSize - offset > linesize) then
byteCount := linesize;
else
byteCount := xmlTextSize - offset;
end if;
dbms_lob.read(xmlText, byteCount, offset, buffer);
offset := offset + byteCount;
utl_file.put(fHandle, buffer);
utl_file.fflush(fHandle);
end loop;
utl_file.new_line(fHandle);
utl_file.fclose(fHandle);
dbms_lob.FREETEMPORARY(xmlText);
end writeToFile;

Great thank you!
So Is there a way to add a new line when you have functions like this?
(It is rdf/xml I'm creating if someone wonders)
function medDraSoc return xmltype is
socXml xmltype;
begin
select
xmlagg
xmlelement
("isim:SOC",
xmlattributes ('#SOC' || soc.soc_code as "rdf:about"),
xmlforest
soc.soc_code as "isim:termCode",
soc.soc_costart_sym as "isim:costart",
soc.soc_harts_code as "isim:hartsCode",
soc.soc_icd10_code as "isim:icd10Code",
soc.soc_icd9_code as "isim:icd9Code",
soc.soc_icd9cm_code as "isim:icd9cmCode",
soc.soc_jart_code as "isim:jartCode",
soc.soc_name as "protons:mainLabel",
soc.soc_whoart_code as "isim:whoartCode")
) xml
into socXml
from exp_meddra_soc soc;
return socXml;
end medDraSoc;

Similar Messages

  • Problem with XML in APEX ORA-06502

    i, I have a problem with XML generation, I developed an application in APEX, and in a html page I have this process:
    declare
    l_XML varchar2(32767);
    begin
    select xmlElement
    "iva",
    xmlElement("numeroRuc",J.RUC),
    xmlElement("razonSocial", J.RAZON_SOCIAL),
    xmlElement("idRepre", J.ID_REPRE),
    xmlElement("rucContador", J.RUC_CONTADOR),
    xmlElement("anio", J.ANIO),
    xmlElement("mes", J.MES),
    xmlElement
    "compras",
    select xmlAgg
    xmlElement
    "detalleCompra",
    --xmlAttributes(K.ID_COMPRA as "COMPRA"),
    xmlForest
    K.COD_SUSTENTO as "codSustento",
    K.TPLD_PROV as "tpldProv",
    K.ID_PROV as "idProv",
    K.TIPO_COMPROBANTE as "tipoComprobante",
    to_char(K.FECHA_REGISTRO, 'DD/MM/YYYY') as "fechaRegistro",
    K.ESTABLECIMIENTO as "establecimiento",
    K.PUNTO_EMISION as "puntoEmision",
    K.SECUENCIAL as "secuencial",
    to_char(K.FECHA_EMISION, 'DD/MM/YYYY') as "fechaEmision",
    K.AUTORIZACION as "autorizacion",
    to_char(K.BASE_NO_GRA_IVA, 9999999999.99) as "baseNoGraIva",
    to_char(K.BASE_IMPONIBLE, 9999999999.99) as "baseImponible",
    to_char(K.BASE_IMP_GRAV, 9999999999.99) as "baseImpGrav",
    to_char(K.MONTO_ICE, 9999999999.99) as "montoIce",
    to_char(K.MONTO_IVA, 9999999999.99) as "montoIva",
    to_char(K.VALOR_RET_BIENES, 9999999999.99) as "valorRetBienes",
    to_char(K.VALOR_RET_SERVICIOS, 9999999999.99) as "valorRetServicios",
    to_char(K.VALOR_RET_SERV_100, 9999999999.99) as "valorRetServ100"
    xmlElement
    "air",
    select xmlAgg
    xmlElement
    "detalleAir",
    xmlForest
    P.COD_RET_AIR as "codRetAir",
    to_char(P.BASE_IMP_AIR, 9999999999.99) as "baseImpAir",
    to_char(P.PORCENTAJE_AIR, 999.99) as "porcentajeAir",
    to_char(P.VAL_RET_AIR, 9999999999.99) as "valRetAir"
    from ANEXO_COMPRAS P
    where P.ID_COMPRA = K.ID_COMPRA
    AND P.ID_INFORMANTE_XML = K.ID_INFORMANTE_XML
    xmlElement("estabRetencion1", K.ESTAB_RETENCION_1),
    xmlElement("ptoEmiRetencion1", K.PTO_EMI_RETENCION_1),
    xmlElement("secRetencion1", K.SEC_RETENCION_1),
    xmlElement("autRetencion1", K.AUT_RETENCION_1),
    xmlElement("fechaEmiRet1", to_char(K.FECHA_EMI_RET_1,'DD/MM/YYYY')),
    xmlElement("docModificado", K.DOC_MODIFICADO),
    xmlElement("estabModificado", K.ESTAB_MODIFICADO),
    xmlElement("ptoEmiModificado", K.PTO_EMI_MODIFICADO),
    xmlElement("secModificado", K.SEC_MODIFICADO),
    xmlElement("autModificado", K.AUT_MODIFICADO)
    from SRI_COMPRAS K
    WHERE K.ID IS NOT NULL
    AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
    AND K.ID BETWEEN 1 AND 25
    ).getClobVal()
    into l_XML
    from ANEXO_INFORMANTE J
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    --HTML
    sys.owa_util.mime_header('text/xml',FALSE);
    sys.htp.p('Content-Length: ' || length(l_XML));
    sys.owa_util.http_header_close;
    sys.htp.print(l_XML);
    end;
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    declare
    l_XML CLOB;
    begin
    --Oculta XML
    sys.htp.init;
    wwv_flow.g_page_text_generated := true;
    wwv_flow.g_unrecoverable_error := true;
    --select XML
    select xmlElement
    from SRI_COMPRAS K
    WHERE K.ID IS NOT NULL
    AND K.ID_INFORMANTE_XML = J.ID_INFORMANTE
    ).getClobVal()
    into l_XML
    from ANEXO_INFORMANTE J
    where J.ID_INFORMANTE =:P3_MES
    and J.RUC =:P3_ID_RUC
    and J.ANIO =:P3_ANIO
    and J.MES =:P3_MES;
    --HTML
    sys.owa_util.mime_header('text/xml',FALSE);
    sys.htp.p('Content-Length: ' || length(l_XML));
    sys.owa_util.http_header_close;
    sys.htp.print(l_XML);
    end;
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+

    JohannaCevallos07 wrote:
    Now my table has more than 900 rows and only when I specifically selected 25 rows of the table "ANEXO_COMPRAS" in the where ( AND K.ID BETWEEN 1 AND 25) the XML is generated.+
    I think that the problem may be the data type declared "varchar2", but I was trying with the data type "CLOB" and the error is the same.+
    The error generated is ORA-06502: PL/SQL: numeric or value error+_
    Please I need your help. I don`t know how to resolve this problem, how to use the data type "CLOB" for the XML can be generate+The likeliest explanation for this is that length of the XML exceeds 32K, which is the maximum size that <tt>htp.p</tt> can output. A CLOB can store much more than this, so it's necessary to buffer the output as shown in +{message:id=4497571}+
    Help us to help you. When you have a problem include as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    And always post code wrapped in <tt>\...\</tt> tags, as described in the FAQ.
    Thanks

  • Problem writing XML after opening dialog

    I'm using ScriptUI to create and update XML in a document (using Document.XMLElements methods).
    Before opening a Window with ScriptUI, I can read and write XML without problem.
    But after opening a Window containing some ScriptUI resources, I can only read the existing XML BUT NOT WRITE IT!
    My writing method is called from a button event :
    var myXMLRootNode = /* instanciated */
    myWindow.okButton = /* instanciated */
    myWindow.okButton.onClick = function() { myXMLRootNode.xmlElements.add(myTag, object) };
    myWindow.show();
    It looks like the onClick callback works OK for reading (I can recover all existing values without problem) but not for writing.
    Any idea ?

    Hey!
    Well, the thing is that you have to close dialog first before writing to document.
    myWindow.okButton.onClick = function(){myWindow.close(1);};
    var myWin = myWindow.show();
    if(myWin == true){
        myXMLRootNode.xmlElements.add(myTag, object);
    Hope it helps!
    tomaxxi
    http://indisnip.wordpress.com/

  • IPod 5G Problem Writing Video to Disk

    I just purchased an "open box" model of a 30Gb iPod with video this weekend. I have no trouble downloading songs, but I cannot seem to download 2 TV shows that were purchased on iTunes.
    The error message says "Attempting to copy to the disk (iPod name) failed. The disk could not be read from or written to." I could not locate an error message number. The error pops up when the video is almost done loading.
    Any suggestions?
    Gateway PC   Windows XP  

    hmmmmmm. this document is the best place to start with that one:
    "Disk cannot be read from or written to" when syncing iPod or "Firmware update failure" error when updating or restoring iPod
    ... but if it looks like the files themselves are damaged, it would be best to report the problem to the iTunes Store. the email form at the bottom of this FAQ would probably be the best one to use:
    iTunes Music Store video FAQ

  • Problem writing XML content through JspWriter

    Hi,
    I am trying to send some XML content to browser. I have a perfectly generated XML, which if I write using ServletOutpurStream in a Java Servlet, works flawlessly, and I see the XML on the browser. But, if I use the same piece of code in a JSP, and write to "out", I see some junk data, without any XML tags. I did set response.contentType to "text/xml" in both the cases. I even tried the contentType attribute of "page" directive. But no luck.
    Could anybody please tell me what's wrong!!
    Thanks a lot in advance.
    Sumanta.

    It is working fine for me. I am running Tomcat 3.2.1 on NT.
    Try this small test jsp,
    <%@ page language="java" %>
    <%
    response.setContentType("text/xml");
    out.print("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
    out.print("<web-app><servlet><servlet-name>default</servlet-name>"+
                   "<servlet-class>org.apache.tomcat.servlets.DefaultServlet</servlet-class>"+
                   "</servlet></web-app>");
    %>Sudha

  • Problem writing xml file using DOM

    Hi,
    I am trying to write a xml file using DOM. I am using xalan 2.5, xerces 1.4.4, jdk 1.3.1 in JRun 3 on windows.
    The code where I get exception :
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   transformer.transform(new DOMSource(doc), new StreamResult("pr.xml"));
    I get the runtime error as follows:
    javax.servlet.ServletException: null
    java.lang.NoSuchMethodError
         at org.apache.xml.utils.DOM2Helper.getNamespaceOfNodeDOM2Helper.java:342)
         at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:387)
         at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:202)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:343)
    Thinking it is because of classpath, I placed xalan 2.5, xerces 1.4.4 jar files in jrun admin lib directory and in server lib directory as well. Still getting the same error.
    Any suggestion?
    Thanks in advance

    xalan is included in JRun 4. However JRun 3 does not.
    However I tried with the same code in JRun3 in different system. The error is completely different. I understand this is because of different version of files. trying to solve ;)
    Here my new exception
    javax.servlet.ServletException: org/w3c/dom/ranges/DocumentRange
    java.lang.NoClassDefFoundError: org/w3c/dom/ranges/DocumentRange
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.createFile(CreateXMLDOFile.java:73)
         at com.cybell.appl.deliveryorder.cmd.CreateXMLDOFile.execute(CreateXMLDOFile.java:36)
         at com.cybell.appl.framework.cmd.BaseCommand.start(BaseCommand.java:50)
         at com.cybell.appl.framework.control.BaseController.service(BaseController.java:38)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunNamedDispatcher.forward(../servlet/JRunNamedDispatcher.java:34)
         at allaire.jrun.servlet.Invoker.service(../servlet/Invoker.java:84)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1013)
         at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:925)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:88)
         at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1131)
         at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:330)
         at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:107)
         at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
         at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)

  • "encoding = UTF-8" missing while writing XML file using file Adapter

    Hi,
    We are facing an unique problem writing xml file using file adapter. The file is coming without the encoding part in the header of xml. An excerpt of the file that is getting generated:
    <?xml version="1.0" ?>
    <customerSet>
    <user>
    <externalID>51017</externalID>
    <userInfo>
    <employeeID>51017</employeeID>
    <employeeType>Contractor</employeeType>
    <userName/>
    <firstName>Gail</firstName>
    <lastName>Mikasa</lastName>
    <email>[email protected]</email>
    <costCenter>8506</costCenter>
    <departmentCode/>
    <departmentName>1200 Corp IT Exec 8506</departmentName>
    <businessUnit>1200</businessUnit>
    <jobTitle>HR Analyst 4</jobTitle>
    <managerID>49541</managerID>
    <division>290</division>
    <companyName>HQ-Milpitas, US</companyName>
    <workphone>
    <number/>
    </workphone>
    <mobilePhone>
    <number/>
    </customerSet>
    </user>
    So if you see the header the "encoding=UTF-8" is missing after "version-1.0".
    Do we need to configure any properties in File Adapter?? Or is it the standard way of rendering by the adapter.
    Please advice.
    Thanks in advance!!!

    System.out.println(nodeList.item(0).getFirstChild().getNodeValue());

  • Problems with moving files to ora directory UTL_FILE.PUT_RAW - ORA-29285

    hi,
    i'm using apex 4.1
    i have a procedure which moves my file from apex_application_files to ORA directory.
    if i choose a text file or small word document which is 1kb, it works. but if i have pdf file (85kb) or word document (16kb) it gives me ORA-29285: file write error
    what's my problem?
    PROCEDURE put_file_to_server (p_filename IN VARCHAR2,p_cert_type IN VARCHAR2,p_cert_pk IN NUMBER)
    AS
    l_file UTL_FILE.file_type;
    l_blob_len INTEGER;
    l_pos INTEGER := 1;
    l_amount BINARY_INTEGER := 32767;
    l_buffer RAW (32767);
    v_new_filename VARCHAR2(100);
    v_bfile BFILE ;
    BEGIN
    -- delete from apex_application_files;
    --Neuen Dateinamen generieren
    v_new_filename := p_cert_type||'_'||p_cert_pk;
    v_bfile := BFILENAME (v_directory, v_new_filename);
    --Datei erstellen
    l_file := UTL_FILE.fopen(v_directory,v_new_filename,'w');
    IF DBMS_LOB.FILEEXISTS (v_bfile) = 1 THEN
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'File exists');
    FOR rec IN (select blob_content lblob from apex_application_files where rownum = 1)
    LOOP
    l_blob_len := DBMS_LOB.getlength(rec.lblob);
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Filesize is '||l_blob_len);
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.read (rec.lblob, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw (l_file, l_buffer, FALSE);
    l_pos := l_pos + l_amount;
    END LOOP;
    COMMIT;
    END LOOP;
    --Datei schließen
    UTL_FILE.fclose(l_file);
    else
    cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Datei doesn't exist');
    end if;
    EXCEPTION
    WHEN OTHERS
    THEN
    -- Close the file if something goes wrong.
    IF UTL_FILE.is_open (l_file) THEN
    UTL_FILE.fclose (l_file);
    END IF;
    delete from apex_application_files;
    RAISE;
    delete from apex_application_files;
    END put_file_to_server;

    Sorry but din't test this...Can you give it a try and see if this works?
    PROCEDURE put_file_to_server(
        p_filename  IN VARCHAR2,
        p_cert_type IN VARCHAR2,
        p_cert_pk   IN NUMBER)
    AS
      l_file UTL_FILE.file_type;
      l_blob_len INTEGER;
      l_pos      INTEGER      := 1;
      l_amount BINARY_INTEGER := 32767;
      l_buffer RAW (32767);
      v_new_filename VARCHAR2(100);
      v_bfile BFILE ;
      vblob BLOB;
      vstart NUMBER := 1;
      my_vr RAW(32000);
      bytelen NUMBER := 32000;
      LEN     NUMBER;
    BEGIN
      -- delete from apex_application_files;
      --Neuen Dateinamen generieren
      v_new_filename := p_cert_type||'_'||p_cert_pk;
      v_bfile        := BFILENAME (v_directory, v_new_filename);
      --Datei erstellen
      --l_file                          := UTL_FILE.fopen(v_directory,v_new_filename,'w');
      l_file                          := UTL_FILE.fopen(v_directory,v_new_filename, 'WB', 32760);
      IF DBMS_LOB.FILEEXISTS (v_bfile) = 1 THEN
        cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'File exists');
        FOR rec IN
        (SELECT blob_content lblob,
          LENGTH(blob_content) LEN
        FROM apex_application_files
        WHERE rownum = 1
        LOOP
          cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Filesize is '|| LEN);
          IF LEN < 32760 THEN
            utl_file.put_raw(l_file,lblob);
            utl_file.fflush(l_file);
          ELSE -- write in pieces
            vstart      := 1;
            WHILE vstart < LEN
            LOOP
              dbms_lob.read(vblob,bytelen,vstart,my_vr);
              utl_file.put_raw(l_file,my_vr);
              utl_file.fflush(l_file);
              -- set the start position for the next cut
              vstart := vstart + bytelen;
              -- set the end position if less than 32000 bytes
              x         := x - bytelen;
              IF x       < 32000 THEN
                bytelen := x;
              END IF;
            END LOOP;
          END IF;
         END LOOP;
        ELSE
          cert_log_pkg.m(p_module => 'CERT_FILE_PKG.PUT_FILE_TO_SERVER',p_msg => 'Datei doesnt exist');
        END IF;
        utl_file.fclose(l_file);
      EXCEPTION
      WHEN OTHERS THEN
        -- Close the file if something goes wrong.
        IF UTL_FILE.is_open (l_file) THEN
          UTL_FILE.fclose (l_file);
        END IF;
        DELETE FROM apex_application_files;
        RAISE;
        DELETE FROM apex_application_files;
      END put_file_to_server;Edited by: Vitor Rodrigues on 17/Fev/2012 12:03

  • Lost all photos on my iPhoto and get the ERROR WRITING TO DISK when trying to reload from Time Machine. iPhoto cannot import your photos because there was a problem writing to the volume containing your iPHOTO LIBRARY  . Looking for solution.

    Lost all photos on my iPhoto and get the ERROR WRITING TO DISK when trying to reload from Time Machine. iPhoto cannot import your photos because there was a problem writing to the volume containing your iPHOTO LIBRARY  . Looking for solution.

    Problems such as yours are sometimes caused by files that should belong to you but are locked or have wrong permissions. This procedure will check for such files. It makes no changes and therefore will not, in itself, solve your problem.
    First, empty the Trash, if possible.
    Triple-click anywhere in the line below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) 2>&- | wc -l | pbcopy
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign ($) to appear.
    The output of the command will be a number. It's automatically copied to the Clipboard. Please paste it into a reply.
    The Terminal window doesn't show the output. Please don't copy anything from there.

  • Problem Using UTL_FILE package ORA-29285

    Dear All,
    I would very much appreciate your help.
    I am trying to export data form a table.
    The version of the DB is 10.2.0.4
    I am using the following procedure:
    create or replace
    procedure EXPORT_FRAME(
    dir IN VARCHAR2, filename IN VARCHAR2) IS
    f utl_file.file_type;
      cursor frame is
        Select *
        from test_complete_frame_2008;
    begin
      f:= utl_file.fopen (dir, filename,'w');
      FOR a IN frame
      Loop
        utl_file.put_line (f,
            '"'||a.COM_DATA_ID || '";"' ||
               a.COM_DATA_SET_ID || '";"'||
                a.NSI || '";"'||
                a.FRAME_ID || '";"'||
                a.STATUS_FRAME || '";"'||
                TO_CHAR(a.FRAME_REFERENCE_DATE, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.DATE_OF_SELECTION, 'dd/mm/yyyy')  || '";'||
                a.EU_LEU_ID || ';"'||
                a.NSA_ID || '";"'||
                a.SOURCE_IDENTITY || '";"'||
                TO_CHAR(a.REF_DATE_LEU_IDENTITY, 'dd/mm/yyyy') || '";"'||
                a.NATIONAL_ID || '";"'||
                a.REF_DATE_NATIONAL_ID || '";"'||
                a.DUNS_NUMBER || '";"'||
                TO_CHAR(a.REF_DATE_DUNS_NUMBER, 'dd/mm/yyyy') || '";"'||
                a.BVD_ID || '";"'||
                TO_CHAR(a.REF_DATE_BVD_ID, 'dd/mm/yyyy') || '";"'||
                a.NAME_LEGAL_UNIT || '";"'||
                a.LEGAL_FORM_EGR || '";"'||
                a.SOURCE_LEGAL_FORM || '";"'||
                TO_CHAR(a.REF_DATE_LEGAL_FORM, 'dd/mm/yyyy') || '";"'||
                a.TYPE_OF_LEGAL_UNIT || '";"'||
                a.SOURCE_CODE_TYPE_OF_LEU || '";"'||
                TO_CHAR(a.REF_DATE_TYPE_OF_LEU, 'dd/mm/yyyy') || '";"'||
                a.STATUS_LEU || '";"'||
                a.SOURCE_CODE_STATUS_LEU || '";"'||
                TO_CHAR(a.REF_DATE_STATUS_LEU, 'dd/mm/yyyy') || '";"'||
                a.POST_DELIVERY_POINT || '";"'||
                a.CITY_NAME || '";"'||
                a.POSTAL_CODE || '";"'||
                a.STATE_NAME || '";"'||
                a.COUNTRY_CODE_BOP || '";"'||
                a.COUNTRY_ACCESS_CODE || '";"'||
                a.TELEPHONE_NUMBER || '";"'||
                a.FAX_NUMBER || '";"'||
                TO_CHAR(a.DATE_OF_INCORPORATE, 'dd/mm/yyyy') || '";"'||
                a.SOURCE_DATE_OF_INCORP || '";"'||
                TO_CHAR(a.REF_DATE_DATE_OF_INCORP, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.DATE_OF_LIQUIDATION, 'dd/mm/yyyy') || '";"'||
                a.SOURCE_DATE_OF_LIQ || '";"'||
                TO_CHAR(a.REF_DATE_DATE_OF_LIQ, 'dd/mm/yyyy') || '";"'||
                a.NACE_CODE || '";"'||
                a.VERSION_NACE || '";"'||
                a.SOURCE_CODE_NACE || '";"'||
                TO_CHAR(a.REF_DATE_NACE, 'dd/mm/yyyy') || '";"'||
                a.NUMBER_PERS_EMPLOYED || '";"'||
                a.SOURCE_CODE_PERS_EMPL || '";"'||
                a.CONS_PERSON_EMPLOYED || '";"'||
                TO_CHAR(a.REF_DATE_PERS_EMPLOYED, 'dd/mm/yyyy') || '";"'||
                a.SPECIAL_PURP_ENTITY_CODE || '";"'||
                a.SOURCE_CODE_SPE || '";"'||
                TO_CHAR(a.REF_DATE_SPE_CODE, 'dd/mm/yyyy') || '";"'||
                a.EMAIL_ADDRESS || '";"'||
                TO_CHAR(a.REF_DATE_EMAIL_ADDRESS, 'dd/mm/yyyy') || '";"'||
                a.WEB_ADDRESS || '";"'||
                TO_CHAR(a.REF_DATE_WEB_ADDRESS, 'dd/mm/yyyy') || '";"'||
                a.P_EU_LEU_ID || '";"'||
                a.P_NAME_LEGAL_UNIT || '";"'||
                a.P_COUNTRY_CODE_BOP || '";"'||
                a.STATUS_RELATIONSHIP || '";"'||
                a.PERCENTAGE || '";"'||
                a.KIND_OF_CONTROL || '";"'||
                a.SOURCE_CODE_RELATIONSHIP || '";"'||
                TO_CHAR(a.REF_DATE_RELATIONSHIP, 'dd/mm/yyyy') || '";"'||
                a.GLOBAL_LEVEL || '";"'||
                a.GGH_EU_LEU_ID || '";"'||
                a.GGH_NAME_LEGAL_UNIT || '";"'||
                a.GGH_COUNTRY_CODE_BOP || '";"'||
                a.GGH_NSA_ID || '";"'||
                a.GGH_DUNS_NUMBER || '";"'||
                a.GGH_BVD_ID || '";"'||
                a.GGH_SOURCE_IDENTITY || '";"'||
                a.GLOBAL_EG_ID || '";"'||
                a.GLOBAL_EG_NAME || '";"'||
                a.TOP_MNE_IND || '";"'||
                a.GEG_PERSONS_EMPLOYED || '";"'||
                a.GEG_SOURCE_CODE_PERS_EMPL || '";"'||
                TO_CHAR(a.GEG_REF_DATE_PERS_EMPL, 'dd/mm/yyyy') || '";"'||
                a.NUMBER_OF_LEGAL_UNITS || '";"'||
                a.GEG_NACE_CODE_DIV || '";"'||
                a.GEG_SOURCE_CODE_NACE || '";"'||
                TO_CHAR(a.GEG_REF_DATE_NACE, 'dd/mm/yyyy') || '";"'||
                a.GEG_CONS_TURNOVER || '";"'||
                a.GEG_VALUTA_CONS_TURNOVER || '";"'||
                TO_CHAR(a.GEG_BEGIN_CONS_TURNOVER, 'dd/mm/yyyy') || '";"'||
                TO_CHAR(a.GEG_END_CONS_TURNOVER, 'dd/mm/yyyy') || '";"'||
                a.GEG_SOURCE_CONS_TURNOVER || '";"'||
                TO_CHAR(a.GEG_REF_DATE_C_TURNOVER, 'dd/mm/yyyy') || '";"'||
                a.GEG_TOTAL_ASSETS || '";"'||
                a.GEG_VALUTA_TOTAL_ASSETS || '";"'||
                a.GEG_SOURCE_TOTAL_ASSETS || '";"'||
                TO_CHAR(a.GEG_REF_DATE_TOTAL_ASSETS, 'dd/mm/yyyy') || '";"'||
                a.GEG_WEB_ADDRESS || '";"'||
                a.GDC_EU_LEU_ID || '";"'||
                a.GDC_NAME_LEGAL_UNIT || '";"'||
                a.GDC_COUNTRY_CODE_BOP || '";"'||
                a.GDC_NSA_ID || '";"'||
                a.GDC_DUNS_NUMBER || '";"'||
                a.GDC_BVD_ID || '";"'||
                a.GDC_SOURCE_IDENTITY || '";"'||
                a.REP_EU_LEU_ID || '";"'||
                a.REP_NAME_LEGAL_UNIT || '";"'||
                a.REP_POST_DELIVERY_POINT || '";"'||
                a.REP_POSTAL_CODE || '";"'||
                a.REP_STATE_NAME || '";"'||
                a.REP_CITY_NAME || '";"'||
                a.REP_COUNTRY_CODE_BOP || '"'
           UTL_FILE.new_line (f);
      END LOOP;
      UTL_FILE.new_line (f);
      UTL_FILE.fclose(f);
        EXCEPTION
          WHEN NO_DATA_FOUND
            THEN dbms_output.put_line ('FAILED');
    END EXPORT_FRAME;I get an error message:
    Error starting at line 1 in command:
    begin EXPORT_FRAME ('EXP','test2.csv'); end;
    Error report:
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 136
    ORA-06512: at "SYS.UTL_FILE", line 813
    ORA-06512: at "EGR.EXPORT_FRAME", line 13
    ORA-06512: at line 1
    29285. 00000 - "file write error"
    *Cause:    Failed to write to, flush, or close a file.
    *Action:   Verify that the file exists, that it is accessible, and that
    it is open in write or append mode.
    Any idea?
    Thanks in advance!

    By default UTL_FILE.FOPEN opens file with record size up to 1024 characters (including newline). Most likely your code exceeds 1024. Change:
    f:= utl_file.fopen (dir, filename,'w');to something like (assuming none of your records will exceed 10000)
    f:= utl_file.fopen (dir, filename,'w',10000);SY.

  • ORA-29285: file write error

    Hi,
    We are getting this error ORA-29285: file write error while writing to a text file using utl_file.putf package.
    Using fopen funtion in code to open file as below:
    V_FILEHANDLE:=UTL_FILE.FOPEN(v_file_path,'ABC','W', max_linesize);
    Here max linesize = 32000, so as far as I think, limitation on length of records while writing the file is not an issue.
    Further code is written as:
    UTL_FILE.PUTF(V_FILEHANDLE, v_text1||'|'||v_text2||'|');
    UTL_FILE.NEW_LINE(V_FILEHANDLE);
    UTL_FILE.FFLUSH(V_FILEHANDLE); -- This is called after every 500 lines are written to the file.
    UTL_FILE.FCLOSE(V_FILEHANDLE);
    We are encountering this error every now and then, and strangely this gets resolved when we re-run the program and file gets written successfully.
    Can someone please help on this please?
    Oracle database 11g, version: 11.1.0.7.0
    Thanks,
    Sonam

    Not enough information.
    964643 wrote:
    Hi,
    We are getting this error ORA-29285: file write error while writing to a text file using utl_file.putf package.
    Using fopen funtion in code to open file as below:
    V_FILEHANDLE:=UTL_FILE.FOPEN(v_file_path,'ABC','W', max_linesize);And what value has v_file_path got? Is this the name of an Oracle Directory Object as it should be?
    Here max linesize = 32000, so as far as I think, limitation on length of records while writing the file is not an issue.
    Further code is written as:
    UTL_FILE.PUTF(V_FILEHANDLE, v_text1||'|'||v_text2||'|');
    UTL_FILE.NEW_LINE(V_FILEHANDLE);
    UTL_FILE.FFLUSH(V_FILEHANDLE); -- This is called after every 500 lines are written to the file.
    UTL_FILE.FCLOSE(V_FILEHANDLE);
    We are encountering this error every now and then, and strangely this gets resolved when we re-run the program and file gets written successfully.
    Can someone please help on this please?Not without seeing complete code so that we can try and reproduce the problem or spot where you may be going wrong.

  • Directory object error ORA-29285

    Hi All,
    I am facing a problem with the Directory object in oracle 9i.
    Their is a procedure trying to perform Read/Write operation to the directory using utl_file(to print (generate) labels).
    I am some times getting this err no ORA-29285 and
    most of the times I am not getting this err with the same operation.
    My question is
    1) Is it because that 2 or more user trying to perform Read/Write operation on that Directory at the same time
    2) If not the above that what could be the problem
    Kindly help.
    AAK.

    hi,
    First thing to check on all errors with writing and reading files (in any language, any platform) is to make sure the process/program doing the writing has read/write access to the drive/path in question.
    Also you can/should use directory objects rather than straight file names for IO operations. If you don't, you'll need to check your utl_file parameter.
    also please paste the code, thanx.
    renjb

  • Mail...writing changes to disk...taking forever!

    My Mail has been rendered useless since Mavericks upgrade.  I have installed the initial patch and the most recent Mavericks update.  Same problem persists...
    Mail takes forever to load
    Mail is always writing changes to disk
    I love Mail - but it is useless now.  Frustrating.
    Most of my mail accounts are Gmail. 

    I cannot cope with this any longer, I am using a MacBook Pro and the machine is unusable since upgrading to Mavericks. Mail is churning constantly and I cannot do anything else with the machine. Can anyone suggest a new email programme or either on Mac or PC? I am sorry Apple but you have failed me for the final time with this upgrade.

  • Facing problem in xml schema xsd file registration

    Hi,
    i am facing problem in xml schema xsd file registration when
    the number of column is more. It is showing persing error.
    if i am deleting few column from xsd file . It is working otherwise
    showing error. Is there any solution for that please suggest me.
    The Error is
    ORA-31011:XML parsing failed
    ORA_19202: Error occurred in XML processing
    LPX-00230 : (message vary time to time-like invalid tag ending etc.)
    Regards
    Manoranjan
    and thanks in advance

    Where is you XML coming from. Are you sure it's valid. If you are hard coding it as a SQL String constant are you hitting the 4k / 32K limit on the size of SQL / PL/SQL constant. Have you tried loading the content from a bfile..

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());
        }

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

Maybe you are looking for