创建包:
create or replace package p_view_param is
function set_param(num number) return number;
function get_param return number;
end p_view_param;
实现包体:
create or replace package body p_view_param is
paramValue number;
function set_param(num number) return number is
begin
paramValue:=num;
return num;
end;
function get_param return number is
begin
return paramValue;
end;
end p_view_param;
创建视图:
create or replace view v_wms_inventory as
select MATERIAL_NO from [email protected]_DB WHERE quantity=p_view_param.get_param()
查询SQL:
select * from v_wms_inventory where p_view_param.set_param(3050)=3050;
时间: 2024-10-07 01:42:09