create or replace function u_power.p_ceil(n NUMBER) return NUMBER
 as
 begin
 return ceil(n);
 end p_ceil;
 
create or replace function u_power.P_EMPTY_BLOB return blob
AS
BEGIN
RETURN EMPTY_BLOB;
end P_EMPTY_BLOB;


DROP FUNCTION P_F_OA_GETJLD


GRANT 


create or replace function u_power.P_F_OA_GETJLD(param_rcbh in varchar2)
return varchar2
is
var_jld varchar2(500) := '';
cursor cur_process(var_rcbh varchar2)
is
  select  (B.Yhmc),max(B.PXH) from  u_ebcmks.t_oa_rcfbcxry A
  left join u_ebcmks.v_admin_rms_yhbmgx B ON A.YHBH = B.Yhid
  where A.RCBH = var_rcbh
  group by B.Yhmc
  order by max(B.PXH) ASC;
begin
   for blr in cur_process(param_rcbh) loop
      if var_jld is null  then
         var_jld := blr.Yhmc;
      else
         var_jld := var_jld || ', '||blr.Yhmc;
      end if;
   end loop;
   if cur_process%isopen then
      close cur_process;
   end if;
   return var_jld;
end P_F_OA_GETJLD;


grant all on v_admin_rms_yhbmgx to u_power


create or replace function u_power.p_instr(STR1 VARCHAR2 CHARACTER SET ANY_CS,
                 STR2 VARCHAR2 CHARACTER SET STR1%CHARSET,
                 POS PLS_INTEGER := 1,
                 NTH POSITIVE := 1) return PLS_INTEGER 
 as
 begin
 return instr(STR1,STR2,POS,NTH);
 end p_instr;
 
create or replace function u_power.p_length(ch VARCHAR2 CHARACTER SET ANY_CS) return natural
 as 
 begin
 return length(ch);
 end p_length;
 
create or replace function u_power.p_nvl(s1 VARCHAR2 CHARACTER SET ANY_CS,
               s2 VARCHAR2 CHARACTER SET s1%CHARSET)
        return VARCHAR2 CHARACTER SET s1%CHARSET  as
BEGIN
   return nvl(s1,s2);
END p_nvl;


create or replace function u_power.p_nvl2(s1  VARCHAR2 ,
               s2  VARCHAR2 CHARACTER SET s1%CHARSET ,s3  VARCHAR2 CHARACTER SET s1%CHARSET )
        return VARCHAR2 CHARACTER SET s1%CHARSET   as
BEGIN
   return (CASE WHEN s1 IS NOT NULL THEN s2 ELSE s3 END);
END p_nvl2;


create or replace function u_power.p_substr(STR1 VARCHAR2 CHARACTER SET ANY_CS,
                  POS PLS_INTEGER,
                  LEN PLS_INTEGER := 2147483647)
        return VARCHAR2 CHARACTER SET STR1%CHARSET 
    as
    begin
    return substr(STR1,POS,LEN);
    end p_substr;


create or replace function u_power.p_to_char (LEFT DATE, RIGHT VARCHAR2) return VARCHAR2
as
begin
return to_char(LEFT,RIGHT);
end   p_to_char;


create or replace function u_power.p_to_date (LEFT VARCHAR2 character set any_cs,
       RIGHT VARCHAR2 character set LEFT%charset) return DATE
as
begin
return to_date(LEFT,RIGHT); 
end  p_to_date;


CREATE OR REPLACE FUNCTION u_power.p_userdatediff( D1 date,D2 date)
RETURN NUMBER 
AS  
BEGIN 
    return  (D1-D2);
END p_userdatediff;
作者:星辰 时间:2017-02-19 浏览 735评论 0 赞 0砸 0 标签: oracle
评论
还可以再输入500个字

请您注意

·自觉遵守:爱国、守法、自律、真实、文明的原则
·尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法规
·严禁发表危害国家安全,破坏民族团结、国家宗教政策和社会稳定,含侮辱、诽谤、教唆、淫秽等内容的作品
·承担一切因您的行为而直接或间接导致的民事或刑事法律责任
·您在NoteShare上发表的作品,NoteShare有权在网站内保留、转载、引用或者删除
·参与本评论即表明您已经阅读并接受上述条款