这是一个非常简单的问题.
我试图从存储过程返回一个表,如
select * from emp where id=@id
Run Code Online (Sandbox Code Playgroud)
我想将此查询结果作为表返回.我必须通过存储过程来完成此操作.
Oracle存储过程具有OUT参数并返回结果集,例如
create or replace procedure foo(empId IN NUMBER, maxSalary OUT NUMBER) AS BEGIN
select * from Employee e where e.id >=empId;
select max(salary) into maxSalary from Employee;
END;
Run Code Online (Sandbox Code Playgroud)
错误:
PLS-00428: an INTO clause is expected in this SELECT statement
Run Code Online (Sandbox Code Playgroud)
Mysql存储过程可以返回结果集和输出参数.如何为oracle db做到这一点?