procedure:……………………
count_a number;
count_b number;
begin:
     select count(*) into count_a from A;
     select count(*) into count_b from B;
  if   count_a>count_b then
      (………………);       else if count_a=count_b then
      (………………);
       
       else if count_a<count_b then
      (………………);
  end if;
end;中间的判断在=的时候可以再嵌套进判断语句

解决方案 »

  1.   

    create or replace procedure pro_goods as
    cursor c_Agoods is select * from A;
    cursor c_Bgoods is select * from B;
    c_A A%rowtype;
    c_B B%rowtype;
    begin
    open c_Agoods;
    open c_Agoods;
    loop
    fetch c_Agoods into c_A;
    exit when c_Agood%notfound;
    fetch c_Bgoods into c_B;
    exit when c_Bgood%notfound;
    if c_A.piece>c_B.piece then
    begin
    A;
    end;
    elsif c_A.piece<=c_B.piece then
    begin
    B;
    end;
    else 
    ..........
    end loop;
    close c_Agoods;
    close c_Agoods;
    end;
      

  2.   

    to: wylwyl1130(落雪山林)
    我想请教一下,
    表A与表B是通过货物编号关联起来的,如果
    cursor c_Agoods is select * from A;
    cursor c_Bgoods is select * from B;
    然后就直接比较件数重量的话,怎么保证二者是同一货物编号的比较呢?