How to process a large XML string passed to a LONG variable?

I am attempting to extract and loop through some XML that is stored in a variable (v_xml_string) that is defined as LONG data type. However, I am receiving an ORA-01460: unimplemented or unreasonable conversion requested when the string value exceeds 20 records in the XML layout below. When I performed a LENGHTB on a sample XML string containing 19 records (just below the threshold of erroring), I get 3895, which I'm assuming is in BYTES...this is not near the 32,760 byte limit of PL/SQL variables defined as LONG. I suppose my other alternative is that I use CLOB datatype instead of LONG.
XML layout:
<?xml version="1.0"?>
<DocumentElement>
  <tblElections>
    <EmpID>872G4</EmpID>
    <MgrNTID>JohnDoe</MgrNTID>
    <Entity>050595</Entity>
    <AddlAmt>1000</AddlAmt>
    <CheckedForSave>Y</CheckedForSave>   
  </tblElections>
</DocumentElement>sample of code where error appers to be occurring:
DECLARE
  v_xml_string LONG;
BEGIN
    FOR v_xml_rec IN (SELECT t.COLUMN_VALUE.extract('/tblElections/EmpID/text()') .getStringVal() EmpID,
                             t.COLUMN_VALUE.extract('/tblElections/MgrNTID/text()') .getStringVal() MgrNTID,
                             t.COLUMN_VALUE.extract('/tblElections/FAEntity/text()') .getStringVal() FAEntity,
                             t.COLUMN_VALUE.extract('/tblElections/AddlSLEAAmt/text()') .getStringVal() AddlSLEAAmt,
                             t.COLUMN_VALUE.extract('/tblElections/CheckedForSave/text()') .getStringVal() CheckedForSave
                        FROM TABLE(xmlsequence(XMLTYPE(v_xml_string) .extract('/DocumentElement/tblElections'))) t)
    LOOP
... <do some stuff here>
   END LOOP;
END;

Strings in SQL are limited to 4000 in length, the long variable will work up to 32K as long as it is not used in SQL, if it goes over 4000 you will get the error.
SQL> declare
  2    l long;
  3  begin
  4    l := rpad('x',32000,'x');
  5    dbms_output.put_line('length is : ' || to_char(length(l)));
  6  end;
  7  /
length is : 32000
PL/SQL procedure successfully completed.
SQL> edi
Wrote file afiedt.sql
  1  declare
  2    l long;
  3    n number;
  4  begin
  5    l := rpad('x',32000,'x');
  6    select length(l) into n from dual;
  7    dbms_output.put_line('length is : ' || to_char(n));
  8* end;
SQL> /
declare
ERROR at line 1:
ORA-01460: unimplemented or unreasonable conversion requested
ORA-06512: at line 6
SQL> edi
Wrote file afiedt.sql
  1  declare
  2    l long;
  3    n number;
  4  begin
  5    l := rpad('x',4000,'x');
  6    select length(l) into n from dual;
  7    dbms_output.put_line('length is : ' || to_char(n));
  8* end;
SQL> /
length is : 4000
PL/SQL procedure successfully completed.
SQL> edi
Wrote file afiedt.sql
  1  declare
  2    l long;
  3    n number;
  4  begin
  5    l := rpad('x',4001,'x');
  6    select length(l) into n from dual;
  7    dbms_output.put_line('length is : ' || to_char(n));
  8* end;
SQL> /
declare
ERROR at line 1:
ORA-01460: unimplemented or unreasonable conversion requested
ORA-06512: at line 6
SQL>

