函数如下:
create or replace function Xgyh
(pvc2Czy in varchar2,
pnumYhid in number,
pvc2Lfid in varchar2,
pvc2Grzid in varchar2,
pvc2Zbmid in varchar2,
pvc2Bmid in varchar2)
return number is
intZxbz integer:=1;--返回值(1:正确,0:错误);
numDxlb number;
numGx number;
begin
--判断指定用户是否合法
if pvc2Czy is null then
intZxbz:=0;
end if;
if pnumYhid is not null then
if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Lfid is not null then
if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Grzid is not null then
if pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Zbmid is not null then
if pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Bmid is null then
intZxbz:=0;
end if;
--取当前登陆操作员在数据权限表中权限并判断是否允许更新当前用户
if intZxbz=1 then
select t.更新,
decode(t.对象类别,'用户',0,'楼房',1,'供热站',2,'子部门',3,'部门',4,'集团',5)
into numGx,numDxlb
from 系统_数据权限_表 t
where t.用户=pvc2Czy
and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))
and rownum=1
order by 2,1;
end if;
--返回信息
return(numGx);
end Xgyh;半天也执行不完,若删除and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))这个条件可以迅速创建。但这个SQL语句可以在Plsql/plus或Pl/sql developer的SQL窗口中执行。求教解决办法。跪谢!
create or replace function Xgyh
(pvc2Czy in varchar2,
pnumYhid in number,
pvc2Lfid in varchar2,
pvc2Grzid in varchar2,
pvc2Zbmid in varchar2,
pvc2Bmid in varchar2)
return number is
intZxbz integer:=1;--返回值(1:正确,0:错误);
numDxlb number;
numGx number;
begin
--判断指定用户是否合法
if pvc2Czy is null then
intZxbz:=0;
end if;
if pnumYhid is not null then
if pvc2Lfid+pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Lfid is not null then
if pvc2Grzid+pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Grzid is not null then
if pvc2Zbmid+pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Zbmid is not null then
if pvc2Bmid is null then
intZxbz:=0;
end if;
elsif pvc2Bmid is null then
intZxbz:=0;
end if;
--取当前登陆操作员在数据权限表中权限并判断是否允许更新当前用户
if intZxbz=1 then
select t.更新,
decode(t.对象类别,'用户',0,'楼房',1,'供热站',2,'子部门',3,'部门',4,'集团',5)
into numGx,numDxlb
from 系统_数据权限_表 t
where t.用户=pvc2Czy
and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))
and rownum=1
order by 2,1;
end if;
--返回信息
return(numGx);
end Xgyh;半天也执行不完,若删除and (t.对象类别,t.对象识别码) in
(('集团',0),('部门',pvc2Bmid),('子部门',pvc2Zbmid),('供热站',pvc2Grzid),('楼房',pvc2Lfid),('用户',pnumYhid))这个条件可以迅速创建。但这个SQL语句可以在Plsql/plus或Pl/sql developer的SQL窗口中执行。求教解决办法。跪谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货