怎样将大数据量(100k)插入long类型字段中。
望赐教。

解决方案 »

  1.   

    不知楼主存储的是什么内容,long类型的字段应该可以存2G字节
      

  2.   

    直接insert into table (col) values ('....')不可以吗
      

  3.   

    直接insert into table (col) values ('....')不可以吗可以我就不用跑这来了
      

  4.   

    long类型是支持那个语法的,如果是动态添加的话,可以先插入其它字段信息,用游标逐条更新long字段
    例子:转自itpub
    sql>; create table testlong (id number,name varchar2(12),history long);表已创建。sql>; create table testlong1 (id number,name varchar2(12),history long);表已创建。sql>; insert into testlong values(1,’dwh’,’work in foshan’);已创建 1 行。
    sql>; insert into testlong values(2,’sfg’,’work in guangzhou’);已创建 1 行。
    sql>; select * from testlong;id           name                 history
    ---------- -------------     -------------------------------------------------------
    1              dwh           work in foshan
    2              sfg           work in guangzhousql>; insert into testlong1 select * from testlong;
    insert into testlong1 select * from testlong
    *
    error 位于第 1 行:
    ora-00997: 非法使用 long 数据类型
    sql>; declare
    2 cursor bcur
    3 is select id,history from testlong;
    4 brec bcur%rowtype;
    5 begin
    6 insert into testlong1(id,name) select id,name from testlong;--其它类型
    先插入
    7 open bcur;
    8 loop
    9 fetch bcur into brec;
    10 exit when bcur%notfound;
    11 update testlong1 set history=brec.history where id=brec.id;
    12 end loop;
    13 close bcur;
    14 end;
    15 /pl/sql 过程已成功完成。sql>; select * from testlong1;id              name                       history
    ----------    --------------        ----------------------------------------------1                 dwh                work in foshan
    2                 sfg                 work in guangzhou