Similar Messages

  • Xml string passed as parameter to xsql

    I am trying to pass xml string as parameter to xsql.But having problems with the < and > .I tried to escape
    those chars but but i am not getting desired output.Could you please suggest how to pass the xml string .
    <xsql:include-xsql href="order.xsql?neworder='{@neworder}'
    i trying to pass neworder parameter as xml string which contains data to update 2-3 table .

    u can't post a parameter valued by a xml string,because of the xml string must be
    has xml element with attributes. as follows:
    <row num="1">
    the "=" will make the web container got error
    when parsing http request parameters's name and value pair.
    solution:
    1. use "post" method submit your parameter
    2. use microsoft xml http compoment post your param as a parameter
    of it's "send" method, and set the request contentType header "text/xml"
    in xsql file:
    <xsql:set-page-param name="param1" xpath="/parameters/neworder"/>
    try it :->

  • How to get the request xml string in Business service.

    Hi
    I have following requirement
    1) XAI inbound service will get a input xml request feed and call the Business Service.
    2) Business service will do some validation and do the insert in the database.
    My BS schema is as below
    <schema pageAction="change">
    <personId mapField="PER_ID"/>
    <personOrBusiness mapField="PER_OR_BUS_FLG"/>
    <name mapField="ENTITY_NAME" mdField="C1_ENTITY_NAME"/>
    <emailAddress mapField="EMAILID"/>
    <city mapField="CITY"/>
    <county mapField="COUNTY"/>
    <postal mapField="POSTAL"/>
    <houseType mapField="HOUSE_TYPE"/>
    <taxVendorGeographicalCode mapField="GEO_CODE"/>
    <isInCityLimit mapField="IN_CITY_LIMIT"/>
    <state mapField="STATE"/>
    <version mapField="VERSION"/>
    <division mapField="CIS_DIVISION"/>
    <accessGroup mapField="ACCESS_GRP_CD"/>
    <address1 mapField="ADDRESS1"/>
    <personCharacteristic type="list" mapList="CI_PER_CHAR">
    <personId mapField="PER_ID"/>
    <characteristicType mapField="CHAR_TYPE_CD"/>
    <characteristicValue mapField="CHAR_VAL"/>
    <effectiveDate mapField="EFFDT"/>
    <adhocCharacteristicValue mapField="ADHOC_CHAR_VAL"/>
    <characteristicValueForeignKey1 mapField="CHAR_VAL_FK1"/>
    <characteristicValueFK2 mapField="CHAR_VAL_FK2"/>
    <characteristicValueFK3 mapField="CHAR_VAL_FK3"/>
    <characteristicValueFk4 mapField="CHAR_VAL_FK4"/>
    <characteristicValueFK5 mapField="CHAR_VAL_FK5"/>
    </personCharacteristic>
    </schema>
    The request XML to BS is as below_
    (support.schema.AbstractSchemaBasedDispatcher) Performing page:change of BusinessService CM_SPRDSHT_BS' (service='CMSPRDHSHTUPLD'), with input request
    <?xml version="1.0" encoding="UTF-8"?>
    <CM_Person>
    <personOrBusiness>P</personOrBusiness>
    <name>Marsh,Corporate</name>
    <emailAddress>[email protected]</emailAddress>
    <city>Tampa</city>
    <country>USA</country>
    <postal>2131</postal>
    <houseType/>
    <taxVendorGeographicalCode/>
    <isInCityLimit/>
    <state>CA</state>
    <version>1</version>
    <division>930</division>
    <accessGroup>***</accessGroup>
    <address1>Address of Khan</address1>
    </CM_Person>
    I can access the values of each xml node in BS with the help of data item.
    I wanted to know how can I get the above request xml string in my Business Service in Java.

    {color:#0000ff}http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String){color}

  • Writing a large xml string to a file

    Hi,
    I get a large xml file, into a String (It might be around 8 MB also). After this, I need to write this to a file. Which java method I can use for the same.
    I am getting confused by the various classes for writing a file.
    I want to use the best, efficient way of doing this. Can any one please help?
    public static void writeStringToFile( String fileName, String content,
              boolean append )
              throws FileNotFoundException, IOException
              FileOutputStream fos = null;
              File file = new File (fileName);
              try {
    //++  fos = new FileOutputStream( file);     
          fos = new FileOutputStream( file, append );                 //++
                   fos.write(getBytes(content));
              } catch (FileNotFoundException fne) {
                   throw fne;
              } catch (IOException ioe) {
                   throw ioe;
              } finally {
                   try {
                   if(fos != null)
                        fos.close();
                   } catch (Exception _ex) {
         }

    hi_all wrote:
    But is there any any particular reason for using the encoding specific to xml?Yes, because that's what the XML specification says you're supposed to do. If you don't do that then you may produce malformed XML.
    Will there be any perf degrade or truncation of the large string, while writing to the file, if we use,
    out.write(sigUpdateString);Compared to what? You're just writing the data out to a file, the quickest way to do that is to just write the data out. The two things you should do are: (1) use a BufferedWriter (2) stop obsessing about performance.

  • Very large XML String parameters

    Hi !
    I'm using AXIS 1.x, websphere 5 --- The problem is - when i call webservice with xml (String) parameter upto size of 10kb-400kb.. it works fine..
    But my application could genrate very large xml, like 900kb-1000kb even more.. When this large XML is sent as String parameter.. no reply is recieved back..
    Can some body throw some light.. what is going wrong... and which approch to be followed.
    Thanks a lot
    @mit

    Maybe this example on the XDB forum will be helpful...
    XMLType view of Relational Content
    XML type questions are best asked in that forum.
    ;)

  • How do I read the XML string using Http response/request?

    When my HTTP POST action is perform, the action will return me a XML string as shown in the link, https://www.neteller.com/gateway/netdirectv4.cfm?amount=150.00&net_account=458415554241&secure_id=896365&bank_acct_num=6789&currency=USD&merchant_id=1234&merch_transid=1102&merch_account=john123&custom_1=test123&custom_2=test123&custom_3=test123&test=1
    The above XML string will be send back by one of the payment gateway.
    How do I retrieve all the attribute name and value from the XML string so that it can be stored in my database?
    The XML string will be as shown below:
    <?xml version="1.0" encoding="ISO-8859-1"?><netdirect version="4.0">
              <approval>yes</approval>
              <amount>150.00</amount>
              <trans_id>403070</trans_id>
              <error>none</error>
              <fee>4.35</fee>
              <time>{ts '2006-06-23 06:14:19'}</time>
              <firstname>Test</firstname>
              <lastname>Test</lastname>
              <email>[email protected]</email>
              <custom_1>test123</custom_1>
              <custom_2>test123</custom_2>
              <custom_3>test123</custom_3>
              <dafee>0.00</dafee>
              <client_currency>USD</client_currency>
              <client_amount>150.00</client_amount>
              <merchant_currency>USD</merchant_currency>
              <merchant_amount>150.00</merchant_amount>
              <fxrate>1.0</fxrate>
              </netdirect>

    How about parsing the XML? Check out JAXP.
    http://java.sun.com/webservices/jaxp/index.jsp

  • How to parse the result xml string in BPEL

    Hi,
    This is Ishmayel.v new to BPEL and hava experience in xml parsing, java and webservices.
    Now I am getting the XML file as a result string in BEPL.
    now I want to parse the XML string and insert into the database... If any one has the idea let me know.
    my email id is [email protected]
    Thanks in Advance,
    Regards,
    Ishmayel.

    Your question is not clear.
    You have a client applicaton which invokes a BPEL process and receives XML response from BPEL. Then you want to parse this response XML in your client application?
    Or you are running a BPEL process which invokes a service and receives an XML response. Then you want to parse this XML response in BPEL before your process can proceed?
    I have to assume that you are working with a string and then you want to convert the string into XML, and then parse the XML. If this is the case, then take a look at the ora:parseEscapedXML(contentString) function. You can use this in the expression editor in JDev.

  • How can I parse an XML string, (not an XML file)?

    Hi,
    I am using Xerces2 Java Parser 2.4.0,
    I wanta parse an XML string, not an XML file, but
    in the Parser class there is only following methods:
    parse(InputSource source)
    parse(java.lang.String systemId)
    thanks

    hi
      InputSource is = new InputSource(new ByteArrayInputStream(xmlSrc.getBytes()));
      HTH
    vasanth-ct

  • OSMF: How to create resource from XML string

    Hello,
    I have a URL that sometimes returns a valid playmanifest.f4m and sometimes returns a string represantation of my media URL.
    On my loadComplete handler I would like to create the appropriate resource according to the returned data.
    If the data is a URL, I just create a StreamingURLResource and create the media element.
    Is there a way for me to create some resource that contains the XML? I noticed OSMF has StreamingXMLResource but its excluded, and it doesn't look like it can answer my use case.
    Do you have any suggestions?
    Thanks,
    Michal

    Hi Michal,
    The baseURL is needed since you might want to use relative urls like in a normal f4m. The parsing had to be kept simple, so we preferred to make the baseURL mandatory and to reuse the f4m parsing code.
    You should be able to provide (in the xml string) paths for the streams, bootstraps, etc relative to that base url.
    You will not be able to use multi-layer manifest through this technique, though.

  • How can I read an XML string that's not from an XML file?

    I've got a script I'm trying to setup that communicates over a socket to retrieve different directions from a custom built Java program.  The Java program listens to requests from the Adobe scripting engine (in my case it's a Photoshop script) on a socket and immediately responds with the next set of directions.  These directions are currently in XML format.  The issue I'm having is that I can't parse the XML data since it's entered into a new XML object from a string rather than being read from a file.  Even without the socket code, you can see the issue by doing the following:
    var xml = new XML("<test><data>hey!</data></test>");
    alert(xml.test.data);
    alert(xml);
    The first alert "should" return "hey!" (without quotes, of course), but it doesn't, while the second alert returns what you would expect it to:
    <test>
        <data>hey!</data>
    </test>
    It works fine if read from an XML file, but from a string, like shown above, it just presents an empty alert box when attempting to access "xml.test.data".  Any ideas on how to fix this issue?  Can it be fixed?  Has it been fixed in newer versions (I'm currently using CS4)?
    Thanks in advance for any help!

    Duh... found my error... I was attempting to access the data by referencing the created "root" element.  Since <test> is the very first element tag, it's setup as the root element, which you don't need to reference.  Changing the alert to alert(xml.data); fixed it.
    Now I just feel dumb, lol...

  • How to map an large XML document to the XMLType with TopLink in JDev

    Hello!
    We need to map an XML document in the Java String to an XMLType column. If the XML document has less than 4000 characters, we have no problems by using the DirectToField mapping. However, once the XML document has more than 4000 characters, using the DirectToField mapping, we got the error: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column
    Then we have tried to use the "Type Conversion" mapping, to map it to the database type (Clob or NClob --oracle.toplink.oraclespecific). we got:
    Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    Error Code: 932
    Any suggestions?
    Thanks in advance!

    Thanks Matt! It works fine by using DirectToXMLTypeMapping.
    However, to get it work is not smooth. In particularly, we use Jdev in our project and Jdev has not included this feature yet. Therefore, I had to use the TopLink Workbench to create the descriptor file and cut&paste to the description file that generated by JDev. And also xdb.jar has to be part of the classpath.
    Then I come to an question -- how can we take some features that only provided by the TopLink Workbench into the Jdev environment without having to hack around?
    Thanks,
    s.c.

  • How to process very large internal tables and stop time limit

    Hello Experts,
    I am currently having a problem on how to fix a certain report where we process more than 500 thousand
    records in the internal table. I can't think of any solution that can make the below code any faster.
    I just checked in our prod server and the error time limit exceeded stops in the loop statement. Anyway,
    Below is the code. Any input will be appreciated. Thanks guys and take care!
    Get sales document and corresponding line item
      SELECT avbeln bposnr a~auart
             avkorg avtweg a~kunnr
             bmatnr bpstyv b~spart
        FROM vbak AS a
       INNER JOIN vbap AS b
          ON avbeln = bvbeln
       APPENDING TABLE lt_vbap
       WHERE a~auart IN lr_auart
         AND a~vbeln IN s_vbeln
         AND a~vbeln IN s_vbill
         AND a~vbtyp EQ p_vbtyp.
      LOOP AT lt_vbap ASSIGNING <wa_vbap>.
        IF <wa_vbap>-auart EQ 'ZUCI' OR
           <wa_vbap>-auart EQ 'ZURV' OR
           <wa_vbap>-auart EQ 'ZUPR'.
        Check ifa delivery document has been created
          CLEAR wa_vbill.
          SELECT SINGLE vbeln
            FROM vbfa
            INTO wa_vbill
           WHERE vbelv = <wa_vbap>-vbeln
             AND ( ( vbtyp_n EQ 'J' AND vbtyp_v = 'C' )
              OR ( vbtyp_n EQ 'T' AND vbtyp_v = 'H' ) ).
          IF sy-subrc <> 0.
            <wa_vbap>-del_ind = 'X'.
            CONTINUE.
          ELSE.
          Check if within selection parameters
            CLEAR wa_likp.
            READ TABLE lt_likp INTO wa_likp WITH KEY vbeln = wa_vbill.
            IF sy-subrc <> 0.
              SELECT SINGLE *
                FROM likp
                INTO wa_likp
               WHERE vbeln = wa_vbill.
              APPEND wa_likp TO lt_likp.
            ENDIF.
            IF NOT wa_likp-wadat_ist IN s_erdat.
              <wa_vbap>-del_ind = 'X'.
              CONTINUE.
            ENDIF.
          ENDIF.
        ELSE.
      Check if this has already been billed
          CLEAR wa_vbill.
          SELECT SINGLE vbeln
            FROM vbfa
            INTO wa_vbill
           WHERE vbelv = <wa_vbap>-vbeln
             AND ( ( vbtyp_n EQ 'M' AND vbtyp_v = 'C' )
              OR ( vbtyp_n EQ 'O' AND vbtyp_v = 'H' ) ).
          IF sy-subrc <> 0.
            <wa_vbap>-del_ind = 'X'.
            CONTINUE.
          ELSE.
          Check if within selection parameters
            CLEAR wa_vbrk.
            READ TABLE lt_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbill.
            IF sy-subrc <> 0.
              SELECT SINGLE vbeln fkdat
                FROM vbrk
                INTO wa_vbrk
               WHERE vbeln = wa_vbill.
              APPEND wa_vbrk TO lt_vbrk.
            ENDIF.
            IF NOT wa_vbrk-fkdat IN s_erdat.
              <wa_vbap>-del_ind = 'X'.
              CONTINUE.
            ENDIF.
          ENDIF.
        ENDIF.
      Get Material Type and Division
        IF <wa_vbap>-spart IS NOT INITIAL.
          SELECT SINGLE mtart
            FROM mara
            INTO lv_mtart
           WHERE matnr = <wa_vbap>-matnr.
        ELSE.
          SELECT SINGLE mtart spart
            FROM mara
            INTO (lv_mtart,<wa_vbap>-spart)
           WHERE matnr = <wa_vbap>-matnr.
        ENDIF.
      If material division is same as parameter division
        IF <wa_vbap>-spart = p_spart.
      If material is subsidiary-owned
       IF <wa_vbap>-spart in lr_spart.
        If customer is the same as that of parameter division
          IF <wa_vbap>-kunnr NE lr_kunnr OR <wa_vbap>-auart EQ 'ZUDO' OR <wa_vbap>-auart EQ 'ZUS3'.
          If item is a free good, tag order type as 'ZUPR' to treat
          the item the same way as 'ZUPR'
            IF <wa_vbap>-pstyv = 'TANN' OR
               <wa_vbap>-pstyv = 'ZKNF' OR
               <wa_vbap>-pstyv = 'ZKNN' OR
               <wa_vbap>-pstyv = 'ZFLO' OR
               <wa_vbap>-pstyv = 'ZKBF' OR
               <wa_vbap>-pstyv = 'ZKLN' OR
               <wa_vbap>-pstyv = 'ZREN'.
              lv_auart = <wa_vbap>-auart.
              IF lv_auart EQ 'ZUPR'.
                CLEAR <wa_vbap>-pstyv.
              ENDIF.
              <wa_vbap>-auart = 'ZUPR'.
              CLEAR: lv_mtart.
            ENDIF.
          Set Cost of Goods Sold Account
            <wa_vbap>-cogshkont = '0050000010'.
            CASE <wa_vbap>-auart.
              WHEN 'ZUPR'.
                CASE lv_mtart.
                  WHEN 'ZUL4'.
                    <wa_vbap>-del_ind = 'X'.
                    CONTINUE.
                  WHEN OTHERS.
                  Check if division is defined in mapping table
                    READ TABLE lt_ulsub INTO wa_ulsub
                         WITH KEY spart = <wa_vbap>-spart.
                    IF sy-subrc = 0.
                      <wa_vbap>-kostl = wa_ulsub-kostlp.
                      <wa_vbap>-bukrs = wa_ulsub-bukrsp.
                      <wa_vbap>-type = 'TP'.
                    Set Cost of Goods Sold Account
                      IF lv_auart = 'ZUPR'.
                        <wa_vbap>-cogshkont = '0050000006'.
                      ENDIF.
                    ELSE.
                      <wa_vbap>-del_ind = 'X'.
                      CONTINUE.
                    ENDIF.
                ENDCASE.
              WHEN 'ZUCI' OR 'ZUDO' OR 'ZURD' OR 'ZUS3'.
            Get cost center from header text
                PERFORM get_cost_center USING <wa_vbap>-vbeln
                                     CHANGING <wa_vbap>-kostl.
    *  Change by LGTE 11-02-2006
            Check if Medvale sales
                IF <wa_vbap>-auart EQ 'ZUCI' AND <wa_vbap>-kostl IS INITIAL.
                  <wa_vbap>-del_ind = 'X'.
                  CONTINUE.
            Check if UL Cost Center
                ELSEIF <wa_vbap>-kostl NE gv_ul_kostl.
               IF <wa_vbap>-kostl NE gv_ul_kostl.
    *  End change.
              Get material division and check if subsidiary product
                 SELECT SINGLE spart FROM mara INTO <wa_vbap>-spart
                 WHERE matnr = <wa_vbap>-matnr.
                  READ TABLE lt_ulsub INTO wa_ulsub
                       WITH KEY spart = <wa_vbap>-spart.
                  IF sy-subrc = 0.
                  Get requestor's company code from cost center data
                    SELECT SINGLE bukrs
                      FROM csks
                      INTO <wa_vbap>-bukrs
                     WHERE kokrs =  lc_kokrs
                       AND kostl =  <wa_vbap>-kostl
                       AND datbi GE sy-datum
                       AND datab LE sy-datum.
                    IF sy-subrc = 0.
                    For donations, only include if a subsidiary company is donating
                      IF <wa_vbap>-auart EQ 'ZUDO' OR <wa_vbap>-auart EQ 'ZUS3'.
                        IF NOT <wa_vbap>-kunnr IN lr_kunnrnt.
                          <wa_vbap>-del_ind = 'X'.
                          CONTINUE.
                        ENDIF.
                       CHECK <wa_vbap>-kunnr IN lr_kunnrnt.
                      ENDIF.
                    For ZUCI, if the company code of the costcenter is UL, do not include
                      IF <wa_vbap>-bukrs EQ gc_ul_bukrs.
                        <wa_vbap>-del_ind = 'X'.
                        CONTINUE.
                      ENDIF.
                      IF <wa_vbap>-bukrs = wa_ulsub-bukrsp.
                        <wa_vbap>-type = 'RV'.
                      ELSE.
                        <wa_vbap>-type = 'RV'.
                      ENDIF.
                    ELSE.
                    Check if customer defined in table ZFI_DONATIONS
                      SELECT SINGLE kunnr FROM zfi_donations INTO <wa_vbap>-kostl
                        WHERE kunnr = <wa_vbap>-kostl.
                      IF sy-subrc <> 0.
                        lv_error = 'X'.
                        CONCATENATE 'Cost center/Customer' <wa_vbap>-kostl
                                    'does not exist. Please check Sales Order'
                                    <wa_vbap>-vbeln
                                    INTO lt_disp-message SEPARATED BY space.
                        lt_disp-type = 'E'.
                        <wa_vbap>-del_ind = 'X'.
                        APPEND lt_disp.
                        CONTINUE.
                      ELSE.
                        <wa_vbap>-type = 'RV'.
                      ENDIF.
                    ENDIF.
                  ELSE.
                    <wa_vbap>-del_ind = 'X'.
                    CONTINUE.
                  ENDIF.
                ELSE.
                  <wa_vbap>-del_ind = 'X'.
                  CONTINUE.
                ENDIF.
              WHEN OTHERS.
                <wa_vbap>-del_ind = 'X'.
                CONTINUE.
            ENDCASE.
          ELSE.
            <wa_vbap>-del_ind = 'X'.
            CONTINUE.
          ENDIF.
        ELSE.
          <wa_vbap>-del_ind = 'X'.
          CONTINUE.
        ENDIF.
      Get company code description
        SELECT SINGLE butxt FROM t001 INTO <wa_vbap>-butxt
         WHERE bukrs = <wa_vbap>-bukrs.
        IF sy-subrc <> 0.
          SELECT SINGLE name1 FROM kna1 INTO <wa_vbap>-butxt
           WHERE kunnr = <wa_vbap>-kostl.
        ENDIF.
    Change by LGTE on 11-02-2006
    Get Transaction Type
        CASE <wa_vbap>-auart.
          WHEN 'ZUPR'. "UL Promo/Samples
            IF <wa_vbap>-pstyv = 'TANN' OR
               <wa_vbap>-pstyv = 'ZKNF' OR
               <wa_vbap>-pstyv = 'ZKNN' OR
               <wa_vbap>-pstyv = 'ZFLO' OR
               <wa_vbap>-pstyv = 'ZKBF' OR
               <wa_vbap>-pstyv = 'ZKLN' OR
               <wa_vbap>-pstyv = 'ZREN'.
              <wa_vbap>-ltext = 'Free Goods'.
            ELSE.
              <wa_vbap>-ltext = 'Product Samples'.
            ENDIF.
          WHEN 'ZUDO'. "Donations - R/3
            <wa_vbap>-ltext = 'Donations - R/3'.
          WHEN 'ZUCI'. "Donations - ZUCI
            <wa_vbap>-ltext = 'Donations - ZUCI'.
          WHEN 'ZURD' OR 'ZUS3'. "UL Returns - Donation
            <wa_vbap>-ltext = 'UL Returns - Donation'.
        ENDCASE.
    Get material description
        SELECT SINGLE maktx
          FROM makt
          INTO <wa_vbap>-maktx
         WHERE matnr = <wa_vbap>-matnr
           AND spras = sy-langu.
    Get division from material master
       SELECT SINGLE spart FROM mara INTO <wa_vbap>-spart
        WHERE matnr = <wa_vbap>-matnr.
    Get division description
        SELECT SINGLE vtext
          FROM tspat
          INTO <wa_vbap>-vtext
         WHERE spras = sy-langu
           AND spart = <wa_vbap>-spart.
    Get Valuation Class
        SELECT SINGLE bklas
          FROM mbew
          INTO lv_bklas
         WHERE matnr = <wa_vbap>-matnr.
    Determine G/L of FG Based on Valuation Class
        READ TABLE lt_val_cls INTO wa_val_cls WITH TABLE KEY bklas = lv_bklas.
        <wa_vbap>-fghkont = wa_val_cls-hkont.
    Determine Cost Center of Cogs Account
        READ TABLE lt_ulsub INTO wa_ulsub WITH TABLE KEY spart = <wa_vbap>-spart.
        <wa_vbap>-cogskostl = wa_ulsub-kostlp.

    Hi!
    First of all, don't use SELECT SINGLE inside of LOOP,
    instead  SELECT all relevated rows before LOOP in intertal tables (using FOR ALL ENTRIES) and then use
    READ TABLE WITH KEY BINARY SEARCH.
    it will match faster.
    for example:
    IF NOT lt_vbap[] IS INITIAL.
    SELECT vbeln
    FROM vbfa
    INTO lt_vbill
    FOR ALL ENTRIES IN lt_vbap
    WHERE vbelv = lt_vbap-vbeln.
    ENDIF.
    SORT lt_vbap BY vbeln.
    READ TABLE lt_vbill WITH KEY vbeln = <wa_vbap>-vbeln
    BINARY SEARCH.

  • How to extract a clob xml string with multiple row of table tag. in 10g

    i have a xml value like:
    <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
    <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
    i want to insert each of <c> value in a table with respective columns according c1,c2,c3,c4
    pls suggest me what to do
    I use extract(xml, '/table) tab but it just read first one line & return error for other

    Can you plz explain to me thisIt is because you did not provide us with a valid xml structure so I used 11g's xmlparse function to create a xmltype even with the xml not being valid (no root tag).
    With a valid xml structure I could use the xmltype constructor instead and go on the same way as before:
    SQL> select *
      from xmltable (
             'table'
             passing xmltype ('
                            <root>
                            <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
                            <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
                            </root>').extract ('root/table')
             columns c1 number path 'c1', c2 varchar2 (4) path 'c2', c3 varchar2 (6) path 'c3', c4 varchar2 (6) path 'c4')
            C1 C2     C3        C4      
             0 Mr     abc       Sharma  
             0 Mrs    abcd      Sharma  
             0 Mr     sabc      Sharma  
             0 Mrs    sdabc     Sharma  
             0 Mr     dabc      Sharma  
             0 Mr     adbc      Sharma  
    6 rows selected.

  • How to call PL/SQL function and pass parameter to ODI variable?

    Can I call PL/SQL function and assign a return value to an ODI variable? Also can I assign ODI variable to IN paramter and assign OUT parameter to ODI variable? What ODI doc has that information?
    Thanks

    Hi,
    Refer this http://odiexperts.com/how-to-use-plsql-procedures-and-functions-in-odi
    Thanks,
    Sutirtha

  • How can i compare two XML files storeds in a LONG column

    Hi,
    I need to compare two xml files. My xmls are stored in two table like this:
    Table 1
    ID_COL number(5);
    XML1 LONG()
    Table 2
    ID_COL number(5);
    XML2 LONG()
    I need compare the values of the tags of this xmls files e to list de differences.
    Tks,
    Fernando.

    yes odie you are right...i think that my xml is wrong...
    I would like to compare every element/attribute...
    Bellow is another xml...this is ok....tks
    <?xml version="1.0" encoding="UTF-8" ?>
    - <nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" versao="2.00">
    - <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
    - <infNFe Id="NFe31121059106377000172550010003957681605366269" versao="2.00">
    + <ide>
    <cUF>31</cUF>
    <cNF>60536626</cNF>
    <natOp>VDAS PROD ESTABELECIMENT</natOp>
    <indPag>1</indPag>
    <mod>55</mod>
    <serie>1</serie>
    <nNF>395768</nNF>
    <dEmi>2012-10-03</dEmi>
    <dSaiEnt>2012-10-03</dSaiEnt>
    <hSaiEnt>18:30:00</hSaiEnt>
    <tpNF>1</tpNF>
    <cMunFG>3159605</cMunFG>
    <tpImp>1</tpImp>
    <tpEmis>1</tpEmis>
    <cDV>9</cDV>
    <tpAmb>1</tpAmb>
    <finNFe>1</finNFe>
    <procEmi>0</procEmi>
    <verProc>1.0</verProc>
    </ide>
    + <emit>
    <CNPJ>59106377000172</CNPJ>
    <xNome>METAGAL IND E COM LTDA</xNome>
    <xFant>METAGAL INDUSTRIA E COMERCIO LTDA</xFant>
    - <enderEmit>
    <xLgr>ROD BR 459</xLgr>
    <nro>333</nro>
    <xCpl>KM 121</xCpl>
    <xBairro>DISTRITO INDUSTRIAL</xBairro>
    <cMun>3159605</cMun>
    <xMun>SANTA RITA DO SAPUCAI</xMun>
    <UF>MG</UF>
    <CEP>37540000</CEP>
    <cPais>1058</cPais>
    <xPais>BRASIL</xPais>
    <fone>3534719100</fone>
    </enderEmit>
    <IE>5969141300009</IE>
    <IM>01183</IM>
    <CNAE>2949299</CNAE>
    <CRT>3</CRT>
    </emit>
    + <dest>
    <CNPJ>59275792000150</CNPJ>
    <xNome>GENERAL MOTORS DO BRASIL LTDA</xNome>
    - <enderDest>
    <xLgr>AV GOIAS</xLgr>
    <nro>1805</nro>
    <xBairro>BARCELONA</xBairro>
    <cMun>3548807</cMun>
    <xMun>SAO CAETANO DO SUL</xMun>
    <UF>SP</UF>
    <CEP>09501970</CEP>
    <cPais>1058</cPais>
    <xPais>BRASIL</xPais>
    </enderDest>
    <IE>636003724112</IE>
    <email>[email protected]</email>
    </dest>
    - <det nItem="1">
    + <prod>
    <cProd>XM20C9500PPR</cProd>
    <cEAN />
    <xProd>ESPELHO RETROVISOR EXTERNO</xProd>
    <NCM>70091000</NCM>
    <CFOP>6501</CFOP>
    <uCom>PC</uCom>
    <qCom>80.0000</qCom>
    <vUnCom>35.8700000000</vUnCom>
    <vProd>2869.60</vProd>
    <cEANTrib />
    <uTrib>PC</uTrib>
    <qTrib>80.0000</qTrib>
    <vUnTrib>35.8700000000</vUnTrib>
    <indTot>1</indTot>
    <xPed>XRW001RV</xPed>
    <nItemPed>000001</nItemPed>
    </prod>
    - <imposto>
    - <ICMS>
    - <ICMS00>
    <orig>0</orig>
    <CST>00</CST>
    <modBC>3</modBC>
    <vBC>2869.60</vBC>
    <pICMS>12.00</pICMS>
    <vICMS>344.35</vICMS>
    </ICMS00>
    </ICMS>
    - <IPI>
    <CNPJProd>00000000000000</CNPJProd>
    <cEnq>0</cEnq>
    - <IPINT>
    <CST>54</CST>
    </IPINT>
    </IPI>
    - <II>
    <vBC>0.00</vBC>
    <vDespAdu>0.00</vDespAdu>
    <vII>0.00</vII>
    <vIOF>0.00</vIOF>
    </II>
    - <PIS>
    - <PISNT>
    <CST>08</CST>
    </PISNT>
    </PIS>
    - <COFINS>
    - <COFINSNT>
    <CST>08</CST>
    </COFINSNT>
    </COFINS>
    </imposto>
    <infAdProd>PC.93378954-COMPL.PED.XRW001RV</infAdProd>
    </det>
    + <total>
    - <ICMSTot>
    <vBC>2869.60</vBC>
    <vICMS>344.35</vICMS>
    <vBCST>0.00</vBCST>
    <vST>0.00</vST>
    <vProd>2869.60</vProd>
    <vFrete>0.00</vFrete>
    <vSeg>0.00</vSeg>
    <vDesc>0.00</vDesc>
    <vII>0.00</vII>
    <vIPI>0.00</vIPI>
    <vPIS>0.00</vPIS>
    <vCOFINS>0.00</vCOFINS>
    <vOutro>0.00</vOutro>
    <vNF>2869.60</vNF>
    </ICMSTot>
    <retTrib />
    </total>
    + <transp>
    <modFrete>0</modFrete>
    - <transporta>
    <CNPJ>00980331000488</CNPJ>
    <xNome>THALE TRANSPORTES E LOG. LTDA</xNome>
    <IE>5963866160070</IE>
    <xEnder>ROD BR 459-KM 121 - DIST INDL, S/N</xEnder>
    <xMun>SANTA RITA DO SAPUCAI</xMun>
    <UF>MG</UF>
    </transporta>
    - <veicTransp>
    <placa>DPF8048</placa>
    <UF>SP</UF>
    </veicTransp>
    - <vol>
    <qVol>20</qVol>
    <esp>OUTROS</esp>
    <pesoL>64.000</pesoL>
    <pesoB>104.000</pesoB>
    </vol>
    </transp>
    + <cobr>
    - <fat>
    <nFat>000000395768</nFat>
    <vOrig>2869.60</vOrig>
    </fat>
    - <dup>
    <nDup>1</nDup>
    <dVenc>2012-11-20</dVenc>
    <vDup>2869.60</vDup>
    </dup>
    </cobr>
    - <infAdic>
    <infCpl>VIA DE TRANSPORTE RODOVIARIA CODIGO : 108061 PEDIDO NRO : ACIMA FABRICA :72480 REDESPACHO ATRAVES DE VELOCE LOGISTICA S/A ESTRADA DOS ALVARENGAS SAO BERNARDO CAMPO ASSUNCAO SP CNPJ : 10.299.567/0003-26 IE : 635.600.028.11 IPI - IMUNE CFE.ART.18, INCISO II, DO RIPI - DECRETO No.7.212/2010. REMESSA COM FIM ESPECIFICO DE EXPORTACAOMERC.A SER EXPORT.P/GENERAL MOTORS DO BRASIL LTDA.DECEX=3-0322/10-0007 ESTOCA-GEM TEMPORARIA NA VELOCE LOGISTICA S.A. ESTR.ALVARENGAS,4018 B.ASSUNCAO S.B.C. CNPJ10.299.567/0003-26IE.635.600.028.110 FT NR.431.183 ROMANEIO :131.588</infCpl>
    </infAdic>
    </infNFe>
    + <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
    - <SignedInfo>
    <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
    <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
    - <Reference URI="#NFe31121059106377000172550010003957681605366269">
    - <Transforms>
    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
    <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
    <DigestValue>jN2ozPH3/GvAS8Q5lh/t9bzuXCw=</DigestValue>
    </Reference>
    </SignedInfo>
    <SignatureValue>GAXPLvMCtIYdwMxXDcyL0kr5hCDPCFw8/uNYHFcdTMqBhLgIcEtzHRf8qioWlUVSHNf5jnCLKGjhDV4bEJqkcBhWsKouMzojQ+Z6hkFQAWNuJfPIzutmtRy3AePc5tHK0lI3tF3ws9memboJ8sW21IOWHB6eB0jK2gmhcOlDejc=</SignatureValue>
    - <KeyInfo>
    - <X509Data>
    <X509Certificate>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</X509Certificate>
    </X509Data>
    </KeyInfo>
    </Signature>
    </NFe>
    - <protNFe versao="2.00">
    - <infProt>
    <tpAmb>1</tpAmb>
    <verAplic>13_0_32</verAplic>
    <chNFe>31121059106377000172550010003957681605366269</chNFe>
    <dhRecbto>2012-10-03T17:35:55</dhRecbto>
    <nProt>131120853536488</nProt>
    <digVal>jN2ozPH3/GvAS8Q5lh/t9bzuXCw=</digVal>
    <cStat>100</cStat>
    <xMotivo>Autorizado o uso da NF-e</xMotivo>
    </infProt>
    </protNFe>
    </nfeProc>

Maybe you are looking for

  • Connections not being released from pool with Weblogic 5.1 sp 8

    I am using WLS 5.1 on RedHat Linux kernel 2.4 The database is oracle 8.1.6 and I am using the thin jdbc driver as shown in the config below. weblogic.jdbc.connectionPool.bobePool=\ url=jdbc:oracle:thin:@localhost:1521:<sid>,\ driver=oracle.jdbc.drive

  • Close excel programmatically after user cancels file selection

    Greetings all. I apologize but I incorrectly posted this question on the wrong board originally so am posting it again here. I have a VI that I wrote with some help from this site that reads in as many user selected Flat Data Files as desired into Ex

  • Attaching PDF to body of email

    So, trying to take a nice PDF and have it so it is in the BODY of an email, not an attachment.  That way when the recipient opens the email, they see the entire newsletter in front of them without having to download. All I have to do is drag it into

  • Load balancing algorithm problems with servlets

    All, We have a simple servlet which looks up an RMI object from JNDI and invokes one of its methods in a loop. The RMI object is the HelloClusterImpl example provided by WebLogic. The servlet basically copies the code from the HelloClusterClient. In

  • Adobe CS2 Activation issue

    Every time we launch CS2 it asks for Activation. I visited Adobe help center for solution and Adobe suggests downloading new installer of CS2. But adobe says you have to use the serial No (1045-1412-5685-1654-6343-1431) for successful installation as