搜索墙首页  编程技术  java  asp  ajax  php  c/c#/c++  数据库  oracle  mysql  db2  操作系统  windows  linux  股吧
首页 > 编程 > 数据库 > oracle
 1         
1楼  yang_lizhi 2007-03-09 17:27:32

函数如下:
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窗口中执行。求教解决办法。跪谢!
2楼  yang_lizhi 2007-03-11 09:25:42

晕,不请各位高手帮忙啊。
 1         
您的发言将按有关规定都会存档,您须为所发表后果负责,请您遵纪守法并注意语言文明。
标题:无法创建存贮函数
热门关注
标题回复点击
Oracle 10g (ASM):Sample Implementation0816
Oracle 正版用户授权0781
动态性能视图(Dynamic perfermance view V$)0770
EM 无法启动&&重新完全配置EM0637
OracleDBConsole 服务因 2 (0x2) 服务性错误而停止。请问一下如何解决!2466
小布老师Oracle 9i DBA Fundamentals II0408
ORA-1652: unable to extend temp segment诊断以及解决0391
Oracle Linux 和 iSCSI 上构建您自己的 Oracle RAC集群10381
locate pl/sql bottleneck0346
缓冲处理器 buffer handle0341
搜索墙@2009 www.pkwall.com all rights reserved QQ:276471788 [京ICP备09111534号]
声明:本站部分数据来源于网络,仅供参考,如有版权问题,请联系我们,我们将及时删除!转载本站请注明来源