ORA-31011 Error. Help!

Guys,
I am running this simple query:
SELECT XMLELEMENT("mydate", sysdate) FROM dual;
Getting the below error:
ERROR:
ORA-31011: XML parsing failed
Database version:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
PL/SQL Release 9.2.0.5.0 - Production
CORE 9.2.0.6.0 Production
TNS for HPUX: Version 9.2.0.5.0 - Production
NLSRTL Version 9.2.0.5.0 - Production
Is this because of encoding/characterset issues ? Any help to pin-point what the problem is, would be appreciated. Thank You!

SQL> SELECT XMLELEMENT("mydate", sysdate) FROM dual;
XMLELEMENT("MYDATE",SYSDATE)
<mydate>02-JUL-07</mydate>
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release[b] 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE    9.2.0.8.0       Production
TNS for HPUX: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production

Similar Messages

  • ORA-31011 error over a "?"

    Hi all. I've got a database table which has a CLOB column and a Sys.XMLType column. In order to store the XML data, I insert the record with an EMPTY_CLOB() value, get a reference to the CLOB (as a java.sql.Clob object). Once I have the Java Clob object (the instance of oracle.sql.CLOB), I write my XML data to it. Once it's in the CLOB, I can update the original record by passing the Clob object in as a parameter to the update statement and SYS.XMLType.createXML(clobValue).
    I have an XML file which is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <CMProduct xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.adc.com/schema/cm/v4.0/CMProd
    uct" xsi:schemaLocation="http://www.adc.com/schema/cm/v4.0/CMProduct http://www.adc.com/schema/cm/v4.0/CMProduct
    .xsd">
    <class1>Peterson</class1>
    <class2>1200</class2>
    <class3>110 Minutes</class3>
    <class4>235 grams</class4>
    <class5>$49</class5>
    <comments>This low price means the minimum package cost for new- approved customers who remain connected to th
    e WonderNet? service for 12 continuous months is $454</comments>
    <description>Peterson 1200-110 Minutes-$49</description>
    <imageRef href="CMImage/mppet1200.xml">mp-pet-1200</imageRef>
    <name>MP-PET-1200</name>
    <securityGroup href="CMSecurityGroup/Default.xml">Default</securityGroup>
    </CMProduct>
    I've gone into the code, to see that the Clob value is correct. However, when the createXml is called, I get the error...
    java.sql.SQLException: ORA-31011: XML parsing failed
    ORa-19202: Error occurred in XML processing
    LPX-00217: invalid character 65533 (\uFFFD)
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    When I see what the character \uFFFD is, it turns out to be "?".
    So, the createXML is blowing up because I have a question mark in the XML file ... presumably the
    <?xml version="1.0" encoding="UTF-8"?>
    line. Which to my knowledge is perfectly correct XML.
    It also seems to quite happily accept other XML documents with the "?" in it. So is there any idea as to what's causing this error?
    Thanks,
    Ed

    Hmm, probably doesn't like the ? in the middle of the comments section... :) I'll keep looking....

  • ORA-00600 Error Help required

    I am getting Error ORA-00600 for a procedure which tries get
    a CLOB as output paramater. It is a simple stored proc which is
    just querying to get this data.
    However it fails at times giving ORA-00600 error which we have
    no clue why it's happening.
    There is sufficient space in the server and also we have
    restarted the database several times.
    Any pointers to why is this happening.
    Sunil

    Cause:     This is a catchall internal error message for Oracle
    program exceptions. It indicates that a process has met a low-
    level, unexpected condition.
    Various causes of this message include:
    time-outs
         file corruption
         failed data checks in memory
         hardware, memory, or I/O errors
         incorrectly restored files
    The first argument is the internal message number. Other
    arguments are various numbers, names, and character strings. The
    numbers may change meanings between different versions of the
    Oracle Server.
    Action:     Report this error to customer support after gathering
    the following information:
    -events that led up to the error
         -the operations that were attempted that led to the
    error
    -the conditions of the operating system and database at
    the time of the error
         -any unusual circumstances that occurred before
    receiving theORA-00600 message
         contents of any trace files generated by the error
         the relevant portions of the Alert file
    Copyright (C) 1995, Oracle Corporation

  • Ora-08102 - error help me out

    dear all,
    Im getting ora-8102 error
    "ORA-00604: error occurred at recursive SQL level 1
    ORA-08102: index key not found, obj# 49, file 47, block 25578 (2)" while im creating index on newly created table . I found the suggestion doc from metalink for the same. but it didn't work. because the obj#49 is the index (I_CON2) which related to table CON$. so im not able to rebuild the index as suggested in metalink.
    Im getting the same erorr for all schema even creating new table with constraints.
    Thanks
    mohan

    Why not ?Just a guess, since there is no error message from OP, Probably because:
    SQL> alter index I_CON2 rebuild ;
    alter index I_CON2 rebuild
    ERROR at line 1:
    ORA-00701: object necessary for warmstarting database cannot be altered
    SQL> disc
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    SQL>

  • Ora 12154 error help needed

    Hi,
    I am a newbie in oracle forms. I have installed oracle database 10gr2 on windows xp in c directory. In D drive i have installed oracle developer suite 10g. When i try to connect database from developer suite i receive ORA 12154 error.
    Do i need to change tnsnames.ora in developer suites 'D' directory or in database'C' directory.
    Please explain me in steps so that i can configure developer suite.
    Thank You

    Forms will use its own Tnsnames.ora file so create alias for it
    Run NetCA from
    START > PROGRAMS > ORACLE - Oracle HOME name > Configuration and Migration tools > Net Configuration Assistant
    and create Alias for Local naming
    also make sure the Listener and Database is up and running
    Baig,
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • ORA-00054 error help

    SQL> drop table worker_hourly
    ERROR at line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
    create table worker_hourly
    ( wrk_id       number(3),
      wrk_perhr    number(5,2) NOT NULL,
      wrk_otrate   number(3,2),
        primary key (wrk_id),
        constraint workerexist foreign key (wrk_id)
            references worker_super(wrk_id),
        constraint validot check (wrk_otrate < 2.5))
    insert into worker_hourly values (333,19.75,NULL)
    insert into worker_hourly values (444,15.45,1.5)
    /im trying to drop this table and start it up again but its showing up that error, how can i fix it, i've never encountered it before

    Either you're not giving the full picture here, or you missed:
    (issued from the session that has an outstanding transaction on your table) So:
    -Are you capable of indentifying sessions that lock 'your' table? (Any tool available?)
    -Do you have a DBA around you can ask?
    -Database version?
    -acces to datadictionary views like V$LOCK amnd V$LOCKED_OBJECT
    -is this a development or a production problem? (I think it's a development problem)
    any other suggestions???Give the full picture here, instead of letting us 'fire guesses at you'.
    That's like walking down 'Cumbersome Avenue'.

  • ORA 01438 error help

    Hi: I am using a different vendor's binary client to update in oracle 9.2.0.6. I am having difficulty figuring out which field is it having problem with. The client is trying to do an update. Since it's a binary client, I can't see the actual update command. Following is the error.
    ==============
    Fri Jul 29 16:54:08 2005: E-UNK-000-000: Oracle Error: [ORA-01438: value larger than specified precision allows for this colum] - sqlcode[-1438] Fri Jul 29 16:54:08 2005: E-UNK-000-000: Thread 'StatusTableUpdProcThread': Failed to send batch to Oracle database, due to an unknown error. Aborting the operation.
    ==============
    Any suggestions?
    Thanks
    Ravi

    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96524/c18trigs.htm#8287
    http://asktom.oracle.com/pls/ask/f?p=4950:8:6132787188731396225::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:871003242230
    Its a type of trigger that will be invoked by Oracle whenever you establish a new connection to the database. Within the body of this trigger, you could EXECUTE IMMEDIATE sql_trace to TRUE to enable trace for that session.

  • ORA-06550 error help

    Hi Everyone,
    I am brand new to APEX. I have created an application and it ran fine until I got this error:
    ORA-06550: line 1, column 642: PL/SQL: ORA-00917: missing comma ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
    Will you please point me in the direction as to how I can resolve this error? Thank you.

    alter table tableName drop constraint constraintName ;
    You cannot drop an index being used to enforce uniqueness. You must drop the constraint - which will also drop the index. You also cannot drop a unique constraint being used as a reference of a foreign key. Adding the keyword CASCADE will allow you to get around that, but it will destroy the FK references.
    alter table tableName drop constraint constraintName CASCADE ;

  • ORA-12505 error help needed

    I have 10g on my laptop and tyring to connect to my local db on Laptop via TOAD and gives me error ORA-12505.
    here is my TNSNAMES.ORA file:
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    EZAUDIT.2020LLC.COM =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 2020-5056)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EZAUDIT)
    here is my LISTENER.ORA file:
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 2020-5056)(PORT = 1521))
    "2020-5056" is my hostname of laptop.
    "EZAUDIT" is my SID name, which is the local DB name.
    Don't know what's going on. It was working fine for last 2 months, all of a sudden last 3-4 days i am having this issue. My Listener name is "LISTENER"
    If I change the SID = EZAUDIT to SERVICEf_NAME = EZAUDIT in my TNSNAMES.ORA file then the error I get is ORA-12514. Don't know what the issue. Please let me know ASAP, have to finish the project by next week.
    APPRCIATE your hlp.
    THANKS,
    Kas

    result of the lsnrctl services:
    C:\>lsnrctl services
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 07-JUL-2006 12:27
    :59
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=2020-5056)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    The command completed successfully
    SQLNET.ORA file:
    # sqlnet.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\sqlnet.ora
    # Generated by Oracle configuration tools.
    # This file is actually generated by netca. But if customers choose to
    # install "Software Only", this file wont exist and without the native
    # authentication, they will not be able to connect to the database on NT.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    Thanks,
    Kas

  • Getting "ORA-31011: XML parsing failed" using xmlAGG as rownum exceeds 1000

    I have a following script which is working and creating xml output when the rownum < 1000, but as the rownum <2000 clause is used, it is throwing "ORA-31011: XML parsing failed" error.
    There are about 2 million recirds that I need to extract in the xml file. Is there any way I can do that without creating 500 files?
    I am new in XML DB and any help/suggestion/input will be highly appreciated.
    Thanks.
    ---------------- script--------------------
    SET SERVEROUTPUT ON
    DECLARE
    v_xml              XMLTYPE;
    v_blob             BLOB;
    v_data_length      NUMBER;
    -- Loop Control Variables
    v_offset           NUMBER             DEFAULT 1;
    v_chunk   CONSTANT NUMBER             DEFAULT 4000;
    -- v_ctx   DBMS_XMLGen.ctxHandle;
    v_file  Utl_File.File_Type;
    BEGIN
    -- Create XML context.
        SELECT XMLELEMENT("COMBO_NETWORK", XMLAGG (IFC_BILL_LOC))
        INTO v_xml
        FROM (
        SELECT XMLELEMENT
            ("CLAIM",
             XMLFOREST(
            ib.clm_num as "CLM_NUM",
            NVL(ib.old_clm_num,' ') as "ALT_CLM_NUM",
            DECODE(ib.clm_stat_cde,1,'OPEN','CLOSED') as "CLM_STATUS",
            ib.SSN as "SSN",
            ib.CLMT_LAST_NAM as "LAST_NAME",
            ib.CLMT_FIRST_NAM as "FIRST_NAME",
            TO_CHAR(ib.CLMT_DOB,'RRRRMMDD') as "DOB",
            TO_CHAR(ib.CLMT_DOI,'RRRRMMDD') as "DOI",
            ib.ER_NAM as "EMPLOYER_NAME",
            sflo.cde  AS "DISTRICT_OFFICE",
            ib.ADD_UPDTE_DEL_FLG as "ADD_UPDATE_DELETE",
            XMLFOREST(ib.CLMT_FST_LINE_ADR||' '||ib.CLMT_SND_LINE_ADR  as "STREET",
                      ib.CLMT_CITY_ADR AS "CITY",
                      ib.CLMT_STATE_ADR as "STATE",
                      ib.CLMT_ZIP_CDE_ADR as "ZIP",
                      ' ' as "PHONE" ) AS "CLAIMNT_ADDRESS",
            DECODE(ib.CLMT_GENDER,1,'M',2,'F',' ') as "CLAIMNT_GENDER",
            XMLFOREST(ib.ADJ_LAST_NAM as "LAST_NAME",
                      ib.ADJ_FIRST_NAM as "FIRST_NAME",
                      au.PHONE_NUM as "PHONE",
                      au.USER_EMAIL as "EMAIL") as "ADJUSTER",
            NVL(ib.CATASTROPHE_FLG,'N') as "CATASTROPHE_FLAG"
        IFC_BILL_LOC
        FROM IFACE_BILL_CLAIM_TRANS ib, SCIF_LOCATIONS sflo, APPLICATION_USERS au
        WHERE ib.comb_transmit_dte IS NULL
        AND ib.SFLO_IDN = sflo.idn
        AND ib.adj_last_nam = UPPER(au.user_last_nam)
        AND ib.adj_first_nam = UPPER(au.user_first_nam)
        AND sflo.cde = 'NF'
        AND rownum < 1000);  -- Failes parsing as rownum < 2000 is used.
        -- Turn the XML into a BLOB
         v_blob := v_xml.getblobval (1);
         v_data_length := DBMS_LOB.getlength (v_blob);
        -- Output XML document to file.
          v_file := Utl_File.FOpen('/u08/test/testdev/interface/out', 'result1.xml', 'wb', v_chunk);
                LOOP
                EXIT WHEN v_offset > v_data_length;
                UTL_FILE.put_raw (v_file, DBMS_LOB.SUBSTR (v_blob, v_chunk, v_offset),
                                                                  TRUE);
                 v_offset := v_offset + v_chunk;
                END LOOP;
                    Utl_File.FClose(v_file);
            EXCEPTION
              WHEN NO_DATA_FOUND
              THEN
              -- We won't write any data, or even open the file,
              -- if the query return no rows
              NULL;
              END;
    --------------------- script end--------------------------
    Following is the version of  y database:
    SQL> col comp_name format a45
    SELECT comp_name, status, substr(version,1,10) as version
    FROM dba_registry;
    SQL> SQL>   2
    COMP_NAME                                     STATUS      VERSION
    Oracle Database Catalog Views                VALID       10.2.0.4.0
    Oracle Database Packages and Types       VALID       10.2.0.4.0
    JServer JAVA Virtual Machine                  VALID       10.2.0.4.0
    Oracle Database Java Packages                VALID       10.2.0.4.0
    Oracle XDK                                           VALID       10.2.0.4.0
    Oracle XML Database                              VALID       10.2.0.4.0
    6 rows selected.
    SQL>Edited by: mdrake on Feb 4, 2010 3:55 PM

    If you have the fix for bug 8246403 you can also control the behavoir with events. This avoids having to use explict translate operations on each column thay may contain bad data. Note this patch also has the effect of replacing the ORA-31011 error with the ORA-31061 error. Also note it is likely this error number will be changed again in the near future.
    SQL>       --
    SQL> -- Replace with ?
    SQL> --
    SQL>  alter session set events = '19119 trace name context forever, level 0x100000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BB?BB</Data><Data>CCCC</Data></Result>
    SQL>       --
    SQL> -- Replace with Character Reference
    SQL> --
    SQL> alter session set events = '19119 trace name context forever, level 0x200000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BB&#x0000;BB</Data><Data>CCCC</Data></Result>
    SQL>
    SQL>      --
    SQL> -- Remove Bad Characters
    SQL> --
    SQL> alter session set events = '19119 trace name context forever, level 0x400000'
      2  /
    Session altered.
    SQL> select xmlElement
      2         (
      3            "Result",
      4            xmlAgg
      5            (
      6               xmlElement("Data",MY_DATA)
      7            )
      8         )
      9    from T1
    10  /
    XMLELEMENT("RESULT",XMLAGG(XMLELEMENT("DATA",MY_DATA)))
    <Result><Data>AAAA</Data><Data>BBBB</Data><Data>CCCC</Data></Result>
    SQL>
    SQL>Edited by: mdrake on Feb 4, 2010 3:45 PM
    Edited by: mdrake on Feb 4, 2010 3:46 PM
    Edited by: mdrake on Feb 4, 2010 3:47 PM

  • Character set Conversion (US7ASCII to AL32UTF8) -- ORA-31011 problem

    Hello,
    We've run into some problems as part of our character set conversion from US7ASCII to AL32UTF8. The latest problem is that we have a query that works in US7ASCII, but after converting to AL32UTF8 it no longer works and generates an ORA-31011 error. This is very concerning to us as this error indicates an XML parsing problem and we are doing no XML whatsoever in our DB. We do not have XML columns (nor even CLOBs or BLOBs) nor XML tables and it's not XMLDB.
    For reference, we're running 11.2.0.2.0 over Solaris.
    Has anyone seen this kind of problem before?
    If need be, I'll find a way to post table definitions. However, it's safe to assume that we are only using DATE, VARCHAR2 and NUMBER column types in these tables. All of the tables are local to the DB.
    Thanks

    We converted using the database using scripts I developed. I'm not quite sure how we converted is relevant, other than saying that we did not use the Oracle conversion utility (not csscan, but the GUI Java tool).
    A summary:
    1) We replaced the lossy characters by parsing a csscan output file
    2) After re-scanning with csscan and coming up clean, our DBA converted the database to AL32UTF8 (changed the parameter file, changing the character set, switched the semantics to char, etc).
    3) Final step was changing existing tables to use char semantics by changing the table schema for VARCHAR2 columns
    Any specific steps I cannot easily answer, I worked with a DBA at our company to do this work. I handled the character replacement / DDL changes and the DBA ran csscan & performed the database config changes.
    Our actual error message:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00210: expected '<' instead of '�Error at line 1
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    Error at Line: 24 Column: 15
    This seems to match the the document ID referenced below. I will ask our DBA to pull it up and review it.
    Please advise if more information is needed from my end.

  • ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing

    Hi,
    I am trying to update an already existing Sales Order through PO Change Inbound 860. When i am performing changes in the line quantity and scheduled ship date with operation code as "Update" then it is successfully updating the Order and also we are able to generate the POAck for the updated sales order lines. But when i am rejecting one of the PO change lines by checking rejected flag, then order is getting imported successfully(I mean sales order is getting updated successfully) but during the POAck Generation i.e. 865 its raising "*ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00103: Warning: document structure does not match DTD Error at line 1*" at XML Gateway. we are using XML Gateway to process the orders, can somebody help me to get rid of this issue. Thanks in advance.
    Thanks,
    Sunil Chauhan

    Hi Kishan
    Thanks for the reply.
    Because this is an outbound transaction so i can not provide you the XML file as we are facing issue to generate the same. Also we are using oracle seeded PO outbound Ack map.
    In addition i can provide you the DTD file.
    <!-- ==================================================== -->
    <!ENTITY % RESOURCES SYSTEM "oagis_resources.dtd">
    %RESOURCES;
    <!-- ==================================================== -->
    <!ELEMENT ACKNOWLEDGE_PO_008 (CNTROLAREA, DATAAREA+)>
    <!ATTLIST VERB
         value CDATA #FIXED "ACKNOWLEDGE"
    >
    <!ATTLIST NOUN
         value CDATA #FIXED "PO"
    >
    <!ATTLIST REVISION
         value CDATA #FIXED "008"
    >
    <!ELEMENT DATAAREA (ACKNOWLEDGE_PO)
    >
    <!ELEMENT ACKNOWLEDGE_PO (POORDERHDR, POORDERLIN*)
    >
    <!ELEMENT POORDERHDR ((%DATETIME.DOCUMENT;)?, (%OPERAMT.EXTENDED.T;)?, POID, POTYPE, ACKREQUEST?, CONTRACTB?, CONTRACTS?, DESCRIPTN?, NOTES*, OPRAMTAUTH?, PORELEASE?, TAXWHEXMPT?, USERAREA?, ACKHEADER, ATTCHREF*, CHARGE*, PARTNER*, POTERM*)
    >
    <!ELEMENT ACKHEADER (SENDER, (%DATETIME.PROMDELV;)?, (%DATETIME.PROMSHIP;)?, ACKCODE, DESCRIPTN?, NOTES*, SALESORDID?, USERAREA?)
    >
    <!ELEMENT POTERM (DESCRIPTN?, TERMID?, ((DAYOFMONTH, PROXMONTH) | DAYSNUM), ((%OPERAMT.EXTENDED.T;) | (%QUANTITY.PERCENT;)), USERAREA?)
    >
    <!ELEMENT POORDERLIN ((%QUANTITY.ORDERED;), (%DATETIME.NEEDDELV;)?, (%OPERAMT.UNIT.T;)?, POLINENUM, DRAWING?, HAZRDMATL?, ITEMRV?, ITEMRVX?, NOTES*, PACKING?, POLNSTATUS?, TAXWHEXMPT?, ((DESCRIPTN, ITEM?, ITEMX?, UPC?) | (ITEM, ITEMX?, UPC?) | (ITEMX, UPC?) | (UPC)), USERAREA?, ACKLINE*, ATTCHREF*, CHARGE*, DISTRIBUTN*, PARTNER*, POTERM*, POSUBLINE*, POLINESCHD*)
    >
    <!ELEMENT ACKLINE ((%DATETIME.PROMDELV;)?, (%DATETIME.PROMSHIP;)?, (%QUANTITY.ORDERED;)?, ACKCODE, NOTES*, SALESORDID?, USERAREA?)
    >
    <!ELEMENT POSUBLINE ((%QUANTITY.ITEM;), DRAWING?, ITEMRV?, ITEMRVX?, PSBLINENUM?, ((DESCRIPTN, ITEM?, ITEMX?, UPC?) | (ITEM, ITEMX?, UPC?) | (ITEMX, UPC?) | (UPC)), USERAREA?)>
    <!ELEMENT POLINESCHD ((%DATETIME.NEEDDELV;), (%QUANTITY.ORDERED;), DESCRIPTN?, PSCLINENUM?, USERAREA?)
    >
    Thanks,S
    --Sunil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • URGENT HELP !!! ORA-31011: XML parsing failed

    Hi,
    Oracle 9.2.0.4
    I've run into
    ORA-31011: XML parsing failed ORA-19202: Error
    occurred in XML processing LPX-00247: invalid
    Document Type Declaration (DTD) Error at line 1
    ORA-06512: at line 15
    during updateXML operation under CLOB resource.
    It seems to me, I can't update created resource
    at all.
    Is anybody knows the workaround ?
    Please, help !!!
    Thanks,
    Viacheslav

    No, it is an html file. For test purpose I've taken
    welcome.html from ORACLE_HOME installation. Here are
    my test:
    declare
    res0 bfile := BFILENAME('TEMPDIR', 'welcome.html');
    res clob;
    Amount INTEGER := 4000;
    b BOOLEAN;
    begin
    Amount:=DBMS_LOB.getlength(res0);
    DBMS_LOB.CREATETEMPORARY(res,TRUE);
    DBMS_LOB.OPEN(res0, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(res, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(res, res0,Amount);
    --DBMS_LOB.CLOSE(res0);
    b:=DBMS_XDB.createresource
    ('/MyCONTENT/welcome.html',res);
    commit;
    end;
    declare
    res0 bfile := BFILENAME('TEMPDIR', 'welcome.html');
    clob1 clob;
    amt number := dbms_lob.lobmaxsize;
    src_offset number := 1 ;
    dst_offset number := 1 ;
    lang_ctx number := dbms_lob.default_lang_ctx;
    warning number;
    Amount INTEGER := 4000;
    begin
    Amount:=DBMS_LOB.getlength(res0);
    DBMS_LOB.CREATETEMPORARY(clob1 ,TRUE);
    DBMS_LOB.OPEN(res0, DBMS_LOB.LOB_READONLY);
    DBMS_LOB.OPEN(clob1 , DBMS_LOB.LOB_READWRITE);
    -- DBMS_LOB.LOADFROMFILE(clob1 , res0,Amount);
    dbms_lob.LOADCLOBFROMFILE(clob1 ,res0, amt, dst_offset,
    src_offset,dbms_lob.default_csid, lang_ctx,warning) ;
    UPDATE xdb.resource_view SET res=updatexml
    (res,'/Resource/Contents/*',
    WHERE any_path= '/MyCONTENT/welcome.html';
    commit;
    --dbms_lob.filecloseall() ;
    end;

  • ORA-01458 error while using Pro*C to invoke PL/SQL procedure, pls help

    I am using Pro*C (Oracle 10g on Itanium platform) to invoke PL/SQL procedure to read RAW data from database, but always encoutered ORA-01458 error message.
    Here is the snippet of Pro*C code:
    typedef struct dataSegment
         unsigned short     len;
         unsigned char     data[SIZE_DATA_SEG];
    } msg_data_seg;
    EXEC SQL TYPE msg_data_seg IS VARRAW(SIZE_DATA_SEG);
         EXEC SQL BEGIN DECLARE SECTION;
              unsigned short qID;
              int rMode;
              unsigned long rawMsgID;
              unsigned long msgID;
              unsigned short msgType;
              unsigned short msgPriority;
              char recvTime[SIZE_TIME_STRING];
              char schedTime[SIZE_TIME_STRING];
              msg_data_seg dataSeg;
              msg_data_seg dataSeg1;
              msg_data_seg dataSeg2;
              short     indSeg;
              short     indSeg1;
              short     indSeg2;
         EXEC SQL END DECLARE SECTION;
         qID = q_id;
         rMode = (int)mode;
         EXEC SQL EXECUTE
              BEGIN
                   SUMsg.read_msg (:qID, :rMode, :rawMsgID, :msgID, :msgType, :msgPriority, :recvTime,
                        :schedTime, :dataSeg:indSeg, :dataSeg1:indSeg1, :dataSeg2:indSeg2);
              END;
         END-EXEC;
         // Check PL/SQL execute result, different from SQL
         // Only 'sqlcode' and 'sqlerrm' are always set
         if (sqlca.sqlcode != 0)
              if (sqlca.sqlcode == ERR_QUEUE_EMPTY)          // Queue empty
                   throw q_eoq ();
              char msg[513];                                        // Other errors
              size_t msg_len;
              msg_len = sqlca.sqlerrm.sqlerrml;
              strncpy (msg, sqlca.sqlerrm.sqlerrmc, msg_len);
              msg[msg_len] = '\0';
              throw db_error (string(msg), sqlca.sqlcode);
    and here is the PL/SQL which is invoked:
    SUBTYPE VarChar14 IS VARCHAR2(14);
    PROCEDURE read_msg (
         qID          IN     sumsg_queue_def.q_id%TYPE,
         rMode          IN     INTEGER,
         raw_msgID     OUT     sumsg_msg_data.raw_msg_id%TYPE,
         msgID          OUT sumsg_msg_data.msg_id%TYPE,
         msgType          OUT sumsg_msg_data.type%TYPE,
         msgPrior     OUT sumsg_msg_data.priority%TYPE,
         msgRecv          OUT VarChar14,
         msgSched     OUT VarChar14,
         msgData          OUT sumsg_msg_data.msg_data%TYPE,
         msgData1     OUT sumsg_msg_data.msg_data1%TYPE,
         msgData2     OUT sumsg_msg_data.msg_data2%TYPE
    ) IS
    BEGIN
         IF rMode = 0 THEN
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY sched_time, raw_msg_id)
                   WHERE ROWNUM = 1;
         ELSIF rMode = 1 THEN
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY recv_time, raw_msg_id)
                   WHERE ROWNUM = 1;
         ELSE
              SELECT raw_msg_id, msg_id, type, priority, TO_CHAR(recv_time, 'YYYYMMDDHH24MISS'),
                   TO_CHAR(sched_time, 'YYYYMMDDHH24MISS'), msg_data, msg_data1, msg_data2
                   INTO raw_msgID, msgID, msgType, msgPrior, msgRecv, msgSched, msgData, msgData1, msgData2
                   FROM (SELECT * FROM sumsg_msg_data WHERE q_id = qID AND status = 0 ORDER BY priority, raw_msg_id)
                   WHERE ROWNUM = 1;
         END IF;
         UPDATE sumsg_msg_data SET status = 1 WHERE raw_msg_id = raw_msgID;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
              raise_application_error (-20102, 'Queue empty');
    END read_msg;
    where sumsg_msg_data.msg_data%TYPE, sumsg_msg_data.msg_data1%TYPE and sumsg_msg_data.msg_data2%TYPE are all defined as RAW(2000). When I test the PL/SQL code seperately, everything is ok, but if I use the Pro*C code to read, the ORA-01458 always happen, unless I change the SIZE_DATA_SEG value to 4000, then it passes, and the result read out also seems ok, either the bigger or smaller value will encounter ORA-01458.
    I think the problem should happen between the mapping from internal datatype to external VARRAW type, but cannot understand why 4000 bytes buffer will be ok, is it related to some NLS_LANG settings, anyone can help me to resolve this problme, thanks a lot!

    It seems that I found the way to avoid this error. Now each time before I read RAW(2000) data from database, i initialize the VARRAW.len first, set its value to SIZE_DATA_SEG, i.e., the outside buffer size, then the error disappear.
    Oracle seems to need this information to handle its data mapping, but why output variable also needs this initialization, cannot precompiler get this from the definition of VARRAW structure?
    Anyone have some suggestion?

  • Help with ORA 14400 error while inserting data

    Hi all,
    i am facing an ora 14400 error in the following scenario , please help.
    i have created a table using the syntax:
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    when i try to insert data using :
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    i get the following error output:
    Error report:
    SQL Error: ORA-14400: inserted partition key does not map to any partition
    14400. 00000 - "inserted partition key does not map to any partition"
    *Cause:    An attempt was made to insert a record into, a Range or Composite
    Range object, with a concatenated partition key that is beyond
    the concatenated partition bound list of the last partition -OR-
    An attempt was made to insert a record into a List object with
    a partition key that did not match the literal values specified
    for any of the partitions.
    *Action:   Do not insert the key. Or, add a partition capable of accepting
    the key, Or add values matching the key to a partition specification

    Hi Chaitanya,
    Change your table script to
    CREATE TABLE temp_table
    GRPKEY NUMBER(20, 0) NOT NULL,
    UKEY NUMBER(10, 0),
    ANUM VARCHAR2(250 BYTE),
    APC VARCHAR2(2 BYTE),
    SID VARCHAR2(65 BYTE),
    RDATETIME VARCHAR2(19 BYTE),
    CKEY NUMBER(20, 0),
    AVER VARCHAR2(25 BYTE),
    CVER VARCHAR2(250 BYTE),
    TNAME VARCHAR2(50 BYTE),
    SCODE VARCHAR2(30 BYTE),
    PTYPE VARCHAR2(50 BYTE),
    FILENUMB NUMBER(10, 0),
    LINENUMB NUMBER(10, 0),
    ENTRY_CREATEDDATE DATE
    , CONSTRAINT temp_table_PK PRIMARY KEY (GRPKEY))
    PARTITION BY RANGE(ENTRY_CREATEDDATE)
    (PARTITION P0 VALUES LESS THAN(TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
    PARTITION P1 VALUES LESS THAN(MAXVALUE)
    insert into temp_table values
    (1,null,null,null,null,null,null,null,null,null,null,null,null,null,'01-NOV-2010');
    1 row insertedor refer question regarding "Date Partitioning a table"
    *009*
    Edited by: 009 on Nov 3, 2010 11:29 PM

Maybe you are looking for