create or replace procedure haha(in_deptno in number,in_order in varchar2) is
v_sql varchar2(1000):='select ename from emp where deptno='||in_deptno||'order by'||in_order;
out_info pack1.my_cursor;
v_ename emp.ename%type;begin
  open out_info for v_sql;
  loop
    fetch out_info into v_ename;
    exit when out_info%notfound;
    dbms_output.put_line(v_ename);
  end loop;
  close out_info;
end;
(书写一个过程,输入部门编号(in_deptno),和排列方式(in_order),输出此部门员工的姓名) emp表:雇员表,dept 雇员表    pack1.my_cursor 是pack包里面已经定义好的一个游标
能建立过程,但是一旦调用就会报错:SQL> exec haha(10,'empno');
 
begin haha(10,'empno'); end;
 
ORA-00924: 缺失 BY 关键字
ORA-06512: 在 "SCOTT.HAHA", line 7
ORA-06512: 在 line 2
看了半天,初学实在不知道哪里错,求解!!谢谢!!