About ora:parseEscapedXML(String contentString)

Where can I find more documentation on each specific expression? Web service returns a String (which is a XML document). We are trying to consume it in BPEL as XML document. I couldn't get this parsing function work though. Can anyone give a pointer or two?
Thanks,
Wen

Hi Wen,
Look at the XPathFunction sample to see an example of the usage at "OracleAS\bpel\samples\references\XPathFunction".
We have also successfuly used this funktion to convert the result of a webservice (string containing the xml-structure) into a xml document.
BPEL code snippet
<assign name="expandResult">
<copy>
<from expression="ora:parseEscapedXML(bpws:getVariableData('invokeWizardOutput','closeWoResponse','/ns5:closeWoResponse/ns5:fi_datum'))"/>
<to variable="wizardOutputExpanded" query="/ns5:closeWoResponse_Expanded/ns5:If"/>
</copy>
</assign>
If i look at the flow in the bpel-consol my result looks like this:
BEFORE:
<invokeWizardOutput>
<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="closeWoResponse">
<types:closeWoResponse xmlns:types="http://schema.kabeldeutschland.de/interface/ProvisioningInterface/WizardAPITypes">
<types:tpRetCode>0</types:tpRetCode>
<types:tpErrno>0</types:tpErrno>
<types:tpErrDetails/>
<types:fi_datum><?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?><If version="5.02.10.00_6051"><closeWoOut><meldungen><meldung><code>0</code><text>OK</text></meldung></meldungen></closeWoOut></If></types:fi_datum>
</types:closeWoResponse>
</part>
</invokeWizardOutput>
AFTER:
<wizardOutputExpanded>
<closeWoResponse_Expanded xmlns="http://schema.kabeldeutschland.de/interface/ProvisioningInterface/WizardAPITypes">
<If version="5.02.10.00_6051">
<closeWoOut xmlns="">
<meldungen>
<meldung>
<code>0</code>
<text>OK</text>
</meldung>
</meldungen>
</closeWoOut>
</If>
</closeWoResponse_Expanded>
</wizardOutputExpanded>

