table a:      col b:
             12345,23456,....如何匹配23456并删除字段中的“23456,”
谢谢!

解决方案 »

  1.   

    update a set b = replace(b, '23456,', '') where instr(b, '23456,')>0
      

  2.   


    这是clob字段,这样可以吗?
      

  3.   

    update a set b = replace(b, '23456,', '') where instr(b, '23456,',1,1)>0
      

  4.   


    DBMS_LOB包里有instr,但是没有replace,如果要repace需要自己写。
      

  5.   

    -- Create table
    create table A
    (
      B CLOB
    );
    insert into a values('12345,23456,.... ');
    commit;
    select * from a where instr(b, '23456,')>0;
    update a set b = replace(b, '23456,', '') where instr(b, '23456,')>0
      

  6.   

    试过了,update不起作用,呵呵!
      

  7.   

    如果10G 可以考虑用正则表达式!REG_LIKE!
      

  8.   

    这样行不行?update a set b =substr(b,0,instr(b, '23456,'))||substr(b,6+instr(b, '23456,'))
    where instr(b, '23456,')>0