ORACLE程序包
程序包
包主体/规范名字一样
包主体/规范中的对应参数必须类型及名字一样
只能使用强类型的REF游标
创建程序包规范
create or replace package my_pack
is
procedure find_emp_proc(eno emp.empno%type);
function find_emp_fun(eno emp.empno%type) return emp.ename%type;
end my_pack;
SQL> ed
SQL> /
Package created
调用函数
SQL> select my_pack.find_emp_fun(7788) from dual;
select my_pack.find_emp_fun(7788) from dual
ORA-04068: 已丢弃程序包 的当前状态
ORA-04067: 未执行,package body "SCOTT.MY_PACK" 不存在
ORA-06508: PL/SQL: 无法在调用之前找到程序单元
ORA-06512: 在line 1
执行存储过程
SQL> exec my_pack.find_emp_proc(7788);
begin my_pack.find_emp_proc(7788); end;
ORA-04068: 已丢弃程序包 的当前状态
ORA-04067: 未执行,package body "SCOTT.MY_PACK" 不存在
ORA-06508: PL/SQL: 无法在调用之前找到程序单元
ORA-06512: 在line 2
创建程序包主体
create or replace package body my_pack
is
empname emp.ename%type;
procedure find_emp_proc(eno emp.empno%type)
is
begin
select ename into empname from emp where empno=eno;
dbms_output.put_line(empname);
end;
function find_emp_fun(eno emp.empno%type) return emp.ename%type
is
begin
select ename into empname from emp where empno=eno;
&nb
相关文档:
网上有很多的资料,参考itput(http://space.itpub.net/471666/viewspace-215923)的。
OS : Redhat
DB : Oracle 10.2.0.4.0
1.修改jdk 下面的字体。
[oracle@a ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@a ~]]$ mv font.properties font.properties_bak
[oracle@a ~]]$
[oracle@a ~]]$ cp font.properties.zh_CN.R ......
t表中将近有1100万数据,很多时候,我们要进行字符串匹配,在SQL语句中,我们通常使用like来达到我们搜索的目标。但经过实际测试发现,like的效率与instr函数差别相当大。下面是一些测试结果:
SQL> set timing on
SQL> select count(*) from t where instr(title,’手册’)>0;
COUNT(*)
—&md ......
Create directory让我们可以在Oracle数据库中灵活的对文件进行读写操作,极大的提高了Oracle的易用性和可扩展性。
其语法为:
CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';
本案例具体创建如下:
create or replace directory exp_dir as '/tmp';
目录创建以后,就可以把读写权限授予特定用户 ......
Hey all,
Since there seems to be a fair bit of disinformation, and utter nonsense,
floating around since my talk at the Black Hat Federal security conference
the other day, I have decided to publish the following papers.
http://www.databasesecurity.com/HackingAurora.pdf
http://www.databasesec ......