可以把大于4000的值直接赋值给CLOB变量么?

解决方案 »

  1.   

    楼上的可以说清楚些吗?我的问题是怎么把大于4000的值传给CLOB变量?
      

  2.   

    你分几个varchar2拼接一下? to_clob(v_var1 || v_var2 || v_var3)
      

  3.   

    那变量要用CLOB类型的?最后得到整个字符串后,用UPDATE就可以了吗?
      

  4.   

    你表列的类型的clob吧?to_clob就是把字符串等类型 转化成clob的,这样你不是就能更新了么
      

  5.   

    ----把所有的汇总字段整成一条记录,用逗号隔开,且更新至项目明细表中str:='insert into xmmx_temp1(select pro_code,wmsys.wm_concat(Pmc_OtherMeans)as Pmc_OtherMeans,wmsys.wm_concat(Pmc_Progress) as Pmc_Progress, wmsys.wm_concat(Pmc_MainGain) as Pmc_MainGain,
    wmsys.wm_concat(Pmc_ProblemSuggest) as Pmc_ProblemSuggest, wmsys.wm_concat(Pmc_Participant) as Pmc_Participant, wmsys.wm_concat(Pmc_Equipment) as Pmc_Equipment,
    wmsys.wm_concat(Pmc_Re) as Pmc_Re from xmmx_temp group by pro_code)';
    execute immediate str;
    str:='update Projectxmmx_temp a set a.Pmc_OtherMeans=(select b.Pmc_OtherMeans from xmmx_temp1 b where a.pro_code=b.pro_code),a.Pmc_Progress=(select b.Pmc_Progress from xmmx_temp1 b where a.pro_code=b.pro_code),
    a.Pmc_MainGain=(select b.Pmc_MainGain from xmmx_temp1 b where a.pro_code=b.pro_code),a.Pmc_ProblemSuggest=(select b.Pmc_ProblemSuggest from xmmx_temp1 b where a.pro_code=b.pro_code),
    a.Pmc_Participant=(select b.Pmc_Participant from xmmx_temp1 b where a.pro_code=b.pro_code),a.Pmc_Equipment=(select b.Pmc_Equipment from xmmx_temp1 b where a.pro_code=b.pro_code),
    a.Pmc_Re=(select b.Pmc_Re from xmmx_temp1 b where a.pro_code=b.pro_code)';
    execute immediate str;
      

  6.   

    你这个wm_concat 函数在10g中是返回字符串类型的,那你把汇总的to_clob一下不就行了么,11g就是直接返回clob类型了
      

  7.   

    是的  listagg wm_concat等确实是这样  那要么你就自定义行转列函数返回类型为clob,多定义几个varchar2类型的,以便to_clob(变量1||变量2||变量3)
      

  8.   


    10.2.0.5开始就是clob额 确实 - -