在oracle利用游标取数据库的结果集应用实例:
SQL> create table test2(s1 varchar(10),s2 varchar2(10));
表已创建。
SQL> insert into test2 values('11','111');
已创建 1 行。
SQL> insert into test2 values('22','222');
已创建 1 行。
SQL> CREATE OR REPLACE PACKAGE test222 AS
2 TYPE t_cursor IS REF CURSOR;
3 procedure p_test1( p_dd in out t_cursor);
4 end;
5 /
程序包已创建。
SQL> CREATE OR REPLACE package body test222 AS
2 procedure p_test1(
3 p_dd in out t_cursor)
4 is
5 begin
6 open p_dd for select * from test2;
7 end;
8 end;
9 /
程序包主体已创建。
SQL> var ss refcursor
SQL> exec test222.p_test1(:ss);
PL/SQL 过程已成功完成。
SQL> print ss
S1 S2
---------- ----------
11 111
22 222
SQL>
相关文档:
oracle实现汉字按照拼音、笔画和部首排序
找了相关的一些资料,都说的不是很清楚,自己也研究了下,终于搞明白了,希望对大家有帮助。
需要说明的是下面的方法需要ORACLE9i和以上的版本才支持。
Oracle9i之前,中文是按照二进制编码进行排序的。
在oracle9i中新增了按照拼音、部首、笔画排序功能。设置NLS_SORT值
......
oracle wait event:cursor: pin S wait on X
cursor: pin S wait on X等待事件的处理过程
http://database.ctocio.com.cn/tips/114/8263614_1.shtml
cursor: pin S wait on X等待!
http://www.itpub.net/viewthread.php?tid=1003340
解决cursor: pin S wait on X 有什么好办法:
http://www.itpub.net/thread-1163543 ......
--使用DBA创建两个用户
create user gubo identified by gubo;
create user gubo2 identified by gubo;
--给两个用户连接权限
grant create session to gubo;
grant create session to gubo2;
--给其中一个用户访问表空间的权限
grant unlimited tablespace to gubo;
--连接其中用户,创建表
--conn gubo
......
一。job的运行频率设置
1.每天固定时间运行,比如早上8:10分钟:Trunc(Sysdate+1) + (8*60+10)/24*60
2.Toad中提供的:
每天:trunc(sysdate+1)
每周:trunc(sysdate+7)
每月:trunc(sysdate+30)
每个星期日:next_day(trunc(sysdate),'SUNDAY')
每天6点:trunc(sysdate+1)+6/24
半个小时:sysdate+30/1440
3.每个 ......
遇到的一些Oracle的零碎问题:
1、使用自定义异常,raise_application_error(异常编号,异常信息)。
A、异常编号注意不要超长,一般到5位
B、异常信息是一个字符串信息
C、配合存储过程中exception使用 ......