Home > Database > Mysql Tutorial > 加密oracle数据库存储过程或函数

加密oracle数据库存储过程或函数

WBOY
Release: 2016-06-07 14:58:03
Original
1110 people have browsed it

无详细内容 无 create or replace procedure proc_encrypt_procOrFun(obj_name in varchar2, out_text out varchar2) as --===================================================== --功能:加密存储过程或函数 --参数:obj_name 要加密的过程或函数 -- out_t

create or replace procedure proc_encrypt_procOrFun(obj_name in varchar2, out_text out varchar2) as
  --=====================================================
  --功能:加密存储过程或函数
  --参数:obj_name 要加密的过程或函数
  --      out_text 加密后的密文
  --=====================================================
  v_text varchar2(32767) default 'create or replace ';
begin
  for c in (select text from user_source t where name=upper(obj_name)) loop
    v_text := v_text||c.text;
  end loop;
  v_text := dbms_ddl.wrap(v_text);
  out_text := v_text;
  --execute immediate v_text;
  --dbms_output.put_line(v_text);
exception 
  when others then
    dbms_output.put_line(sqlerrm);
end proc_encrypt_procOrFun;

create or replace function fun_encrypt_procOrFun(obj_name varchar2) 
  return varchar2 as
  --=====================================================
  --功能:加密存储过程或函数
  --参数:obj_name 要加密的过程或函数
  --=====================================================
  v_text varchar2(32767) default 'create or replace ';
begin
  for c in (select text from user_source t where name=upper(obj_name)) loop
    v_text := v_text||c.text;
  end loop;
  v_text := dbms_ddl.wrap(v_text);
  --execute immediate v_text;
  --dbms_output.put_line(v_text);
  return (v_text);
exception 
  when others then
    dbms_output.put_line(sqlerrm);
    return (sqlerrm);
end fun_encrypt_procOrFun;
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template