Similar Messages

  • How to use ora:parseEscapedXML() Function with String Content

    Hello,
    I am receiving a ResponseMessage that returns a string, but the content of the string is actually XML. I have tried to use the ora:parseEscapedXML() function to parses the string (see XML Fragment below) to return structured XML data that can be assigned to typed BPEL variables. The documentation is very limited for this (I've looked in the Developer Guide draft that is available at the OraBPEL site).
    2 customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    The copy rule for assigning CustNum to accountnumber that fails:
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('DataService_OutputVariable','invokeSpecMsgReturn','/recordset/customer/CustNum'))"/>
    <to variable="outputVariable" part="payload" query="/client:QueryResult/client:customer/client:accountNumber"/>
    </copy>
    Any help would be greatly appreciated.
    Thanks,
    Sean

    Hello,
    I am attempting to provide more information in order to hopefully get some better guidance here.
    1) The BPEL process I built receives input from a client that is one of city name or region name or postal code or country name and returns a list of customer records with their AccountNumber, LastName, FirstName, Email, Address, City, Region, PostalCode and Country. The BPEL flow invokes a packaged integration Web Service that retuns the records in a string whose content is XML (see XML fragment below).
    2) The string content returned is vaiable based on the input (i.e. city name="London")
    Two customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    I want to <assign> each record from the packaged integration service result (the string whose content is XML) to a complexType variable defined within the BPEL Process WSDL (see example below).
    XML fragment from BPEL WSDL:
    <element name="QueryResult" type="client:recordType"/>>
    <complexType name="recordType">
    <sequence>
    <element name="customer" type="client:customerType" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="customerType">
    <sequence>
    <element name="accountNumber" type="string"/>
    <element name="lastName" type="string"/>      
    <element name="firstName" type="string"/>
    <element name="email" type="string"/>
    <element name="address" type="string"/>
    <element name="city" type="string"/>
    <element name="region" type="string"/>
    <element name="postalcode" type="string"/>
    <element name="country" type="string"/>
    </sequence>                         
    </complexType>
    I have read through the tutorial and reviwed the XPath Funtion example in the reference (C:\OraBPELPM_1\integration\bpelpm\orabpel\samples\references\XPathFunction), but I am stsill very unclear as to how to handle this. I would appreciate any and all help.
    Thanks,
    Sean

  • How to put variable value inside ora:parseEscapedXML ?

    Hi,
    I am in a situation like I have a variable like temp that has value "runtime value". Now I want to put this temp variable like
    ora:parseEscapedXML('<data><xd:name="a"> <xd:value>temp</dsml:value></xd:name> </data>')
    But it shows temp as a String not its runtime value. I have also used bpws:getVariableData(temp) or bpws:getVariableData("temp") or bpws:getVariableData('temp') but useless .
    Any help ?
    Thanks

    I have pasted my XML into the Expression but its unable to pick the value of variable. When I used/paste the same xml in a XML Fragment its giving me error about literal invalid.
    What should I do now ?
    Thanks

  • Problem with ora:parseEscapedXML

    I have XML as string that contains & q u o t; (without space :( ).
    Now I have to convert it to XML, I tried using ora:parseEscapedXML.
    I have to process lot of XMLs that contains these encoded values, I tried adding escape character still it is not working.
    It is throwing type error, which is not caught in Catch block and CatchAll block.
    Atleast I need to Catch this exception.Can anybody suggest??
    It seems like it is bug in ora:parseEscapedXML.
    has anybody tried this
    thanks and regards
    V Kumar
    Message was edited by:
    user640551
    Message was edited by:
    user640551
    Message was edited by:
    user640551

    Replace the "&" with "& amp;amp;" (no space in real situation as the browser will replace it back
    to "&").You can use a Java exec in the BPEL code to implement this workaround.
    java.lang.String temp = (String) getVariableData("dummy");
    System.out.println("String before manipulation: " + temp);
    temp = temp.replaceAll("&", "& a m p; a m p"); <-- Intentionally spaces
    System.out.println("String after manipulation: " + temp);
    setVariableData("dummy", temp);

  • Help Needed: Issue in ora:parseEscapedXML function in BPEL

    Hello All-
    We are facing issue while using the XSLT Function ora:parseEscapedXML in SOA 11g. Following is our scenario:
    1.     We are using DB Adapter to poll for records in the database. One of the fields in the polled records is a CLOB type which contains a XML message.
    2.     Our requirement is to get the XML Message as a String in the BPEL Process, parse it to XML and then assign to Complex Type XML Element.
    3.     We are using ora:parseEscapedXML function to achieve the same. However we are getting error "Empty Variable/Expression result. The XPATH variable or expression is empty"
    If anybody has faced similar issues, kindly provide us the resolution/pointers on how to resolve it.
    Thanks in advance. Please let me know if you need any additional information from my side.
    Regards,
    Dibya

    Reading Xml file from clob column in the staging table
    CLOB has to be treated as string in xsd/xml in BPEL. Hope you have read the following document http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#CHDIEBJD. Still valid for 11g.

  • Pass XML inside ora:parseEscapedXML

    How to pass XML inside ora:parseEscapedXML ?? Like
    ora:parseEscapedXML(' <PersonalDetails><FirstName></FirstName><PreferredName></PreferredName><Nationality></Nationality></PersonalDetails>')
    It works fine. But problem is how to get variable values inside <FirstName></FirstName> ? Like <FirstName> some variable </FirstName>.
    Thanks

    Hi ,
    assign the xml content to the string variable like ex:ErrorData then call the ora:parseEscapedXML function like ora:parseEscapedXML(bpws:getVariableData('ErrorData')) to another string variable.
    ex with out parseEscapedXML ..the xml looks like this
    <ErrorDataStr>
    <ErrorDataStr xsi:type="ns:string">*<parameters xmlns:ns1="http://www.testing.com/ErrorReport" xmlns="http://www.testing.com/ErrorReport">*<ns1:item><ns1:ProcessInfo>n</ns1:ProcessInfo><ns1:BusinessProcessName>a</ns1:BusinessProcessName><ns1:BusinessProcessInstanceId>a</ns1:BusinessProcessInstanceId><ns1:BusinessProcessStep>a</ns1:BusinessProcessStep><ns1:ImplementationCode>ss</ns1:ImplementationCode><ns1:StatusCode>s</ns1:StatusCode><ns1:ErrorCode>s</ns1:ErrorCode><ns1:ErrorDescription>s</ns1:ErrorDescription><ns1:ErrorType>s</ns1:ErrorType><ns1:ErrorDateTime>3-oct-2011</ns1:ErrorDateTime></ns1:item></parameters></ErrorDataStr>
    </ErrorDataStr>
    using parseEscapedXML --xml file looks like this
    <ErrorDataStr>
    <ErrorDataStr>
    <ns1:item>
    <ns1:ProcessInfo>n</ns1:ProcessInfo>
    <ns1:BusinessProcessName>a</ns1:BusinessProcessName>
    <ns1:BusinessProcessInstanceId>a</ns1:BusinessProcessInstanceId>
    <ns1:BusinessProcessStep>a</ns1:BusinessProcessStep>
    <ns1:ImplementationCode>ss</ns1:ImplementationCode>
    <ns1:StatusCode>s</ns1:StatusCode>
    <ns1:ErrorCode>s</ns1:ErrorCode>
    <ns1:ErrorDescription>s</ns1:ErrorDescription>
    <ns1:ErrorType>s</ns1:ErrorType>
    <ns1:ErrorDateTime>3-oct-2011</ns1:ErrorDateTime>
    </ns1:item>
    </ErrorDataStr>
    </ErrorDataStr>

  • Ora:parseEscapedXML

    Hi,
    I have a input string that has the 4 values passed from a CLOB PO_NUMBER (xsd:string) 173510 , PO_LINE_NUMBER(xsd:integer) 1 , PO_SHIPMENT_NUMBER (xsd:integer) 1 , QTY_CANCELLED (xsd:integer) 2000 to a BPEL Process
    When I try to receive this value using ora:parseEscapedXML from this string I cannot receive into a variable of complex type . However when I retrieve it into a String (say) PO Number I get 173510112000 (All Concatenated )
    How do I receive this into a XML Type ?
    Any inputs are appreciated
    Thanks

    Try something link this.. This is the .bpel file
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Thu Feb 05 16:04:06 PST 2009
    Author: venkatrr
    Purpose: Asynchronous BPEL Process
    -->
    <process name="BPELProcess_parseEscapedXML"
    targetNamespace="http://xmlns.oracle.com/BPELProcess_parseEscapedXML"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess_parseEscapedXML"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.kemet.com/KEMET_EVENT_PO_CANCEL_SHIPMENT"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client"
    partnerLinkType="client:BPELProcess_parseEscapedXML"
    myRole="BPELProcess_parseEscapedXMLProvider"
    partnerRole="BPELProcess_parseEscapedXMLRequester"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable"
    messageType="client:BPELProcess_parseEscapedXMLRequestMessage"/>
    <!-- Reference to the message that will be sent back to the requester during callback -->
    <variable name="outputVariable"
    messageType="client:BPELProcess_parseEscapedXMLResponseMessage"/>
    <variable name="inputString" type="xsd:string"/>
    <variable name="stringToXML" element="ns1:KEMET_PO_CAN_SHIP_EVENT"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess_parseEscapedXML.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:BPELProcess_parseEscapedXML"
    operation="initiate" variable="inputVariable"
    createInstance="yes"/>
    <!--
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    <assign name="Assign_1">
    <copy>
    <from expression="ora:getContentAsString(bpws:getVariableData('inputVariable','payload','/ns1:KEMET_PO_CAN_SHIP_EVENT'))"/>
    <to variable="inputString"/>
    </copy>
    <copy>
    <from expression="ora:translateFromNative(bpws:getVariableData('inputString'),'untitled1.xsd','KEMET_PO_CAN_SHIP_EVENT')"/>
    <to variable="stringToXML"
    query="/ns1:KEMET_PO_CAN_SHIP_EVENT"/>
    </copy>
    <copy>
    <from variable="stringToXML"
    query="/ns1:KEMET_PO_CAN_SHIP_EVENT/ns1:PO_NUMBER"/>
    <to variable="outputVariable" part="payload"
    query="/client:BPELProcess_parseEscapedXMLProcessResponse/client:result"/>
    </copy>
    </assign>
    <invoke name="callbackClient" partnerLink="client"
    portType="client:BPELProcess_parseEscapedXMLCallback"
    operation="onResult" inputVariable="outputVariable"/>
    </sequence>
    </process>
    -Ramana.

  • Using clobs and ORA-01704: string literal too long

    Hi,
    I am attempting to add oracle support to an existing J2ee application. The issue I am facing is the use of CLOB datatypes and the 4k string literal limitation that Oracle has.
    I have dowloaded the 10.2.0.3 thin driver and am connected to a 9i release 2 database. When I execute a statement such as the following (say the table has one varchar2 field and two clob fields
    Insert into my_table VALUES ('hi','something','pretend this string is 5000 characters')
    I still receive the error
    java.sql.SQLException: ORA-01704: string literal too long
    I have read that the version 10 drivers were supposed to address this limitation. Is there something I am missing or must I change my home grown database layer to use bind variables or clob manipulation in a separate update/insert statement.? I am trying to avoid this situation since the database layer works fine for the situation of MSSQL and text fields which have no such limitation.
    Any advice you have here is greatly appreciated.
    Thanks,
    Joe

    Hi,
    I am attempting to add oracle support to an existing J2ee application. The issue I am facing is the use of CLOB datatypes and the 4k string literal limitation that Oracle has.
    I have dowloaded the 10.2.0.3 thin driver and am connected to a 9i release 2 database. When I execute a statement such as the following (say the table has one varchar2 field and two clob fields
    Insert into my_table VALUES ('hi','something','pretend this string is 5000 characters')
    I still receive the error
    java.sql.SQLException: ORA-01704: string literal too long
    I have read that the version 10 drivers were supposed to address this limitation. Is there something I am missing or must I change my home grown database layer to use bind variables or clob manipulation in a separate update/insert statement.? I am trying to avoid this situation since the database layer works fine for the situation of MSSQL and text fields which have no such limitation.
    Any advice you have here is greatly appreciated.
    Thanks,
    Joe

  • PL-SQL-ORA-01704 - String literal too long

    Hello guyz;
    I am trying to store a value of over 4000 character long in a CLOB column and I got the error message that says "PL-SQL-ORA-01704 - String literal too long".
    What can I do to overcome this challenge?
    Thanking you for your usual support.

    sb92075 wrote:
    Problem Exists Between Keyboard And Chair
    We can't say what you are doing wrong since we don't know specifically what you actually do.Okay let me put it down this way.
    I have an application using SQL Server as d backend engine & now, the user wants to migrate to Oracle. I now wrote a mini-program to create a schema/user in oracle with the schema/database (being used by the app) from SQL server. I verified the structure very well & every is just fine. Now, data migration (from SQL Server to Oracle).
    I was able to move most tables data successfully without issue until I attempted to load a table which has a column (in SQL defined as text with over 4000 (var)chars/CLOB in Oracle). On moving a particular row to oracle db (after few rows have already been INSERTed into this particular table x), I got that err msg.
    After battling with that for a while, I concluded to make d (DataMigrator) app take just d first 4000 string - only if the value in that field value length > 4000. This worked perfectly without issue but you know the implication - Data lost.
    Do I need to switch something on/off in Oracle that expands the CLOB default maximum field size? Because I foresee this happening as soon as the application (that would now sit on Oracle) is now in use.
    If you still don't understand this, I don't know how beta 2 explain this!
    Edited by: aweklin on Mar 17, 2013 8:25 AM
    Edited by: aweklin on Mar 17, 2013 8:25 AM
    Edited by: aweklin on Mar 17, 2013 8:27 AM
    Edited by: aweklin on Mar 17, 2013 8:27 AM

  • "ORA-01704: string literal too long" in Oracle 10g

    I would like to explain my problem with an example, let's create the following table:
    CREATE TABLE longtest
    (text LONG);
    I have to insert lots of data into this table and when I run this command:
    INSERT INTO LONGTEST VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ..................more than 4000 characters..................
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
    I get the following error:
    ORA-01704: string literal too long
    To workaround this, I used bind variables, like this:
    BEGIN
    EXECUTE IMMEDIATE 'INSERT INTO LONGTEST VALUES (:a) '
    using
    'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ..............(repeat more than 32768 characters)..............
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
    COMMIT;
    END;
    This worked fine with Oracle 9.2.0.4 but when I do the same thing
    in Oracle 10.2.0.2 there is a 32768 characters limit.
    I am planning to upgrade the database but I need a workaround for
    this, anyone knows why Oracle behaves differently in 10g??

    So, I wonder if anyone can explain why the following code works fine in Oracle 9.2.0.4 but not in Oracle 10.2.0.2:
    CREATE TABLE longtest
    (text LONG);
    BEGIN
    EXECUTE IMMEDIATE 'INSERT INTO LONGTEST VALUES (:a) '
    using
    'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ..............(repeat more than 32768 characters)..............
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
    COMMIT;
    END;
    Regards,
    Cassiano

  • ORA-01704: string literal too long (URGENT)

    Folks,
    I get error - ORA-01704: string literal too long,
    when trying to insert a value >4k into the SDIDOC column of the table below:
    CREATE TABLE "B1"."SDI_XML_TAB"
    ( "SDIID" VARCHAR2(60 BYTE) NOT NULL ENABLE,
    "SDIDOC" "SYS"."XMLTYPE" ,
    CONSTRAINT "SDI_XML_TAB_PK" PRIMARY KEY ("SDIID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "B1SYSTEM" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "B1SYSTEM"
    XMLTYPE COLUMN "SDIDOC" STORE AS CLOB (
    TABLESPACE "B1SYSTEM" ENABLE STORAGE IN ROW CHUNK 16384 PCTVERSION 10
    NOCACHE LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) ;
    The SQL I used using OCI was:
    "INSERT INTO SDI_XML_TAB(SDIID,SDIDOC) VALUES('ABC','clobVal')"
    What am I doing wrong?
    P.S. I also used the following and it gives the same error:
    "INSERT INTO SDI_XML_TAB(SDIID,SDIDOC) VALUES('ABC',XMLType('clobVal'))"
    Thanks,
    Arthur
    Message was edited by:
    ArthurJohnson

    Check this cool-bi.com

  • Limitation for CLOB columns? - ORA-01704: string literal too long

    Hello!
    I'm trying to update a CLOB column with more than 35000 characteres, but I get "ORA-01704: string literal too long".
    The code:
    declare
    l_clob clob;
    begin
    update test set test = empty_clob()
    WHERE ID = 1
    returning test into l_clob;
    dbms_lob.write( l_clob, length('A...here 35000xA...A'), 1,'A...here 35000xA...A');
    end;
    Is there any limitation for CLOB columns?
    Thanks for help.
    Daniel

    user605489 wrote:
    32768 characteres :)Actually it's 1 character less than 32K...
    *32767*
    SQL> declare
      2    v_vc varchar2(32768);
      3  begin
      4    null;
      5  end;
      6  /
      v_vc varchar2(32768);
    ERROR at line 2:
    ORA-06550: line 2, column 17:
    PLS-00215: String length constraints must be in range (1 .. 32767)
    SQL>I guess it comes from a legacy thing where signed words (2 bytes) are/were used to represent a value. As the most significant bit of the word is used to represent the sign of the number the range goes from -32768 to 32767.

  • SQL Error: ORA-01704: string literal too long

    select * from table(fn_split('some 10000 characters with comma separation .........................'))
    Error report:
    SQL Error: ORA-01704: string literal too long
    01704. 00000 - "string literal too long"
    *Cause:    The string literal is longer than 4000 characters.
    *Action:   Use a string literal of at most 4000 characters.
    how to pass my 10k record string

    933663 wrote:
    The string is through a user interface.So, that interface is using what datatype for the string? What language is the interface written in?
    insert into table
    select * from table(fn_split('2,4,2,5,7'));Do you understand what a string literal is? You cannot provide a varchar2 string that exceeds 4000 bytes from within SQL. Fact. It just cannot be done.
    If you are passing the string from a user interface using a datatype that supports more than 4000 bytes, and you pass it directly to PL/SQL code by calling the function or procedure directly (not using SQL) then you can use up to 32767 bytes for your VARCHAR2.
    The code you've posted (which happens to be some of my own code posted years ago on these forums) takes a VARCHAR2 as an input. You would have to change that to accept a CLOB datatype and work on the CLOB instead. However, you still wouldn't be able to pass in a string literal of more than 4000 bytes from SQL for it.
    Looking at your other thread: Seperate the string value
    ... it looks like the 'user' is trying to pass in a table definition. What is it your application is trying to do? Surely you are not trying to create a table at run time?
    So explain, what is the business issue you are trying to solve? We may be able to provide a better way of doing it.

  • ORA-01704: string literal too long for CLOB colum

    Hi,
    I'm trying to execute sql script containing a lot of insert into statements.
    Insert into table (clob_column) values ("value of 5500 characters");
    I get the below error message. Please let me know how do resolve this issue without PL/SQL ?
    ORA-01704: string literal too long

    Hi,
    LOB columns store locators that reference the location of the actual LOB value. Depending on the column properties you specify when you create the table, and depending the size of the LOB, actual LOB values are stored either in the table row (inline) or outside of the table row (out-of-line).
    LOB values are stored out-of-line when any of the following situations apply:
    •If you explicitly specify DISABLE STORAGE IN ROW for the LOB storage clause when you create the table.
    •If the size of the LOB is greater than approximately 4000 bytes (4000 minus system control information), regardless of the LOB storage properties for the column.
    •If you update a LOB that is stored out-of-line and the resulting LOB is less than approximately 4000 bytes, it is still stored out-of-line.
    LOB values are stored inline when any of the following conditions apply:
    •When the size of the LOB stored in the given row is small, approximately 4000 bytes or less, and you either explicitly specify ENABLE STORAGE IN ROW or the LOB storage clause when you create the table, or when you do not specify this parameter (which is the default).
    •When the LOB value is NULL (regardless of the LOB storage properties for the column).
    Read this for more details..
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm

  • [ORA-01704: string literal too long] in a long xquery

    I get an error when using queries with xmlquery.
    If the quoted string part is longest than 4000 chr then I get
    ORA-01704: string literal too long.
    Example...
    select xmlquery(
    ' <Root >
         {for $xxx in ora:view("ttttttt")
            let $nnn := $xxx/ROW/nnn/number()
    [total chr>4000] '
    RETURNING CONTENT)
    from dual
    Is it really not possible to write Oracle xmlqueries longest than 4000chr or there's a workaround for it?

    I got similary problem using the OCCI to insert record in my table.
    I have a BLOB field in my table and whenever I quote an HEX string that is bigger than 4000 chars I get the error: ORA-01704: string literal too long
    To sort that problem I have to pass to the prepared SQL statement, but now I got a new problem for which I do not have solution.
    I write here the piece of C++ code to insert and the error I get hoping somebody can help me.
    I have problem to write into a Blob object.
    I get the error: ORA-22275: Invalid LOB Locator Specified.
    The error occurs when I try to write into the blob variable:
    blobField.writeChunk(....
    Routine:
    void insert2 (void) throw (SQLException)
    cout << "=== Prepare Statement ===" << endl;
    Statement* stmtIns = occiConn->createStatement("insert into test_tab values (:1,:2,:3,:4,:5)");
    cout << "=== Prepare the Blob data ===" << endl;
    // Prepare all Blobs in an array of char.
    char* data[5];
    ub2 dataLen[5];
    int i;
    for (i = 0; i < 5; i++)
    data[i] = new char[16364];
    memset(data, 65+i, 16364);
    dataLen[i] = 16364;
    cout << "=== Assign the other fields ===" << endl;
    stmtIns->setInt(1, i + 10);
    stmtIns->setInt(2, i + 1000);
    stmtIns->setInt(3, i + 10000);
    stmtIns->setInt(4, i + 20);
    // Assign the blob field
    Blob blobField(occiConn);
    blobField.setEmpty();
    cout << "=== Opening the blob field in read/write mode ===" << endl;
    blobField.open(OCCI_LOB_READWRITE);
    cout << "=== Writing data into the blob ===" << endl;
    blobField.writeChunk(dataLen[0], reinterpret_cast<unsigned char*>(data[0]), dataLen[0], 1);
    blobField.close();
    cout << "=== Done ===" << endl;
    stmtIns->setBlob(5, blobField);
    cout << "=== Execute the iteration ===" << endl;
    stmtIns->executeUpdate();
    for (i = 0; i < 5; i++)
    delete [] data[i];
    stmtIns->executeUpdate("COMMIT");
    occiConn->terminateStatement(stmtIns);

Maybe you are looking for