函数的纯度级别以及使用
- 定义由函数读取或修改的数据种类。
各种纯度级别
- WNDS --- 不写入数据库状态。
- RNDS --- 不读取数据库状态。
- WNPS --- 不写入程序包状态。
- RNPS --- 不读取程序包状态。
创建程序包是使用:
eg:
create or replace package myPack
is
procedure UpdateTable(s int);
pragma restrice_references(updatetable,WNDS);---执行编译指令表示过程UpdateTable,是不能写入数据库的。
end;
create or replace package body myPack
is
procedure UpdateTable(s int) is
begin
update test set a=s;
end;
end;
- 定义由函数读取或修改的数据种类。
各种纯度级别
- WNDS --- 不写入数据库状态。
- RNDS --- 不读取数据库状态。
- WNPS --- 不写入程序包状态。
- RNPS --- 不读取程序包状态。
创建程序包是使用:
eg:
create or replace package myPack
is
procedure UpdateTable(s int);
pragma restrice_references(updatetable,WNDS);---执行编译指令表示过程UpdateTable,是不能写入数据库的。
end;
create or replace package body myPack
is
procedure UpdateTable(s int) is
begin
update test set a=s;
end;
end;