我想建个名为 student_grade 的过程,其中包括以下内容:
select xs.xh,xs.xm,kc.kcm,xs_kc.kc
where xs.xh=xs_kc.xh and xs_kc.kch=kc.kch;
我创建的时间总出错,请帮我写条完整可正确执行的语句,谢谢!

解决方案 »

  1.   

    把FROM xs,xs_kc,kc 加上,落下了
      

  2.   

    ORACLE 的存储过程,不支持返回结果集的,一看楼主以前就是用SQL SERVER的
      

  3.   

    create or replace package student
     as
      type stu_cur is ref cursor;
      procedure student_grade(cur out stu_cur);
     end;
    /
    create or replace package body student
    as
     procedure student_grade(cur out stu_cur)
    as
    begin
     open cur for select xs.xh,xs.xm,kc.kcm,xs_kc.kc FROM xs,xs_kc,kc 
    where xs.xh=xs_kc.xh and xs_kc.kch=kc.kch;
    end;
    end;
    /