记得db2中有load into  select ... from 之类的语句。
oracle中的load可有类似的用法?
我知道从文件load的方法,不知道可有load into  select ... from 之类的语句?

解决方案 »

  1.   

    insert into  from  select * from ???
      

  2.   


    SQL> select * from dept;DEPTNO DNAME          LOC
    ------ -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTONSQL> desc dept;
    Name   Type         Nullable Default Comments 
    ------ ------------ -------- ------- -------- 
    DEPTNO NUMBER(2)                              
    DNAME  VARCHAR2(14) Y                         
    LOC    VARCHAR2(13) YSQL> create table t_dept(
      2         deptno number(2),
      3         dname varchar2(14),
      4         loc varchar2(13)
      5         );Table createdSQL> insert into t_dept(deptno,dname,loc)
      2  select deptno,dname,loc from dept;4 rows insertedSQL> select * from t_dept;DEPTNO DNAME          LOC
    ------ -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
      

  3.   


    SQL> create table t_dept as
      2  select * from dept;Table createdSQL> select * from t_dept;
    /*
    DEPTNO DNAME          LOC
    ------ -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
    */
      

  4.   

    oracle中貌似没有LOAD INTO.... SELECT...的方式
      

  5.   

    用create table tablename1 as select fieldname1,...feildnamen from tablename
      

  6.   

    楼主说的是 sqlload ctl文件?LOAD DATA
    INFILE '*'
    BADFILE './*.bad'
    INTO TABLE a
      

  7.   

    呵呵,谢谢你们;insert into 这个基本的我肯定知道了
    ctl文件我也知道,我就是问问oracle里面可有load之类的用法。因为数据量很大用insert into慢
      

  8.   

    alter table tb nologginginsert /*+ append*/ into tb select * from ....alter table tb logging
      

  9.   

    我查了下, 好像oracle里面没有这种用法,谢谢你们参与啊。