写一个Oracle的存储过程 
从A表查询数据  到B表的 

解决方案 »

  1.   

    类似于如下
    insert into A 
    select *
    from B
    就可以,不用存储过程,除非有特别复杂的逻辑处理
      

  2.   

    我的 A表里有 name,sex,age字段,B表里有name,sex,address 怎么 限定列去插入啊
      

  3.   

    我的 A表里有 name,sex,age字段,B表里有name,sex,address 怎么 限定列去插入啊
    -- 将B表 name ,sex 列插入至A表中INSERT INTO A(NAME,SEX)
    SELECT NAME,SEX 
    FROM BA 表与B表 的列类型与宽度最好是一致的。
      

  4.   

    从A表查询数据,插入B表,
    insert into b(b表字段名1,b表字段名2) select a表字段名1,a表字段名2 from a;
    b后面的字段个数应与select后字段个数应相同,类型最好对应(虽然oracle可以执行一些隐式数据类型转换)
      

  5.   


    用oracle的存储过程怎么写啊?
      

  6.   

    create or replace procedure p1
    as
    v1 A.name%type;
    v2 A.sex$type;
    cursor cur1 is select name,sex from A;
    begin
    for cur1_rec in cur1 loop
    v1:=cur1_rec.name;
    v2:=cyr1_rec.sex;
    insert into b(name,sex) values(v1,v2);
    commit;
    end loop;
    end;
      

  7.   


    --看这样可以不,是不是你的意思
    merge into b using a on(a.name=b.name)
    when not matched then
    insert b(b.name,b.sex) values(a.name,a.sex) 
      

  8.   

    这个好像是sql的标准吧,和oracle没有任何关系
      

  9.   

    不要把简单问题复杂化。能够一句sql绝不用2句。