从a数据库的i表,倒数据到b数据库j表,那个语句怎么写的

解决方案 »

  1.   

    建立DBLINK,然后INSERT INTO J VALUES(SELECT * FROM A);
    或者使用PL/SQL将数据导出到Excel,然后直接从Excel里面复制粘贴到J表就可以了
      

  2.   

    sqlplus的copy命令可以用来在两个数据库之间更新数据
    SQL> help copy
     COPY
     ----
     Copies data from a query to a table in the same or another
     database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
     COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
     where database has the following syntax:
         username[/password]@connect_identifier
    SQL> drop table t1;
    表已删除。
    SQL> drop table t2;
    表已删除。
    SQL> create table t1 as select * from all_objects where rownum<10;
    表已创建。
    SQL> select count(*) from t1;
      COUNT(*)
    ----------
             9
    SQL> copy from scott/oracle@ora11 to scott/oracle@ora11 create t2
              using select * from t1 where rownum<5;
    数组提取/绑定大小为 15。(数组大小为 15)
    将在完成时提交。(提交的副本为 0)
    最大 long 大小为 5000。(long 为 5000)
    表 T2 已创建。
    4 行选自 scott@ora11。
       4 行已插入 T2。
       4 行已提交至 T2 (位于 scott@ora11)。
    SQL> select count(*) from t2;
      COUNT(*)
    ----------
             4
    SQL>