else
      declare cursor  cursor1  is
       where cid=p_cid;
这句有问题吧

解决方案 »

  1.   

    for p in (select id,fid,name from table1 where cid=p_cid) loop
      for q in(select tid,tname from table2 where fid=p.fid) loop
        ...
      end loop
    end loop;
      

  2.   

    谢谢realx(iambird) ,能不能具体点..
      

  3.   

    是不是这样:
    for p in (select id,fid,name from table1 where cid=p_cid) loop
      for q in(select tid,tname from table2 where fid=p.fid) loop
         insert into table3(tname)values(q.tname);
      end loop
    end loop;
    就可以了
      

  4.   

    是这样用的,p,q自己随便定义好了,用a,b也行
      

  5.   

    顺便问一下:select table1.f1,table2.f2 from table1 left join table2 on table1.id=table2.id,出现这样的错误:
    出现符号 "JOIN"在需要下列之一时:  , ; for group having    intersect minus order start union where connect
      

  6.   

    这个语句在sqlplus是可以的,但在存储过程中却不行