时间:2021-07-01 10:21:17 帮助过:3人阅读
create or replace type ty_table as table of ty_row;
2.接着定义一个函数,用于获取用户基本信息:
create or replace function f_get_user_info(v_user_id in varchar2 default null)
return ty_table as
v_user_list ty_table;
begin
select ty_row(t.user_id, nvl(t.emp_name, t.user_name), t.user_name) bulk collect
into v_user_list
from t_bs_user t
where t.user_id = v_user_id
or v_user_id is null;
return v_user_list;
end f_get_user_info;
3.使用就很简单了:
select * from table(f_get_user_info(‘1‘))
Oracle中Table函数简单应用实例
标签:blog 定义 rac oracle row user sel varchar acl