用临时表吧,这样就写个PL/SQL块往里插入就行了

解决方案 »

  1.   

    小弟能用C#写,但客户非要用数据的PL/SQL写,小弟很是痛苦啊!!!不会啊!!哪位大侠指点一下啊!!谢谢!
      

  2.   

    declare 
     cursor amount is select amount from  main_temp;
     amou number;
     i number:=0;
     begin 
     open amount;
     FETCH amount into amou;
     while i<amou loop 
     insert into main_pas_20061 select * from main_temp ;
     i:=i+1;
     end loop;
     close amount;
     end;数据在main_temp中,我建立一个临时表main_pas_20061
    但写的不对,哪位大侠帮忙给看一下!!谢谢!!!!跪求了!!!!苦啊!
      

  3.   

    create procedure test is 
    begin
      for p in (select * from main_temp) loop
        while p.amount>0 loop
          insert into main_pas_20061(amount,people,class) values(1,p.people,p.class);
        end loop;
      end loop;
      commit;
    end test;
      

  4.   

    select 1 amount, t.people ,t.class
    from t, (select rownum r all_objects where rownum<=55)n --??
    where n.r<=t.amount;select 1 amount, t.people ,t.class
    from t, (select rownum r all_objects where rownum<=(select max(amount) from t) )n 
    where n.r<=t.amount;