InsertXML setDateFormat error

I'm getting an error when using insertxml and my xml document has dates in it. I have
set the procedure "setDateFormat" to the
appropriate date mask. I have tried many different date formats and the only way I can get it to work is when there are no dates in the xml document. I have attached a test script and the resulting error.
Thanks in advance
Rodger
declare
xmlString CLOB := null;
rowsp integer;
v_xml_out varchar2(32000);
begin
v_xml_out := '<ORDER_STATUS>
<order_detail>
<ORDS_WEB_ORDER_NBR>WEB-ORD-12345</ORDS_WEB_ORDER_NBR>
<ORDS_WEB_CUSTOMER_NBR>WEB-CUST-12345</ORDS_WEB_CUSTOMER_NBR>
<ORDS_CUSTOMER_NAME>Rodger Winger</ORDS_CUSTOMER_NAME>
<ORDS_COMPANY_ID>MUS</ORDS_COMPANY_ID>
<ORDS_DOC_DATE_TIME>12-Dec-00</ORDS_DOC_DATE_TIME>
<ORDS_DOC_ID>DOC-ID-123</ORDS_DOC_ID>
<ORDS_RMA_NBR>RMA-NBR-123</ORDS_RMA_NBR>
<ORDS_PRODUCT_QTY>100</ORDS_PRODUCT_QTY>
<ORDS_BACKORDERED_QTY>25</ORDS_BACKORDERED_QTY>
<ORDS_SHIPPED_QTY>40</ORDS_SHIPPED_QTY>
<ORDS_RETURN_QTY>10</ORDS_RETURN_QTY>
<ORDS_RETURN_REASON>Return-Reason</ORDS_RETURN_REASON>
<ORDS_REFUND_DISPOSITION>Ref-Disp-1</ORDS_REFUND_DISPOSITION>
<ORDS_LINE_NBR>1</ORDS_LINE_NBR>
<ORDS_SKU>SKU-12345</ORDS_SKU>
<ORDS_STATUS>Status-321</ORDS_STATUS>
<ORDS_SHIP_METHOD_CODE>FEDEX-ON</ORDS_SHIP_METHOD_CODE>
<ORDS_CREATION_DATE></ORDS_CREATION_DATE>
<ORDS_CANCELLED_QTY>3</ORDS_CANCELLED_QTY>
<ORDS_ITEM_AVAILABLE_DATE></ORDS_ITEM_AVAILABLE_DATE>
<ORDS_TRACKING_NBR>ORDS-TRK-NBR-123</ORDS_TRACKING_NBR>
<ORDS_LOT_NBR>ORDS-LOT-NBR-789</ORDS_LOT_NBR>
<ORDS_SERIAL_NBR>ORDS-SRL-NBR-657</ORDS_SERIAL_NBR>
<ORDS_REASON>Order Status Reason</ORDS_REASON>
<ORDS_CONTAINER_NBR>65</ORDS_CONTAINER_NBR>
<ORDS_EXPECTED_ARRIVAL_DATE></ORDS_EXPECTED_ARRIVAL_DATE>
<ORDS_MSG_TRANSACTION_TYPE>ORDERSTATUS</ORDS_MSG_TRANSACTION_TYPE>
<ORDS_CRTNG_MSG_ID>100</ORDS_CRTNG_MSG_ID>
<ORDS_MSG_COMPANY_ID>MUS</ORDS_MSG_COMPANY_ID>
</order_detail>
</ORDER_STATUS>';
DBMS_LOB.CREATETEMPORARY(xmlString,TRUE, DBMS_LOB.SESSION);
DBMS_LOB.WRITEAPPEND (xmlString, length(v_xml_out), v_xml_out);
-- open the lob
dbms_lob.open(xmlString,DBMS_LOB.LOB_READONLY);
-- before inserting , make sure that the case is ignored (since we generated everything with lower case)
xmlgen.resetOptions;
xmlgen.setRowTag('order_detail');
xmlgen.setIgnoreTagCase(xmlgen.IGNORE_CASE);
xmlgen.setDateFormat('DD-MON-YY');
-- insert the XML document
rowsp := xmlgen.insertXML('ords_order_statuses',xmlString);
dbms_output.put_line(' Rows processed = '&#0124; &#0124; TO_CHAR(rowsp));
-- free the lob
dbms_lob.close(xmlString);
dbms_lob.freetemporary(xmlString);
end;
error message
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
oracle.xml.sql.OracleXMLSQLException: Unparseable date: "12-Dec-00"
ORA-06512: at "XMLOWNER20.XMLGEN", line 114
ORA-06512: at line 61

You have to use the date format masks that are defined at:
http://java.sun.com/products/jdk/1.1/docs/api/java.text.SimpleDateFormat.html
which are difference from the standard Oracle date masks.
For dates of the form 12-Dec-00, the mask would be (case-sensitive!):
d-M-yy
null

Similar Messages

  • Badly formed class

    initialization complete
    loading : HCXMLUtil
    creating : HCXMLUtil
    resolver :
    resolving: HCXMLUtil
    errors : HCXMLUtil
    ORA-29545: badly formed class: at offset 163 of HCXMLUtil.readXML expecting a class-org
    .w3c.dom.Document but encountered a class-oracle.xml.parser.v2.XMLDocument.
    loadjava: 1 errors
    Java Code:
    Document root = new XMLDocument();
    root.appendChild( result );
    conn = getConnection();
    sav = new OracleXMLSave( conn, sTable );
    sav.insertXML( root ); // **** Error here
    Please help.

    Yes, I am using Oracle 9i version 2 with JDK 1.3.1. I have also tried loading in without -resolve option. But when I run the program, it didn't like it because these classes are still marked as invalid.
    The owner of the imported classes (ILOG) is still trying to figure out why as well. Probably some Oracle DBA experts like you out there may be able to throw in a few suggestions on what could be the problem?
    A small part of the error stack:
    resolving: class ilog/jum/client/IluCollector$Getter
    errors : class ilog/jum/client/IluCollector$Getter
    ORA-29534: referenced object xxx.ilog/jum/client/IluCollector could notProbably some Oracle DBA experts like you guys can throw in a few more suggestions on what could be the problem?
    be resolved
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluCollector$SystemPropertyGetter
    ORA-29534: referenced object xxx.ilog/jum/client/IluCollector$Getter cou
    ld not be resolved
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluCollector
    ORA-29534: referenced object xxx.ilog/jum/client/IluSAM could not be res
    olved
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluConnectionThread
    ORA-29534: referenced object xxx.ilog/jum/client/IluJumServerUtil could
    not be resolved
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluJumLog
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluJumServerUtil
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluLicenseChecker
    ORA-29534: referenced object xxx.ilog/jum/util/IluDigestorInvalidFormatE
    xception could not be resolved
    ORA-29545: badly formed class:
    errors : class ilog/jum/client/IluLicenseReader
    ORA-29534: referenced object xxx.ilog/jum/client/IluLicenseChecker could
    not be resolved
    ORA-29545: badly formed class:
    Thanks,
    M

  • Error while using dbms_xmlsave.UpdateXML and dbms_xmlsave.insertXML

    The Record I am trying to insert/update has the following structure
    <ROWSET>
    <ROW>
    <COL1>123</COL1>
    </ROW>
    </ROWSET>
    Table structure is as below
    COL1 INT [Primary constraint]
    COL2 VARCHAR2(100) NOT NULL [but has default value of 'COL2_Default']
    Now since the XML doesn't have the entry for COL2, I am explicitly setting the columns to be updated/inserted using dbms_xmlsave.setUpdateColumn.
    I use the logic the following logic to insert/update the table
    -- set the primary key column name. This forms the where clause for update statement
    dbms_xmlsave.setkeycolumn(l_Context , 'COL1');
    -- cXML have the XML structure mentioned above
    l_rows := dbms_xmlsave.updateXML(l_Context, cXML);
    IF l_rows <= 0 THEN -- which means no rows found for update
    l_rows := dbms_xmlsave.insertXML(l_Context, cXML);
    END IF;
    Now when the excution of dbms_xmlsave.updateXML happens Java Runtime Error is thrown.
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: 'java.sql.SQLException: Missing IN or OUT parameter at index:: 5' encountered during processing ROW element 0. All prior XML row changes were rolled back. in the XML document.
    The version of oracle I am using is 9.2.0.6.0.
    Please let me know if anyone has any idea on this error.

    Found maybe an applicable reference...
    On http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/Java_2_Connectivity_(J2C)/1163246.html
    it says:
    * Application code is missing a setXXX method call somewhere.
    * There might be a problem in the Oracle JDBC driver code.
    If the latter is the problem than you should or try a different JDBC driver or (which is probably the best solution anyway) create an iTar with Oracle support via metalink.oracle.com
    Other references can also be found on the internet when using google which could be applicable. Search on keywords: "Missing IN or OUT parameter at index"
    Message was edited by:
    mgralike

  • DBMS_XMLSave.insertXML ORA-01024 error

    DBMS_XMLSave.insertXML ORA-01024 error
    The following error is being produced when trying to use DBMS_XMLSave.insertXML. The xml datagram was produced from the view using DBMS_XMLQuery.getXML. This works fine for non object nested views.
    Does anyone know of a problem with this approach or syntax.
    Thanks
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: 'oracle.jdbc.driver.OracleSQLException:
    ORA-01024: invalid datatype in OCI call
    ' encountered during processing ROW element 1. All prior XML row changes were
    rolled back. in the XML document.
    ORA-06512: at "SYSTEM.DBMS_XMLSAVE", line 91
    ORA-06512: at "SJS.IMRES", line 60
    ORA-06512: at "SJS.IMRES", line 99
    ORA-06512: at line 6
    *************** Insert Procedure *******************
    PROCEDURE InsertXml(xmlDoc IN clob, tableName IN VARCHAR2) IS
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('INsertXml - '||tableName);
    insCtx := DBMS_XMLSave.newContext(tableName);
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc);
    dbms_output.put_line('InsertXML -'||rows);
    DBMS_XMLSave.closeContext(insCtx);
    COMMIT;
    END InsertXml;
    *************** Object view *******************
    CREATE OR REPLACE TYPE sjs.imres_error_type AS OBJECT
    ("ResponseErrorCode"     VARCHAR2(10),
    "ResponseErrorDesc"     VARCHAR2(4000))
    CREATE OR REPLACE TYPE sjs.imres_errors_type AS TABLE OF imres_error_type
    CREATE OR REPLACE VIEW sjs.imresponse
    AS SELECT ith.a_id AS "ArrestNumber",
    CAST(MULTISET(SELECT ire.errorcode,
    ire.errordesc
    FROM sjs.imresponseerrors ire
    WHERE ire.ith_id = ith.ith_id) AS imres_errors_type) AS "Errors"
    FROM sjs.imtransactionhistory ith
    *************** XML DATAGRAM *******************
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW>
    <ArrestNumber>2</ArrestNumber>
    <Errors>
    <Errors_ITEM>
    <ResponseErrorCode>CODE 2</ResponseErrorCode>
    <ResponseErrorDesc>DESC 2</ResponseErrorDesc>
    </Errors_ITEM>
    <Errors_ITEM>
    <ResponseErrorCode>CODE 1</ResponseErrorCode>
    <ResponseErrorDesc>DESC 1</ResponseErrorDesc>
    </Errors_ITEM>
    </Errors>
    </ROW>
    </ROWSET>

    It seems to be related to an insert/update for the same context
    having different columns with "values" in it.
    I have 3 rows. For the AMT column the first row has 151.56,
    the second row has 100.00, the third row has .00
    The third row fails with this error :
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "MTRSTEST.KIM_RTL_XML_PKG", line 150
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException:
    Invalid context handle specified.
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 170
    ORA-06512: at "MTRSTEST.KIM_RTL_XML_PKG", line 193
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException:
    Expected 'EOF'.
    ORA-06512: at "MTRSTEST.KIM_TEST", line 197
    ORA-06512: at line 1
    If I change the third row to say 10.00, for example, it works
    fine.
    We had not been on xdk9 yet, I'm having them install xdk9 and
    we'll see if the problem persists.

  • Error opening external DTD 'Segnatura.dtd' using dbms_xmlsave.insertXML

    I've been trying to insert a document in a table. All works fine
    if the xml doesn't contains the doctype element!
    If I add the row
    <!DOCTYPE Segnatura SYSTEM "Segnatura.dtd">
    to my xml I get the error:
    oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
    'Segnatura.dtd'.
    If I specify all the path "file:///temp/Segnatura.dtd" the insert
    works, but I don't want to do in that way beacause I don't want
    to modify the original xml that i'm inserting!
    In the package dbms_xmlsave I have no ways to change the
    basedir/baseurl
    or to setValidationMode to false like in xmlparser package.
    Is there any way to solve this problem??
    Thank's in advance
    Mauro
    This is an example scratch of my xml doc:
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>
    <!DOCTYPE Segnatura SYSTEM "Segnatura.dtd">
    <Segnatura versione="2001-05-07"
    xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="it">
    </Segnatura>

    Hy Steven, thank's for your attention.
    I'm not using the xsql servlet.
    I'm reading an xml file coming from the file system and I want to
    import it in the db using a java stored proc.
    I also have the dtd file (Segnatura.dtd) but I don't know where
    to put in on the server.
    If I run my java program and I put Segnatura.dtd in the execution
    classpath on the program the xml is loaded fine.
    If I load the stored proc in the db then I don't know where to
    put the dtd. Do I have to put the directory containing the dtd in
    the server classpath and the restart the db maibe?
    thank's
    mauro

  • Error: Unparseable date with OracleXMLSave

    Hi,
    Error:
    oracle.xml.sql.OracleXMLSQLException: java.text.ParseException: Unparseable date: "03/18/2099"
    int oracle.xml.sql.dml.OracleXMLSave.insertXML(org.w3c.dom.Document)
    void b2b.RcvQueueListener.saveCsmToTso(oracle.xml.parser.v2.XMLDocument)
    void b2b.RcvQueueListener.<init>()
    void b2b.RcvQueueListener.main(java.lang.String[])
    I've tried to save a row in the database with OracleXMLSave:
    I use JDeveloper 3.1.1.2 with XDK 2.? and a local Oracle 8.1.6 unde NT.
    // XML Doc:
    <ROWSET>
    <ROW NUM="1">
    <CSM_NO>A29912</CSM_NO>
    <CRE_DAY_CSM>03/18/2099</CRE_DAY_CSM>
    <CSM_VOL_GRO_FRZ>59.89</CSM_VOL_GRO_FRZ>
    </ROW>
    </ROWSET>
    // Set java enviroment:
    Locale.setDefault(java.util.Locale.US);
    // Save Data with XSU like:
    OracleXMLSave sav =
    new OracleXMLSave(cn.getConnection(), "consignment_t");
    sav.insertXML(csmData);
    Same Error when trying to...
    (1) set date format for OracleXMLSave:
    > sav.setDateFormat("DD/MM/YYYYY");
    (2) set database parameter:
    > nls_date_format='DD/MM/YYYY';
    > nls_language='AMERICAN';
    (3) set registry (winnt)
    > nls_lang=AMERICAN_AMERICA.WEISO8859P1
    Help would be appreciated.
    Thanks in advance!
    Matthias.

    setDateFormat() is expecting a format mask that is valid for the java.text.SimpleDateFormat object.
    So, just do:
    setDateFormat("d/M/yyyy");
    null

  • Error using XSQL 10 servlet

    I am using the XSQL servlet from the xdk_nt_10_1_0_2_0_production.zip package. When I run a example I always get the following error (NoSuchMethodError) I am using the xmlparserv2.jar from the xdk\lib dir. What could be wrong?
    java.lang.NoSuchMethodError
    at oracle.xml.util.QxName.<init>(QxName.java:65)
    at oracle.xml.util.QxNameHash.add(QxNameHash.java:116)
    at oracle.xml.util.QxNameHash.create(QxNameHash.java:72)
    at oracle.xml.parser.v2.XMLEntity.<init>(XMLEntity.java:136)
    at oracle.xml.parser.v2.XMLEntity.<init>(XMLEntity.java:156)
    at oracle.xml.parser.v2.DTD.<clinit>(DTD.java:1031)
    at oracle.xml.parser.v2.NonValidatingParser.<init>(NonValidatingParser.j
    ava:155)
    at oracle.xml.parser.v2.XMLParser.<init>(XMLParser.java:150)
    at oracle.xml.parser.v2.DOMParser.<init>(DOMParser.java:84)
    at oracle.xml.xsql.XSQLParserHelper.parse(XSQLParserHelper.java:104)
    at oracle.xml.xsql.XSQLConfigManager.reloadConfigFile(XSQLConfigManager.java:315)

    I am also getting the same error with the following call;
    OracleXMLSave xs2 = new OracleXMLSave(this.dbConnection,
    LimitsWorkflowXDKObjectDAO.LIMITS_WF_O_TABLE);
    if ( xs2 == null ) System.out.println("XML_SAVE IS NULL");
    else
    xs2.setKeyColumnList(pkArray);
    xs2.setIgnoreCase(true);
    xs2.setRowTag(LimitsWorkflowXDKObjectDAO.LIMITS_WF_O_ROW_TAG);
    if (dateFormat != null)
    xs2.setDateFormat(dateFormat);
    rows = xs2.insertXML(xmlDoc);
    javax.xml.namespace.QName.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
         at oracle.xml.util.QxName.(QxName.java:65)
         at oracle.xml.util.QxNameHash.add(QxNameHash.java:116)
         at oracle.xml.util.QxNameHash.create(QxNameHash.java:72)
         at oracle.xml.parser.v2.XMLEntity.(XMLEntity.java:136)
         at oracle.xml.parser.v2.XMLEntity.(XMLEntity.java:156)
         at oracle.xml.parser.v2.DTD.(DTD.java:1031)
         at oracle.xml.parser.v2.NonValidatingParser.(NonValidatingParser.java:155)
         at oracle.xml.parser.v2.XMLParser.(XMLParser.java:150)
         at oracle.xml.parser.v2.DOMParser.(DOMParser.java:84)
         at oracle.xml.sql.dml.OracleXMLSave.initParser(OracleXMLSave.java:300)
         at oracle.xml.sql.dml.OracleXMLSave.saveXML(OracleXMLSave.java:2370)
         at oracle.xml.sql.dml.OracleXMLSave.insertXML(OracleXMLSave.java:1352)

  • PLS-00307: too many declarations of 'INSERTXML' match this call

    Dear All,
    I need help to create a procedure. I am describing the scenario below.
    I have a table which is
    xml_clob(
    doc_id number,
    doc clob
    The above table contain an xml file in doc column. What i need is read the doc column and parse and insert the xml data to a table. For this purpose I am using a built-in package in oracle database 10g name dbms_xmlsave. To full fill my purpose i am going to create a procedure which is getting error. I am giving the procedure code
    CREATE OR REPLACE PROCEDURE loadxml1 AS
    fil clob;
    buffer varchar2(1000);
    len INTEGER;
    insrow INTEGER;
    BEGIN
    SELECT doc INTO fil FROM xml_clob WHERE doc_id=1;
    len := DBMS_LOB.GETLENGTH(fil);
    DBMS_OUTPUT.PUT_LINE('length '||len);
    DBMS_LOB.READ(fil,len,1,buffer);
    --xmlgen.resetOptions;
    --insrow := xmlgen.insertXML('xml_doc',buffer);
    insrow := dbms_xmlsave.insertXML('xml_doc',buffer);
    --insrow := dbms_xmlsave.insertXML('xml_doc',fil);
    DBMS_OUTPUT.PUT_LINE('length ins '||insrow);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('In Exception');
    DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
    end;
    i am getting the error with the bold line
    insrow := dbms_xmlsave.insertXML('xml_doc',buffer);
    PLS-00307: too many declarations of 'INSERTXML' match this call
    I need help on this. Here the argument xml_doc is the table name where i want to insert data from xml.
    I am giving u the code of dbms_smlsave package which is at sys user.
    CREATE OR REPLACE PACKAGE DBMS_XMLSAVE AUTHID CURRENT_USER AS
    SUBTYPE ctxType IS NUMBER; /* context type */
    DEFAULT_ROWTAG CONSTANT VARCHAR2(3) := 'ROW'; /* rowtag */
    DEFAULT_DATE_FORMAT CONSTANT VARCHAR2(21):= 'YYYY-MM-DD HH24:MI:SS';
    MATCH_CASE CONSTANT NUMBER := 0; /* match case */
    IGNORE_CASE CONSTANT NUMBER := 1; /* ignore case */
    -------------------- constructor/destructor functions ---------------------
    FUNCTION newContext(targetTable IN VARCHAR2) RETURN ctxType;
    PROCEDURE closeContext(ctxHdl IN ctxType);
    -------------------- parameters to the save (XMLtoDB) engine ----------------
    PROCEDURE setXSLT(ctxHdl IN ctxType,uri IN VARCHAR2,ref IN VARCHAR2 := null);
    PROCEDURE setXSLT(ctxHdl IN ctxType, stylesheet IN CLOB, ref IN VARCHAR2 := null);
    PROCEDURE setXSLTParam(ctxHdl IN ctxType,name IN VARCHAR2,value IN VARCHAR2);
    PROCEDURE removeXSLTParam(ctxHdl IN ctxType, name IN VARCHAR2);
    PROCEDURE setRowTag(ctxHdl IN ctxType, tag IN VARCHAR2);
    PROCEDURE setSQLToXMLNameEscaping(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    PROCEDURE setPreserveWhitespace(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    PROCEDURE setIgnoreCase(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE setDateFormat(ctxHdl IN ctxType, mask IN VARCHAR2);
    PROCEDURE setBatchSize(ctxHdl IN ctxType, batchSize IN NUMBER);
    PROCEDURE setCommitBatch(ctxHdl IN ctxType, batchSize IN NUMBER);
    -- set the columns to update. Relevant for insert and update routines..
    PROCEDURE setUpdateColumn(ctxHdl IN ctxType, colName IN VARCHAR2);
    PROCEDURE clearUpdateColumnList(ctxHdl IN ctxType);
    -- set the key column name to be used for updates and deletes.
    PROCEDURE setKeyColumn(ctxHdl IN ctxType, colName IN VARCHAR2);
    PROCEDURE clearKeyColumnList(ctxHdl IN ctxType);
    ------------------- save ----------------------------------------------------
    -- insertXML
    FUNCTION  insertXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION  insertXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    -- updateXML
    FUNCTION updateXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION updateXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    -- deleteXML
    FUNCTION deleteXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER;
    FUNCTION deleteXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER;
    ------------------- misc ----------------------------------------------------
    PROCEDURE propagateOriginalException(ctxHdl IN ctxType, flag IN BOOLEAN);
    PROCEDURE getExceptionContent(ctxHdl IN ctxType, errNo OUT NUMBER, errMsg OUT VARCHAR2);
    PROCEDURE useDBDates(ctxHdl IN ctxType, flag IN BOOLEAN := true);
    -------private method declarations------------------------------------------
    -- we must do this as a bug workaround; otherwise we get ora-600 [kgmexchi11]
    PROCEDURE p_useDBDates(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setXSLT(ctxHdl IN ctxType, uri IN VARCHAR2, ref IN VARCHAR2);
    PROCEDURE p_setXSLT(ctxHdl IN ctxType, stylesheet CLOB, ref IN VARCHAR2);
    PROCEDURE p_propagateOriginalException(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setSQLToXMLNameEsc(ctxHdl IN ctxType, flag IN NUMBER);
    PROCEDURE p_setPreserveWhitespace(ctxHdl IN ctxType, flag IN NUMBER);
    END dbms_xmlsave;
    CREATE OR REPLACE PACKAGE BODY DBMS_XMLSAVE AS
    FUNCTION insertXML(ctxHdl IN ctxType, xDoc IN VARCHAR2) RETURN NUMBER
    as LANGUAGE JAVA NAME
    'oracle.xml.sql.dml.OracleXMLStaticSave.insertXML(int, java.lang.String) return int';
    FUNCTION insertXML(ctxHdl IN ctxType, xDoc IN CLOB) RETURN NUMBER
    as LANGUAGE JAVA NAME
    'oracle.xml.sql.dml.OracleXMLStaticSave.insertXML(int, oracle.sql.CLOB) return int';
    END DBMS_XMLSAVE;
    /

    Hi,
    It's surprising (to me) that you're getting that particular error.
    It's not surprising that you're getting some error, since insertXML is expecting the first argument to be a ctxType, and you're passing a VARCHAR2 instead. Create a ctxType, and use it as the first argument. (Sorry, I'm not familiar with that package, so I can't give you any details.)

  • XML load error - when moving table data after upgrade

    Greetings:
    Background:
    Previously in our 2.2 instance, we would use the Data Load/Unload feature of APEX to move data in the form of XML from instance 1 to instance 2. This woks well because it moves images also (BLOB)
    What Changed:
    Recently we did the upgrade to APEX 3.0. The tool is working well, but we are having issues uploading XML data in the same manner we used to. The process wizard works up until time for execution.. the following error message is seen.
    XML load error.
    Return to application.
    Assumption:
    I do not believe this is an XML file issues because the file I am testing the process with is from the EMP table, and is from the UNLOAD option on the same DB and SCHEMA.. (testing is unloading the data, than re-loading the same data to the same place)
    Internally some permissions or something internal must be missing.
    Assistance or suggestions on where to look is greatly appreciated.
    Regards,
    Tim

    Tim,
    Sorry for the delay - that silly day job keeps getting in the way.
    Here is a small procedure you could use to take the XML data file format exported from Application Express and import into your table. This uses the Java-dependent DBMS_XMLSAVE package, which avoids the issue mentioned above.
    create or replace procedure load_xml(
        p_clob   in clob,
        p_schema in varchar2,
        p_table  in varchar2 )
    is
        l_insCtx dbms_xmlsave.ctxType;
        l_rows   number;
    begin
        l_insCtx := dbms_xmlsave.newContext(p_schema || '.' || p_table);
        dbms_xmlsave.setDateFormat(l_insCtx,'yyyy-MM-dd''T''HH:mm:ss.SSS');
        l_rows := dbms_xmlsave.insertXML( l_insCtx, p_clob);
        dbms_xmlsave.closeContext(l_insCtx);
    end load_xml;I then ran the following quick test on apex.oracle.com just for verification.
    declare
        l_xml varchar2(32000);
    begin
        l_xml := '<?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <ID>11645117496276327</ID>
      <FLOW_ID>30072</FLOW_ID>
      <NAME>F11645117496276327/no_image_found.gif</NAME>
      <FILENAME>no_image_found.gif</FILENAME>
      <MIME_TYPE>image/gif</MIME_TYPE>
      <CREATED_BY>JOEL</CREATED_BY>
      <CREATED_ON>2007-03-14T05:06:38.000</CREATED_ON> 
      <BLOB_CONTENT>474946383961C800...(data removed for this example)...41000003B</BLOB_CONTENT>
    </ROW>
    </ROWSET>';
        load_xml( l_xml, 'MY_DB_USER', 'MY_APEX_FILES' );
    end;It's now simply a matter of how you get your XML file(s) into a CLOB to call this procedure. The options include:
    1) Just pass in a VARCHAR2 as I did in the example above, which would limit you to roughly 32K.
    2) You could use DBMS_LOB.LOADCLOBFROMFILE to read it from the database server filesystem.
    3) You could upload the file via an APEX application (or some other means within APEX), you could convert the BLOB to a CLOB, and then call this procedure. If you need help with this method, let me know.
    Don't forget - as yet another alternative, you could always contact Oracle Support to see what could be done about that underlying database bug.
    I hope this helps.
    Joel

  • InsertXML()

    Hi!
    I'm inserting XML file into DB using OracleXMLSave - insertXML().
    I wonder if there is limit of number of columns to handle at once.
    When I pass a rowset with about 150 columns of data to insertXML(), DB(Oracle) stops and do nothing. No error messages.
    Here is a segment of my code :
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(DB_URL, DB_USERID, DB_PASSWORD);
    xs = new OracleXMLSave(conn,tableName);
    xs.setIgnoreCase(true);
    xs.setDateFormat("dd-MMM-yyyy");
    rValue = xs.insertXML(xmlDoc);
    xs.close();
    conn.commit();
    conn.close();
    The table, which data is inserted into, has about 200 columns, but generally 100 columns of them are inserted from XML doc.
    It means, in most cases, it works fine.
    But, I have to be able to deal with 150 columns or more.
    Any idea?
    null

    insertXML() wants an XML Document as an argument.
    You can give it:
    A DOM Document object (in-memory, already parsed).
    An inputstream (useful if you're getting the XML from a file or servlet request or something)
    Where you are currently "printing tags" into a printwriter to "make" your XML, you can do one of two things:
    (1) Change your code to create Elements
    instead of printing the XML tag
    representation of the Elements.
    XMLDocument newDoc = new XMLDocument();
    Element docElt = newDoc.createElement("DATASET");
    newDoc.appendChild(docElt);
    // Then for each time you would have
    // printing a <DATA>value</DATA>
    // you do instead:
    Element newDataElt = newDoc.createElement("DATA");
    newDataElt.appendChild(newDoc.createTextNode( valueVariable );
    Then you can give "newDoc" to insertXML().
    (2) You can print your document as text
    into a big string, and then
    create a ByteArrayInputStream on the
    string to pass to insertXML()
    ByteArrayInputStream bais = new ByteArrayInputStream(yourXMLString.getBytes());
    insertXML(bais);
    Number 1 should be more efficient because
    you avoid parsing.

  • XML SQL utility - Error

    Hi,
    I am trying to retrieve data from a DB table and generate an XML file. I am using Oracle8i and IIS 4.0.
    I have downloaded XML SQL utility and I followed the installation instructions. I executed oraclexmlsqlload.bat file. It got executed and then I got the following error
    ORA-12203: TNS:unable to connect to destination.
    Let me know whether I should have JDK1.1x and JDBC 1.x compliant drivers installed in my machine. can any one help me ??
    vik

    Use xmlgen.setDateFormat('yyyy-MM-dd hh:mm:ss') and try it out
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mark Hansen:
    I am having trouble with the xmlgen package within the XML SQL utility software version 1.1.1. I wrote a package that gets an XML file and loads it into a temporary CLOB and then using xmlgen.insertXML it inserts the XML into table. Everything works fine except for a date column in the table. I get an error when it tries to parse the date. Using the procedure xmlgen.setDateFormat, I tried to set the default date format, but I still get an error. Below you will find the text of the error message that I am getting:
    ORA-29532: Java call terminated by uncaught Java exception:
    oracle.xml.sql.OracleXMLSQLException: Exception
    'java.text.ParseException:Unparseable date: "2000-08-24 08:34:24"' encountered
    during processing ROW element 0All prior XML row changes were rolled back. in
    the XML document.
    ORA-06512: at "SITESTEPPER.SS_LOG", line 30
    ORA-06512: at line 1
    I've tried a number of diferent date formats including the database default date format. I have a work around to this but it involves the use of a temporary table. Please Help!
    <HR></BLOCKQUOTE>
    null

  • XML SQL Utility error - SQLException Data size bigger than max size for this type

    I am trying to insert an XML document the contains the text of new articles into the database and I am receiving this error on large documents. The process flow is as follows:
    From a servlet:
    1. Query the news server and retrieve an XML document containing the new story.
    2. Apply an XSL style sheet to the XML document to transform it into an XML document that matches the news_article table into which the story will be inserted.
    3. Call the insertXML method to store the transformed document in the table. The table contains a CLOB.
    Here is a sample of the raw XML:
    <?xml version="1.0" standalone="yes" ?>
    - <body id="s13602">
    - <![CDATA[
    Feb. 15-MAR--
    [B] BRIDGE UPDATE--LIVESTOCK: US hunger for beef must persist amid
    placements
    Feb 15--2238 GMT/1738 ET
    TOP STORIES:
    Bridge Survey: US hunger for beef must persist amid big placements
    Chicago--Feb 15--The $70.00 price level for slaughter steers has been
    considered an indication of good times in cattle country since last fall.
    More to follow...
    ^^^^^^
    ]]>
    </body>
    Here is the XSL that is applied:
    <?xml version="1.0" ?>
    - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" />
    <xsl:template match="*|/">
    <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="text()|@*">
    <xsl:value-of select="." />
    </xsl:template>
    <xsl:template match="body">
    <ROWSET>
    <ROW>
    <ID />
    <SECTION_ORDER>1</SECTION_ORDER>
    <SUBTITLE />
    <BODY_TEXT>
    <xsl:value-of select="." />
    </BODY_TEXT>
    <STORY_ID>
    <xsl:value-of select="@id" />
    </STORY_ID>
    </ROW>
    </ROWSET>
    </xsl:template>
    </xsl:stylesheet>
    The transformed XML looks like:
    ROWSET>
    <ROW>
    <ID></ID>
    <SECTION_ORDER>1</SECTION_ORDER>
    <SUBTITLE></SUBTITLE>
    <BODY_TEXT>
    Feb. 15-MAR--
    BRIDGE UPDATE--LIVESTOCK: US hunger for beef must persist amid
    placements
    Feb 15--2238 GMT/1738 ET
    TOP STORIES:
    Bridge Survey: US hunger for beef must persist amid big placements
    Chicago--Feb 15--The $70.00 price level for slaughter steers has been
    considered an indication of good times in cattle country since last fall.
    More to follow...
    ^^^^^^</BODY_TEXT>
    <STORY_ID>s13602</STORY_ID>
    </ROW>
    </ROWSET>
    The table I am trying to insert into look like:
    ID NOT NULL NUMBER(10)
    SECTION_ORDER NOT NULL NUMBER(10)
    SUBTITLE VARCHAR2(500)
    BODY_TEXT CLOB
    STORY_ID VARCHAR2(25)
    The ID column is null in the XML document and set by a before-insert trigger.
    The relevant Java code I am calling all this from looks like:
    try
    // Setup the output handler
    res.setContentType("text/xml");
    // Define the URLs for the input source and Stylesheet
    URL xmlSource = new URL (xmlUrl);
    URL xslSource = new URL (xslUrl);
    // Open connection to XML and XSL Sources via URL
    URLConnection xmlConnection = xmlSource.openConnection();
    xmlConnection.connect();
    InputStream xmlInput = xmlConnection.getInputStream();
    URLConnection xslConnection = xslSource.openConnection();
    xslConnection.connect();
    InputStream xslInput = xslConnection.getInputStream();
    // Create the parser
    DOMParser parser = new DOMParser();
    // Initial parser variables
    parser.setPreserveWhitespace(true);
    // Parse the XML file
    parser.parse(xmlInput);
    xml = parser.getDocument();
    // Create and configure the XSL Stylesheet and XSL Processor
    XSLStylesheet xsl = new XSLStylesheet(xslInput, xslSource);
    XSLProcessor processor = new XSLProcessor();
    processor.showWarnings(false);
    processor.setErrorStream(System.out);
    // Process the XML document using the stylesheet
    XMLDocumentFragment result = processor.processXSL(xsl, xml );
    // Create the output document to store results
    output = new XMLDocument();
    // Load the transformed document into the output document
    output.appendChild(result);
    Class.forName ("oracle.jdbc.driver.OracleDriver");
    //init a JDBC connection
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:oci8:@ZEUS", "emerge","emerge");
    OracleXMLSave sav = new OracleXMLSave(conn, tabName);
    int rowCount = sav.insertXML(output);
    } catch (Exception err) {
    Anyone have any ideas on what I am doing wrong. This works fine on short news articles, but not large ones.
    Thanks!
    null

    Steven,
    Thanks for you reply. I have verified that I am using the latest version of Oracle XSQL Servlet, version 0.9.8.6 as well as the OCI8 driver. In doing some additional research I found that I was using the JDBC drivers supplied with OAS 4.0.8 and not the Oracle 8.1.5 JDBC drivers. I have switched my classpath to point to the 8.1.5 drivers and I am now encountering the following error:
    ORA-21301: not initialized in object mode
    Is this something I need to do in my Servlet code, or should the XSQL Servlet handle that?
    Thanks for any help that you can provide.

  • Error Missing class: oracle.xdb.XMLType with xdb.jar in JDeveloper 10.1.3

    I am using JDeveloper 10.1.3 and get the following error when executing the web service proxy with my call to the web service( this web service is using class OracleXMLSave with method insertXML):
    I have included the xdb.jar in my project properties libraries of the web service project and added a file group with xdb.jar to the properties of the webservices.deploy. What else needs to be done? This worked in JDeveloper 10.1.2.
    THE ERROR after running proxy in log window:
    java.rmi.ServerException:
    start fault message:
    caught exception while handling request: caught exception while handling request: oracle.classloader.util.AnnotatedNoClassDefFoundError:
         Missing class: oracle.xdb.XMLType
         Dependent class: dbdata2package.DBDataOperations
         Loader: DBData2WSApp-DBData2Operations-WS.web.WebServices:0.0.0
         Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBData2WSApp-DBData2Operations-WS/WebServices/WEB-INF/classes/
         Configuration: WEB-INF/classes/ in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBData2WSApp-DBData2Operations-WS\WebServices\WEB-INF\classes
    The missing class is available from the following locations:
         1. Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBDataWSApp-webservice-WS/WebServices/WEB-INF/lib/xdb.jar (from WEB-INF/lib/ directory in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBDataWSApp-webservice-WS\WebServices\WEB-INF\lib)
         This code-source is available in loader DBDataWSApp-webservice-WS.web.WebServices:0.0.0.
         2. Code-Source: /D:/h/cots/Oracle/JDeveloper10g10.1.3/j2ee/home/applications/DBDataWSApp-DBDataOperations-WS/WebServices/WEB-INF/lib/xdb.jar (from WEB-INF/lib/ directory in D:\h\cots\Oracle\JDeveloper10g10.1.3\j2ee\home\applications\DBDataWSApp-DBDataOperations-WS\WebServices\WEB-INF\lib)
         This code-source is available in loader DBDataWSApp-DBDataOperations-WS.web.WebServices:0.0.0.
    :end fault message
         at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:545)
         at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:390)
         at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:111)
         at dbdata2packageproxy.runtime.DBData2WSSoapHttp_Stub.insertData(DBData2WSSoapHttp_Stub.java:80)
         at dbdata2package.DBData2WSSoapHttpPortClient.insertData(DBData2WSSoapHttpPortClient.java:54)
         at dbdata2package.DBData2WSSoapHttpPortClient.main(DBData2WSSoapHttpPortClient.java:34)
    Process exited with exit code 0.

    Hi,
    actually you increment the index
    pstmt.setString(++idx,inrecord.getCommentID());
    which means you never have an index of 0 but always start with 1
    Frank

  • Getting error while inserting xmldoc to a table

    I am getting following error .
    ERROR at line 2:
    ORA-06550: line 2, column 6:
    PLS-00103: Encountered the symbol "INSERTXML" when expecting one of the
    following:
    := . ( @ % ;
    The symbol ":=" was substituted for "INSERTXML" to continue.
    Here is my code below.
    CREATE TABLE empleados (empid NUMBER PRIMARY KEY,
    empname VARCHAR2(30),
    empjob VARCHAR2(30),
    empsal NUMBER);
    create or replace procedure InsertXML(xmlDoc IN VARCHAR2, tableName IN VARCHAR2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    begin
    insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    dbms_output.put_line(to_char(rows) || ' rows inserted');
    DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    end;
    begin
    exec InsertXML('<?xml version="1.0"?><ROWSET><ROW num="1"><EMPID>10</EMPID><EMPNAME>Perry Smith
    </EMPNAME><EMPJOB>Manager</EMPJOB><EMPSAL>800</EMPSAL></ROW><ROW num="1"><EMPID>20</EMPID><EMPNAME>J
    ohn Calvach</EMPNAME><EMPJOB>Principal Support Consultant</EMPJOB><EMPSAL>900</EMPSAL></ROW><ROW num
    ="1"><EMPID>30</EMPID><EMPNAME>Louis Bald</EMPNAME><EMPJOB>Technical Specialist</EMPJOB><EMPSAL>400<
    /EMPSAL></ROW><ROW num="1"><EMPID>40</EMPID><EMPNAME>Anthony Flowers</EMPNAME><EMPJOB>Technical Team
    Leader</EMPJOB><EMPSAL>500</EMPSAL></ROW><ROW num="1"><EMPID>50</EMPID><EMPNAME>George Monk</EMPNAM
    E><EMPJOB>Support Consultant</EMPJOB><EMPSAL>200</EMPSAL></ROW></ROWSET>','empleados');
    end;

    I changed the name.But still I get that error.
    Thanks

  • Error while inserting attachements data into  FND_LOBS

    Hi,
    I m trying to insert data into fnd_lobs using below, I didn't declare any variables for below.
    I m getting many compilation erros for below insert, Could you let me know if i have to declare any of below values.
    INSERT INTO fnd_lobs
               (file_id, file_name, file_content_type, upload_date,expiration_date, program_name, program_tag, file_data,LANGUAGE, oracle_charset, file_format)
        VALUES (l_media_id, l_filename,p_file_content_type,SYSDATE,NULL, 'FNDATTCH', NULL, EMPTY_BLOB (),'US', 'UTF8', 'binary')
               RETURNING file_data
               INTO x_blob;
    -- Load the file into the database as a BLOB
        DBMS_LOB.OPEN (fils, DBMS_LOB.lob_readonly);
        DBMS_LOB.OPEN (x_blob, DBMS_LOB.lob_readwrite);
        DBMS_LOB.loadfromfile (x_blob, fils, blob_length);   -- Close handles to blob and file
        DBMS_LOB.CLOSE (x_blob);
        DBMS_LOB.CLOSE (fils);
    Thanks.

    Could you explain what your procedure does, please. I also tried to compile it but always got error message:
    PL/SQL: SQL Statement ignored
    PLS-00385: type mismatch found at 'FIL' in SELECT...INTO
    statement
    SQL> CREATE OR REPLACE PROCEDURE loadxml12 AS
    2 fil BFILE;
    3 buffer RAW(32767);
    4 len INTEGER;
    5 insrow INTEGER;
    6 BEGIN
    7 SELECT f_lob INTO fil FROM xml_temp12 WHERE key = 1;
    8 DBMS_LOB.FILEOPEN(fil,DBMS_LOB.FILE_READONLY);
    9 len := DBMS_LOB.GETLENGTH(fil);
    10 DBMS_LOB.READ(fil,len,1,buffer);
    11 xmlgen.resetOptions;
    12 insrow := xmlgen.insertXML('xml_doc',UTL_RAW.CAST_TO_VARCHAR2(buffer));
    13 DBMS_OUTPUT.PUT_LINE(insrow);
    14 IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    15 DBMS_LOB.FILECLOSE(fil);
    16 END IF;
    17 EXCEPTION
    18 WHEN OTHERS THEN
    19 DBMS_OUTPUT.PUT_LINE('In Exception');
    20 DBMS_OUTPUT.PUT_LINE(SQLERRM(SQLCODE));
    21 IF DBMS_LOB.FILEISOPEN(fil) = 1 THEN
    22 DBMS_LOB.FILECLOSE(fil);
    23 END IF;
    24 end;
    25 /
    Bober
    null

Maybe you are looking for

  • Opening a .pdf file from Excell 2011 hyperlink

    I have a problem opening a .pdf file hyperlinked in Excel 2011 file. The message is: "No program is registered to open this file". If I go from explorer the file is regularly opened with Adobe Reader.

  • Popup Dialog taskflow

    hi all, I want to go one page to another page using popup dialog. i try some thing like in the following link http://blogs.oracle.com/DavidGiammona/. but popup dialog come up with "The website cannot display the page" and i found the following javasc

  • CS3 Linking Error

    In CS3, when I open a previously save .ai file I receive an error which states, "An error occurred trying to read the linked file [insert file name].  Choose Repair to locate the missing file, Replace to select another file, or Ignore to leave the li

  • OMJJ - add new account grouping for transaction type

    Hi How can I add anew combination of movement type and special stock indicator, that don't exist in our system. How can I add a line to OMJJ account grouping table? Is it dependant on something else? Thanks Liat

  • Using X,Y coordinates from file to draw in Illustrator

    Hello, I am doing some clothes pattern making and I am interested in using a list of X,Y coordinates to create and label a set of points on the artboard.  I then wish to adjust for size changing only my XY list and get a changed shape?  Right now I h