如何使用plsql中的过程返回记录表
我写的程序如下如何使用plsql中的过程返回记录表,plsql,Plsql,我写的程序如下 create or replace procedure my_proc(limit_value in number,.........) is cursor................... ......................... begin open ...; loop ..... ..... close ....; end my_p
create or replace procedure my_proc(limit_value in number,.........)
is
cursor...................
.........................
begin
open ...;
loop
.....
.....
close ....;
end my_proc;
我想生成工资低于限制值的报告
是否可以获取不带OUT参数的表记录以生成报告
如果可能,请解释是的,你可以。您甚至可以使用过程/函数的返回值执行此操作:
create or replace type salary_rec as object (
emp_id number
salary number
);
create or replace type t_salary as table of salary_rec;
create or replace function retrieve_emp(
i_max_salary number
) return t_varchar_number
as
result t_salary;
begin
select salary_rec(emp_id, salary) bulk collect into result
from emp_salary
where salary <= i_max_salary;
return ret;
end;
/
这只是Oralce和PL/SQL中批量收集和不同表类型的众多变体之一