怎么用,语法等等
刚学到,但是学的有点云里雾里的。
希望哪位牛人能帮忙讲解讲解。
最好能有个什么书籍
我会加分的。希望不知道的不要盖楼。
谢谢
刚学到,但是学的有点云里雾里的。
希望哪位牛人能帮忙讲解讲解。
最好能有个什么书籍
我会加分的。希望不知道的不要盖楼。
谢谢
解决方案 »
- 【如何提高海量数据的查询速度,高手请指点】
- 一个库内,表a中3亿条数据分别入表b,表c,表d!如何做,效率最高
- Oracle 关系表中存储XML结构的数据
- 导入dmp时失败,提示:未启用partitioning特性,如何解决?
- 经过防火墙的Oracle连接问题
- 如何清除undo类型下的表空间数据?
- 从网上下载的Oracle9i简体中文版(三张碟),完成后是一大堆压缩格式的文件,没有一个类似setup之类的文件,如何安装啊!急!!!
- 关于DECODE()的一点讨论,欢迎高手进来!
- 福建的程序员请进!UP也有分!小弟要到那儿工作,告诉我你们的薪水有多少啊?
- 各位大大,有谁知道怎么删除一个tablespace中的datafile?
- 请教 oracle 查看操作日志方法
- 硬件监控
create or replace package emp_info
is
--含select的游标
cursor byempid_cur(
empid_in in employees.employee_id%type
)
is
select * from employees
where employee_id=empid_in;
--完整的游标声明
cursor bydept_cur(
department_id_in in employees.department_id%type
) return employees%rowtype;
--不带select语句的游标声明
type dept_summary_rt is record(
dept_id employees.department_id %type,
total_emp_count pls_integer,
total_salary_count pls_integer
);
--自定义记录数据结构
cursor summary_cur(
dept_id_in in employees.department_id %type
) return dept_summary_rt;
end emp_info;
/--创建包体
create or replace package body emp_info
is
cursor bydept_cur(
department_id_in in employees.department_id%type--包体变量名称必须和包声明相同,不同会有错
)
return employees%rowtype
is
select * from employees where department_id=department_id_in;
cursor summary_cur(
dept_id_in in employees.department_id%type
)
return dept_summary_rt
is
select department_id,count(employee_id),sum(salary)
from employees
where department_id=dept_id_in;
end emp_info;
/--使用包
declare
one_emp emp_info.byempid_cur%rowtype;
begin
if emp_info.byempid_cur%isopen then
null;
else
open emp_info.byempid_cur(119);
end if;
loop
fetch emp_info.byempid_cur into one_emp;
exit when emp_info.byempid_cur%notfound;
dbms_output.put_line(one_emp.employee_id||
one_emp.first_name||one_emp.last_name||
one_emp.salary||one_emp.employee_id);
end loop;
close emp_info.byempid_cur;
end;
/
XXX从入门到精通
Oracle Database 9i/10g/11g编程艺术 等等等
或者官方文档
楼主是想看开发类的吧,找点基础点的都有介绍...
这本书不错,适合初学。