create or replace procedure test(var in INTEGER) is
begin
  select * from scott.emp where EMPNO=:var;
end test;提示:有编译错误?索引中缺少in或out参数?

解决方案 »

  1.   

    ORACLE存储过程中不能用select ... from scott.emp 之类的查询语句,要得到结果集要使用游标,这一点跟MS SQL大不一样,要注意
      

  2.   

    哈哈,傻傻猫,自家人呢,多谢提醒,谁能给出具体的写法。我只是想用c#调用自己编的oracle存储过程类,就想有个返回结果集就行。没学过oracle的存储过程写法阿
      

  3.   

    create or replace function test(var in INTEGER) RETURN VARCHAR2
    is
      str SCOTT.EMP.ENAME%TYPE;
    begin
      select ENAME INTO str from scott.emp where EMPNO=var;
      RETURN str;
    end test;
    /