Replace Function on CLOB

Hi all, i am new to this forum and i hope everyone is doing great.
I have a question on CLOB objects.
I am working on Oracle 8i and i have CLOB object coming from DB2 data base.
Can i apply Replace or Translate function on CLOB data? Because i have special characters like %$^@#. I want to replace all these.
Can anyone help me .
Thanks in Advance.

Hi
This article uses DBMS_LOB to mimic the standard replace function for a CLOB. It's for 9i but it may be worth a try to see if it will work on 8i too.
http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11080
Hope this helps

Similar Messages

  • Replace function for CLOB

    I have CLOB column and want to do a select with a replace kind of function- replacing certain characters. E.g. if body is a CLOB field, I need
    select Clobreplace(body,'abcdef','123456') from t1;
    Does anyone have a function or equivalent to do this?
    Thanks

    There isn't one readymade. However, it would be relatively simple to write one yourself. You would need to iterate around the input clob doing the following:[list]
    [*]use DBMS_LOB.INSTR to locate occurances of the token;
    [*]use DBMS_LOB.SUBSTR to segment your input CLOB using the offset from the INSTR call;
    [*]write each segment appended with the replacement string to a temporary LOB;
    [*]return the temporary LOB
    [list]
    I suggest you have a play around with the logic of this using SQL SUBSTR and INSTR on a varchar2 string. Once you understand what you're doing you can introduce the complication of operating on a CLOB.
    Good luck, APC

  • Replace function not working for XML CLOB data

    Hi all,
    I am generating XML using DBMS_XMLGEN in oracle 10g. After generating the XML, I am replacing the ROW tags with appropriate tag name using REPLACE function. Sometimes the tag name is not replaced correctly.
    Eg.I am replacing </Cargo_ROW> with </CargoDetail>. But sometimes in one xml, this tag is coming as </CargoDetROW> or </CargoDetaiW>. The XML size is always huge and the same tag is repeated so many time in the loop and in the same XML, only one tag will be replaced incorrectly. This also not happening for all XMLs.
    If any one knows the cause about this problem or solution, please share the same.
    thanks,

    Yes Anton, you are right..
    It was typecasting problem
    replace supports clob
    Check this out
    SQL> declare
      2  xmldata clob;
      3  Begin
      4  xmldata:='<Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM" versio
      5  <Transaction>
      6  <TransactionType>ORIGINAL</TransactionType>
      7  <ControlNumber>60022449779</ControlNumber>
      8  <BookingHeader>
      9  <PortCodeOriginal>GBSOU</PortCodeOriginal>
    10  <Contact>.</Contact>
    11  <PhoneContact>.</PhoneContact>
    12  </BookingHeader>
    13  <PartyInformation>
    14  <PartyDetails>
    15  <PartyId>10002866</PartyId>
    16  <Type>SHIP</Type>
    17  <Name1>L LTD.</Name1>
    18  </PartyDetails>
    19  </PartyInformation>
    20  <Cargo>
    21  <CargoDetROW>
    22  <CargoHeader>
    23  <CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
    24  <CargoId>RW9330P013948</CargoId>
    25  </CargoHeader>
    26  <CargoDimensions>
    27  <Length>1</Length>
    28  <Width>2</Width>
    29  </CargoDimensions>
    30  </CargoDetail>
    31  <CargoDetROW>
    32  <CargoHeader>
    33  <CargoReceivedSeqNo>600015391791</CargoReceivedSeqNo>
    34  <CargoId>RW9330P01394AA</CargoId>
    35  </CargoHeader>
    36  <CargoDimensions>
    37  <Length>2</Length>
    38  <Width>2</Width>
    39  </CargoDimensions>
    40  </CargoDetail>
    41  <Cargo_ROW>
    42  <CargoHeader>
    43  <CargoReceivedSeqNo>600015391792</CargoReceivedSeqNo>
    44  <CargoId>RW9330P01322</CargoId>
    45  </CargoDetaiW>
    46  <CargoDimensions>
    47  <Length>1</Length>
    48  <Width>2</Width>
    49  </CargoDimensions>
    50  </Cargo_ROW>
    51  </Cargo>
    52  </Transaction>
    53  </Message>';
    54  xmldata:=to_clob(regexp_replac(xmldata,'</Cargo_ROW>|</CargoDetaiW>|</CargoDetROW>','</CargoDetail'));
    55  xmldata:=to_clob(regexp_replace(xmldata,'<Cargo_ROW>|<CargoDetaiW>|<CargoDetROW>','<CargoDetail>'));
    56  dbms_output.put_line(xmldata);
    57  end;
    58  /
    <Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM"
    version="1.0">
    <Transaction>
    <TransactionType>ORIGINAL</TransactionType>
    <Contro
    lNumber>60022449779</ControlNumber>
    <BookingHeader>
    <PortCodeOriginal>GBSOU</Por
    tCodeOriginal>
    <Contact>.</Contact>
    <PhoneContact>.</PhoneContact>
    </BookingHead
    er>
    <PartyInformation>
    <PartyDetails>
    <PartyId>10002866</PartyId>
    <Type>SHIP</Ty
    pe>
    <Name1>L
    LTD.</Name1>
    </PartyDetails>
    </PartyInformation>
    <Cargo>
    <CargoDetail>
    <CargoHea
    der>
    <CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
    <CargoId>RW9330P01394
    8</CargoId>
    </CargoHeader>
    <CargoDimensions>
    <Length>1</Length>
    <Width>2</Width>
    </CargoDimensions>
    </CargoDetail>
    <CargoDetail>
    <CargoHeader>
    <CargoReceivedSeq
    No>600015391791</CargoReceivedSeqNo>
    <CargoId>RW9330P01394AA</CargoId>
    </CargoHe
    ader>
    <CargoDimensions>
    <Length>2</Length>
    <Width>2</Width>
    </CargoDimensions>
    <
    /CargoDetail>
    <CargoDetail>
    <CargoHeader>
    <CargoReceivedSeqNo>600015391792</Carg
    oReceivedSeqNo>
    <CargoId>RW9330P01322</CargoId>
    </CargoDetail>
    <CargoDimensions>
    <Length>1</Length>
    <Width>2</Width>
    </CargoDimensions>
    </CargoDetail>
    </Cargo>
    </Transaction>
    </Message>
    PL/SQL procedure successfully completed.
    SQL> Twinkle
    Edited by: Twinkle on Nov 26, 2009 6:05 PM

  • Prolem in CLOB replace function

    Hi,
    I am working on Oracle 10g (release 2).
    Currently facing problem in replace function
    My given patterns are
    Replace(+string+, varchar2, clob)
    Replace(+String+, clob, clob)
    In both casese, I'm getting ORA-22828 error.
    Can anyone please suggest the solution.
    Thanks.

    Please see
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3388795154384573::::P11_QUESTION_ID:1533006062995

  • Problem in execution of a function having clob datatype

    [http://www.orafaq.com/forum/t/128331/98870/]
    Hi,
    I had a Problem in executing a function having clob datatype.
    Here below is my function.
    create or replace type split_obj as object
        occurence_id number(10,0),
        splitvalue varchar2(1000)
    create or replace type split_rec as table of split_obj;
    create or replace FUNCTION Split_new1(
                                           p_string IN clob,
                                           p_delimiter IN VARCHAR2
                                         )  return split_rec  pipelined  is
        v_length NUMBER := dbms_lob.getlength(p_string);
          v_start NUMBER := 1;
         v_index NUMBER;
          V_temp NUMBER(10,0):=0;
       begin
    WHILE(v_start <= v_length)
        LOOP
          v_index := dbms_lob.INSTR(p_string, p_delimiter, v_start);
           IF v_index = 0 THEN
             V_temp:=V_temp+1;
             PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_length,v_start)));
             v_start := v_length + 1;
           ELSE
             v_temp:=v_temp+1;  
             PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_index - v_start,v_start)));
             v_start := v_index + 1;
           END IF;
         END LOOP;
        return;
       end Split_new1;Here attached link contains the procedure trying to execute the function with huge string more than 400kb.
    Could you pls let me know how to do the same in sqlplus and toad.
    Thanks in advance.
    Edited by: user512743 on Nov 27, 2008 4:31 AM

    BluShadow wrote:
    The problem is that in your execution of this you are trying to assign a value to the clob variable using
    v_clob := '<string>'
    where the string is greater than allowed in PL/SQL.
    Whilst the CLOB itself can hold more data, the string is actually the equivalent of a VARCHAR2 so cannot exceed VARCHAR2 limits.
    You should use the DBMS_LOB package to append data to your CLOB in chunks of no more than 32767 characters at a time.??? PL/SQL provides full CLOB support. There is no need to use DBMS_LOB (although you could). OP's function has logic errors. Anyway:
    SQL> create or replace type split_obj as object
      2    (
      3      occurence_id number(10,0),
      4      splitvalue varchar2(1000)
      5    );
      6  /
    Type created.
    SQL> create or replace type split_rec as table of split_obj;
      2  /
    Type created.
    SQL> create or replace
      2    FUNCTION Split_new1(
      3                        p_string IN clob,
      4                        p_delimiter IN VARCHAR2
      5                       )
      6      return split_rec  pipelined
      7      is
      8          v_length NUMBER := length(p_string);
      9          v_start  NUMBER := 1;
    10          v_end    NUMBER;
    11          V_id     NUMBER :=0;
    12          v_clob   CLOB   := p_string || p_delimiter;
    13      begin
    14          while(v_start <= v_length) loop
    15            v_end := instr(v_clob, p_delimiter, v_start);
    16            v_id  := v_id + 1;
    17            pipe row(split_obj(v_id,substr(p_string,v_start,v_end - v_start)));
    18            v_start := v_end + length(p_delimiter);
    19          end loop;
    20          return;
    21  end Split_new1;
    22  /
    Function created.
    SQL> create table test_table(x clob)
      2  /
    Table created.
    SQL> declare
      2      c clob;
      3  begin
      4      for i in 1..26 loop
      5        c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
      6      end loop;
      7      for i in 1..26 loop
      8        c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1)) || ',';
      9      end loop;
    10      for i in 1..26 loop
    11        c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
    12      end loop;
    13      for i in 1..26 loop
    14        if i > 1 then c := c || ','; end if;
    15        c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1));
    16      end loop;
    17      insert into test_table
    18        values(c);
    19  end;
    20  /
    PL/SQL procedure successfully completed.
    SQL> select  length(x)
      2    from  test_table
      3  /
    LENGTH(X)
        104103
    SQL> select  t.occurence_id,
      2          length(splitvalue) len,
      3          substr(splitvalue,1,20) first_20
      4    from  test_table,
      5          table(Split_new1(x,',')) t
      6  /
    OCCURENCE_ID        LEN FIRST_20
               1       1000 aaaaaaaaaaaaaaaaaaaa
               2       1000 bbbbbbbbbbbbbbbbbbbb
               3       1000 cccccccccccccccccccc
               4       1000 dddddddddddddddddddd
               5       1000 eeeeeeeeeeeeeeeeeeee
               6       1000 ffffffffffffffffffff
               7       1000 gggggggggggggggggggg
               8       1000 hhhhhhhhhhhhhhhhhhhh
               9       1000 iiiiiiiiiiiiiiiiiiii
              10       1000 jjjjjjjjjjjjjjjjjjjj
              11       1000 kkkkkkkkkkkkkkkkkkkk
    OCCURENCE_ID        LEN FIRST_20
              12       1000 llllllllllllllllllll
              13       1000 mmmmmmmmmmmmmmmmmmmm
              14       1000 nnnnnnnnnnnnnnnnnnnn
              15       1000 oooooooooooooooooooo
              16       1000 pppppppppppppppppppp
              17       1000 qqqqqqqqqqqqqqqqqqqq
              18       1000 rrrrrrrrrrrrrrrrrrrr
              19       1000 ssssssssssssssssssss
              20       1000 tttttttttttttttttttt
              21       1000 uuuuuuuuuuuuuuuuuuuu
              22       1000 vvvvvvvvvvvvvvvvvvvv
    OCCURENCE_ID        LEN FIRST_20
              23       1000 wwwwwwwwwwwwwwwwwwww
              24       1000 xxxxxxxxxxxxxxxxxxxx
              25       1000 yyyyyyyyyyyyyyyyyyyy
              26       1000 zzzzzzzzzzzzzzzzzzzz
              27       1000 AAAAAAAAAAAAAAAAAAAA
              28       1000 BBBBBBBBBBBBBBBBBBBB
              29       1000 CCCCCCCCCCCCCCCCCCCC
              30       1000 DDDDDDDDDDDDDDDDDDDD
              31       1000 EEEEEEEEEEEEEEEEEEEE
              32       1000 FFFFFFFFFFFFFFFFFFFF
              33       1000 GGGGGGGGGGGGGGGGGGGG
    OCCURENCE_ID        LEN FIRST_20
              34       1000 HHHHHHHHHHHHHHHHHHHH
              35       1000 IIIIIIIIIIIIIIIIIIII
              36       1000 JJJJJJJJJJJJJJJJJJJJ
              37       1000 KKKKKKKKKKKKKKKKKKKK
              38       1000 LLLLLLLLLLLLLLLLLLLL
              39       1000 MMMMMMMMMMMMMMMMMMMM
              40       1000 NNNNNNNNNNNNNNNNNNNN
              41       1000 OOOOOOOOOOOOOOOOOOOO
              42       1000 PPPPPPPPPPPPPPPPPPPP
              43       1000 QQQQQQQQQQQQQQQQQQQQ
              44       1000 RRRRRRRRRRRRRRRRRRRR
    OCCURENCE_ID        LEN FIRST_20
              45       1000 SSSSSSSSSSSSSSSSSSSS
              46       1000 TTTTTTTTTTTTTTTTTTTT
              47       1000 UUUUUUUUUUUUUUUUUUUU
              48       1000 VVVVVVVVVVVVVVVVVVVV
              49       1000 WWWWWWWWWWWWWWWWWWWW
              50       1000 XXXXXXXXXXXXXXXXXXXX
              51       1000 YYYYYYYYYYYYYYYYYYYY
              52       1000 ZZZZZZZZZZZZZZZZZZZZ
              53       1000 aaaaaaaaaaaaaaaaaaaa
              54       1000 bbbbbbbbbbbbbbbbbbbb
              55       1000 cccccccccccccccccccc
    OCCURENCE_ID        LEN FIRST_20
              56       1000 dddddddddddddddddddd
              57       1000 eeeeeeeeeeeeeeeeeeee
              58       1000 ffffffffffffffffffff
              59       1000 gggggggggggggggggggg
              60       1000 hhhhhhhhhhhhhhhhhhhh
              61       1000 iiiiiiiiiiiiiiiiiiii
              62       1000 jjjjjjjjjjjjjjjjjjjj
              63       1000 kkkkkkkkkkkkkkkkkkkk
              64       1000 llllllllllllllllllll
              65       1000 mmmmmmmmmmmmmmmmmmmm
              66       1000 nnnnnnnnnnnnnnnnnnnn
    OCCURENCE_ID        LEN FIRST_20
              67       1000 oooooooooooooooooooo
              68       1000 pppppppppppppppppppp
              69       1000 qqqqqqqqqqqqqqqqqqqq
              70       1000 rrrrrrrrrrrrrrrrrrrr
              71       1000 ssssssssssssssssssss
              72       1000 tttttttttttttttttttt
              73       1000 uuuuuuuuuuuuuuuuuuuu
              74       1000 vvvvvvvvvvvvvvvvvvvv
              75       1000 wwwwwwwwwwwwwwwwwwww
              76       1000 xxxxxxxxxxxxxxxxxxxx
              77       1000 yyyyyyyyyyyyyyyyyyyy
    OCCURENCE_ID        LEN FIRST_20
              78       1000 zzzzzzzzzzzzzzzzzzzz
              79       1000 AAAAAAAAAAAAAAAAAAAA
              80       1000 BBBBBBBBBBBBBBBBBBBB
              81       1000 CCCCCCCCCCCCCCCCCCCC
              82       1000 DDDDDDDDDDDDDDDDDDDD
              83       1000 EEEEEEEEEEEEEEEEEEEE
              84       1000 FFFFFFFFFFFFFFFFFFFF
              85       1000 GGGGGGGGGGGGGGGGGGGG
              86       1000 HHHHHHHHHHHHHHHHHHHH
              87       1000 IIIIIIIIIIIIIIIIIIII
              88       1000 JJJJJJJJJJJJJJJJJJJJ
    OCCURENCE_ID        LEN FIRST_20
              89       1000 KKKKKKKKKKKKKKKKKKKK
              90       1000 LLLLLLLLLLLLLLLLLLLL
              91       1000 MMMMMMMMMMMMMMMMMMMM
              92       1000 NNNNNNNNNNNNNNNNNNNN
              93       1000 OOOOOOOOOOOOOOOOOOOO
              94       1000 PPPPPPPPPPPPPPPPPPPP
              95       1000 QQQQQQQQQQQQQQQQQQQQ
              96       1000 RRRRRRRRRRRRRRRRRRRR
              97       1000 SSSSSSSSSSSSSSSSSSSS
              98       1000 TTTTTTTTTTTTTTTTTTTT
              99       1000 UUUUUUUUUUUUUUUUUUUU
    OCCURENCE_ID        LEN FIRST_20
             100       1000 VVVVVVVVVVVVVVVVVVVV
             101       1000 WWWWWWWWWWWWWWWWWWWW
             102       1000 XXXXXXXXXXXXXXXXXXXX
             103       1000 YYYYYYYYYYYYYYYYYYYY
             104       1000 ZZZZZZZZZZZZZZZZZZZZ
    104 rows selected.
    SQL> As you can see, function works OK without DBMS_LOB on CLOB of 104103 bytes.
    SY.

  • SQL Replace function: errors if replacement text is 8191 characters

    Oracle 10.2.0.3.0 Enterprise Edition
    I'm working on an application which has a function to generate emails.
    We have a template, which gets filled with data from the database depending on the email being sent.
    To do this I'm using the Replace function to replace certain parts of the template with the right data.
    It seems that if the replacement text (the third argument to the function) is longer than 8191 bytes the function throws a PL/SQL: numeric or value error.
    This limitation doesn't appear to be documented anywhere, certainly nowhere that I can find.
    Anyone know of a way around this short of building my own replace function?

    I've figured out what was going on.
    The database column for the replacement text is defined as a clob, but there is a front end limit of 10,000 characters for the field being used.
    When using the replace function I was assigning the value to a varchar2(32767) field in the PL/SQL.
    So in terms of datatypes the function call is:
    varchar2 := replace(varchar2, varchar2, clob)
    If the length of the clob is over 8191 characters it errors.
    (Presumably because of the bug mentioned in this thread DBMS_LOB.SUBSTR() returning 8191 characters instead of 32767
    I've fixed it by simply changing the datatype of the variable to which the value is being assigned to a clob.

  • Can I use Replace function in a decode??

    Hello,
    I am trying to use replace function inside a Decode Function,
    Here is how I am doing it:
    select
    SUBSTR (
    DECODE (
    IH.DRVD_ALT_MAIL_ADDR_PRIM_FLAG,
    'N',
    REPLACE (
    ih.subs_addr_1
    || ' '
    || ih.subs_addr_2
    || ' '
    || ih.subs_city
    || ','
    || ih.subs_state_code
    || ' '
    || ih.subs_zip_code,
    'Y',
    REPLACE (
    IH.PRINT_ALT_MAIL_ADDR_LINE_1
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_2
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_3
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_4
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_5
    || ' '
    || IH.PRINT_ALT_MAIL_ADDR_LINE_6,
    ) 1,
    50
    address from x
    Can anyone please tell me what am I doing wrong here, It always gives me an error about missing a right parenthesis.
    Thanks in advance.

    Hi Jimmy,
    Looks like you are missing the first comma in the SUBSTR function
    SELECT SUBSTR (
             DECODE (
               ih.drvd_alt_mail_addr_prim_flag,
               'N', REPLACE (
                         ih.subs_addr_1
                      || ' '
                      || ih.subs_addr_2
                      || ' '
                      || ih.subs_city
                      || ','
                      || ih.subs_state_code
                      || ' '
                      || ih.subs_zip_code,
               'Y', REPLACE (
                         ih.print_alt_mail_addr_line_1
                      || ' '
                      || ih.print_alt_mail_addr_line_2
                      || ' '
                      || ih.print_alt_mail_addr_line_3
                      || ' '
                      || ih.print_alt_mail_addr_line_4
                      || ' '
                      || ih.print_alt_mail_addr_line_5
                      || ' '
                      || ih.print_alt_mail_addr_line_6,
             ), -- HERE
             1,
             50
             address
    FROM   xRegards
    Peter

  • Replace() function doesn't work in Application Designer?

    I'm using PeopleSoft Application Designer 8.51. I'm trying to do a simple Replace function so I can escape single quotes rather than allow them to blow up the sql query.
    &deptid = Replace(&deptid, "'", "''");
    App Designer chokes when I hit Save: "Invalid function parameter type. (2,19)"
    According to the docs I'm using this correctly: http://docs.oracle.com/cd/E26239_01/pt851h3/eng/psbooks/tace/book.htm?File=tace/htm/tace14.htm#H4095
    Even if I try to execute the example right out of the documentation, I get the same error: REPLACE("StringFun", "Fun", "Number");
    Is this a bug in app designer? REPLACE is a super common thing, it's not something obscure. How can this not work?
    Thanks in advance.

    I figured this out. “Replace” is a strange duck function that relies on offsets. “Substitute” is the magic I needed, works just like I was expecting Replace to work. The documentation I was reading on Replace was for “ PeopleSoft Analytic Calculation Engine” rather than peoplecode. I’ll pay closer attention to that next time. Maybe this will help someone else...

  • Replacement function modules/method for obsolete Funtion Modules in ECC 6.0

    We are working on Upgrade Project and need your help in finding the replacement Function module/ Methods for following obsolete Function Modules:
       1.   GET_FIELDTAB
       2.   WS_EXCEL
       3.  HR_DISPLAY_BASIC_LIST
       4.  LOG_SYSTEM_GET_RFC_DESTINATION
       5.  HELPSCREEN_NA_CREATE
       6. TR_RELEASE_COMM
    Thank in Advance.
    Sarita.
    Edited by: Sarita Yalamati on Mar 28, 2008 1:23 PM

    Hi sarita,
    for GET_FIELDTAB use 'DDIF_NAMETAB_GET'..here is sample code
      CALL FUNCTION 'GET_FIELDTAB'
           EXPORTING
                LANGU               = SY-LANGU
                TABNAME             = C_STRUCTURE_NAME
                WITHTEXT            = ' '
           TABLES
                FIELDTAB            = IDFIES
           EXCEPTIONS
               INTERNAL_ERROR      = 01
                NO_TEXTS_FOUND      = 02
                TABLE_HAS_NO_FIELDS = 03
                TABLE_NOT_ACTIV     = 04.
    Replacement :
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        TABNAME           =  C_STRUCTURE_NAME
      ALL_TYPES         = ' '
      LFIELDNAME        = ' '
      GROUP_NAMES       = ' '
      UCLEN             =
    IMPORTING
      X030L_WA          =
      DTELINFO_WA       =
      TTYPINFO_WA       =
      DDOBJTYPE         =
      DFIES_WA          =
      LINES_DESCR       =
    TABLES
      X031L_TAB         =
       DFIES_TAB         = IDFIES
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    For WS_EXCEL  use GUI_DOWNLOAD.. here is sample code
    CALL FUNCTION 'WS_EXCEL'
    EXPORTING
       FILENAME            = 'D:\FILE1.xls'
      SYNCHRON            = ' '
      TABLES
        DATA                = itab
    EXCEPTIONS
       UNKNOWN_ERROR       = 1
       OTHERS              = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Repalcement :
    data : l_filename type string.
    l_filename  = 'D:\FILE1.xls'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = l_filename
      FILETYPE                        = 'ASC'
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
      EXPORTING
        DOCUMENT               = 'D:\FILE1.xls'
       APPLICATION            =
       PARAMETER              =
       DEFAULT_DIRECTORY      =
       MAXIMIZED              =
       MINIMIZED              =
       SYNCHRONOUS            =
        OPERATION              = 'OPEN'
      EXCEPTIONS
        CNTL_ERROR             = 1
        ERROR_NO_GUI           = 2
        BAD_PARAMETER          = 3
        FILE_NOT_FOUND         = 4
        PATH_NOT_FOUND         = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED   = 7
        SYNCHRONOUS_FAILED     = 8
        NOT_SUPPORTED_BY_GUI   = 9
        others                 = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Bulk Replacements using Replace function in oracle 8i

    Hi All,
    Iam using oracle 8i version and i need to use Replace function for bulf replacements i mean i need to replace around 250 rows. So please anyone suggest me how to proceed
    on this request as iam using oracle 8i version.
    Thanks!
    Srini

    Write one update statement.
    The where condition is the filter what rows need to be touched.
    The SET condition will do the data change. For example it could use the REPLACE function if that is what it is needed.
    One single update statement over 20 rows would mean the task is done in BULK. 20 single updates that each handle one row would mean it is row by row = slow by slow processing.

  • SQL replace function in JDeveloper

    In SQL*Plus I run the following queries...
    select last_name, phone_number from employees
    LAST_NAME PHONE_NUMBER
    Chung 650.505.1876
    Dilly 650.505.2876
    Gates 916.764.6600
    select last_name, replace (phone_number, '.', '-') from employees
    LAST_NAME REPLACE(PHONE_NUMBER
    Chung 650-505-1876
    Dilly 650-505-2876
    Gates 916-764-6600
    If I try to use the "REPLACE" function in the JDeveloper by editing the sql statement in the view object editor and run the page the results returned for the phone number column on the page are blank.
    How can I substitute a dash for the period on the page?

    Try using AS:
    select last_name, replace (phone_number, '.', '-') AS phone_number from employees
    In this case is recommended for your VO a read only query.

  • Replace Function in Cold Fusion

    Hello All,
    The code below does the following: It finds an item in Spanish (in this case it's GetBasket.options, 2) and add `SPA` to the SKU code.
    <cfif ListContains(GetBasket.options, 2)><option value="2"><cfset basketsku = GetBasket.SKU & "SPA"></option></cfif>
    How do I do the following?
    The SKU code is a 5 digit code for all languages. For example: the SKU code in English is 902013, but the SKU code for Spanish is 903013. As you can see the 3rd number is being replaced with 3. It will be standard for all items in Spanish. How do I modify the code above to replace the 3rd number with 3?
    Thank you all very much in advance!

    not sure if you found an answer to this question but if you use the Replace function you can do this.
    Replace(DB.value, 2, 3 )

  • Replace function in TT7

    Hi,
    I have a database in TT Release 7.0.3.1.0 and other in Release 11.2.2.4.0. I need use replace sql function over Release 7.0.3.1.0.
    I know that it not apply in this version but I've tried with ttIsqlCS in node with TT11 through connection in database TT7 but I received this error:
    ttIsqlCS database_test_R7
    Command> select replace('asjkhdfkhaskdh','a','1') from dual;
    2818: Unknown function REPLACE
    The command failed.
    Command> version;
    TimesTen Release 11.2.2.4.0
    Any idea ??
    Thanks in advance.
    Babs.

    Hi Babs,
    I am afraid that you are out of luck. SQL is implemented in the TimesTen engine/libraries not in the ttIsql client. Since 7.0 SQL does not have th REPLACE() function there is no way to execute that in 7.0 regardless of the client you use. You'll need to find some other option to accomplish what you require (maybe upgrade the 7.0 database to 11.2.2?).
    Chris

  • Replace function in JDeveloper 3.2

    Hi JDev Team:
    Are there any global replace functions in JDev 3.2, for instance I have one word, say 'aaaa', in all of my projct files, .jsp, .java, .... I like to replace with 'bbbb'.
    Thanks

    The JDeveloper Editor provides Search & Replace functionality for files.
    What I typically do is
    Select menu: Search | Search Source Path...
    Enter Search String and Change Source path
    and other fields and press Start
    Then the Navigator displays a Search tab which lists all files with the matching string.
    Double click on first file in navigator and
    select menu Search | Replace
    In this dialog enter your search, replace, and other options-
    In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
    Select the Scope of Global
    Selectg the Origin of Entire
    When you are ready press the Multiple button to make multiple replacements.
    When you are done with this file,
    Press Ctrl-S to Save the file
    Press Ctrl-F4 to close the window
    Double click on the Next File
    Press Ctrl-R to invoke the Search | Replace dialog.
    You should not need to change any options.
    Press Alt-M to select the Multiple Button!
    While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
    Besides, you may learn a few JDeveloper tricks.
    Good Luck,
    -John

  • REPLACE function in PSP for formatting

    Hi everyone,
    <p>I am coding PL/SQL server pages at the moment and am trying to produce an onscreen report.
    <br>I was just wondering if it is possible to use the REPLACE function to replace a part of a string with the same thing but in bold?
    for example, I have tried:
    <p>
    htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'<b>TEST</b>'||')'||'</TD>'); <p>but it isn't working. I just wanted to check it was possible and if so, where am I going wrong??
    <p>
    Thanks in advance!

    This will work:
    htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'&lt;b&gt;TEST&lt;/b&gt;'||')'||'</TD>');I also suggest generating your table HTML using the htp.table... procedures.

Maybe you are looking for

  • No depreciation areas have been defined for asset 10001-2

    Hi, While creating Goods Receipt(MIGO) the following error is showing "No depreciation areas have been defined for asset 10001-2" Could u plz, suggest me what i have to do. Thanks in Advance, Sudheer.

  • Character Viewer fails to launch

    Character Viewer never launches with the first click on the menu bar. It launches only with the second attempt but even then it takes more time than expected for such an app. Sometimes it also launches (always second click) on the background. OS Bug?

  • Site not visible in IE8

    This is the 4th site I've done in DW and for some reason it's not visible in IE8. Looks fine in FireFox. www.giselleaguiar.com I changed the meta tag to: meta http-equiv="X-UA-Compatible" content="IE=7;FF=3;OtherUA=4" /> and still nothing. What am I

  • While updating infotype i was throughen with an error

    Hi Experts, while I am updating the infotype 0170 with the hr_infotype_operation. i was given an error stating 'EPG                  009No data stored for 0170 in the selected period'.  How to resolve this. Please help me. My code is as follows ls_01

  • I can not syn whit Ical after the update now De server reageerde met 'HTTP/1.1 409 Conflict'

    I have problems with iCal sync after the update, reporting gebruikesnaam orpassword are not good while I wait for this place and use mobileme name will becoming, I now get the message The server responded with "HTTP/1.1 409 Conflict" what should I do