在SQLLPLUS中判断异常退出-非权限用户中止执行
set termout onset serveroutput onwhenever sqlerror exit;spool uninstll.logselect to_number('ERROR') from (select user name from dual) where name not like 'FM%';prompt here is me!!!!!!!!!!!!!!!!!!spool...
Oracle number和INTEGER的奇怪现象
Normal 0 false false false EN-US ZH-CN X-NONE</w:LidThemeComplexScript. ...
大乐透八等奖4个中奖情况
****************************最终版三个过程,一个临时存储表 一个日志表 #drop procedure p_stats_dlt_8levels_test; --测试用#drop procedure p_stats_dlt_child_8levels_test;--测试drop table dlt...
oracle 阶乘 组合 求两个字符串相同字符个数
组合create or replace function collocate(m number, n number) return number is --C(n,m)=n!/(n-m)!*m! v_result number;begin if m > n then return 0; end if; ...
sqlplus 多样化输出
盖老师的链接http://www.eygle.com/archives/2005/04/eoasqlplusieaae.html
oracle 分析函数中 keep关键字的使用
语法min | max(column1) keep (dense_rank first | last order by column2) over (partion by column3); 另外firstlast还可以结合avg sum等使用。解释:返回按照column3分组后...
insert all 操作 减少扫描次数
create table tx1 (id1 int ,id2 int);create table tx2 (id1 int, id2 int);create table tx3 (id1 int, id2 int);create table tx (id1 int, id2 int);insert into tx values(1,1);insert into tx values(2,2);in...
【转】oracle 10g 行列转换的写法
11g中有更好的解决方式,有个pivot函数 1 Oracle一个典型行列转换的几种实现方法 假如有如下表,其中各个i值对应的行数是不定的SQL> select * from t;I A D———- —...
【记】延迟清除
在分析select 的执行计划时,redo size不为0引发的一系列问题。alter system dump database/logfile延迟清除udump文件的阅读。等。
【转】ORA-01779 update写法另一种写法
ORA-01779的处理方法 =========================================================== : http://rainbowbridg.itpub.net/post/23663/295750--------------------------------------------------------------- Orac...
[转ORACLE 执行计划 统计信息介绍]
· Recursive Calls. Number of recursive calls generated at both the user and system level. Oracle Database maintains tables used for internal processing. When it needs to change these tables, O...
oracle deferred novalidate
在使用约束时(外键,唯一,为空等)可以使用enable /disable validate /novalidatenovalidate就是忽略已有数据,对之后的数据维护约束关系。disable就是去掉约束。deferrable 是在创建...
oracle 10g values of 和indices of 初次接触
values of 和indices of是oracle 10g的新特性。在批量处理中提高性能,适用于处理嵌套集合,稀疏集合时,以避免丢失记录异常和创建多余副本。在使用时,forall var in values of collection...
oracle update ora-01779
create table tt1 (id1 int,no1 int);create table tt2 (id2 int,no2 int);insert into tt1 values(1,6);insert into tt1 values(2,7);insert into tt2 values(1,1);insert into tt2 values(2,2); update (...
oracle PLSQL循环语法
loop statement; exit when condition ;end loop;while condition loop; statement;end loop;for var in [reverse] loop_bottom .. loop_top loop statement;end loop...
oracle update的变种写法
create table a (id int ,name int);create table b (id int ,name int);select * from a select * from binsert into aselect 1,11 from dual insert into bselect 1,22 from dual 变种一...
oracle flashback 理论与实践一
利用query flashback回复数据。比较麻烦 要写一个过程。select to_char(sysdate,'yyyy/mm/dd hh24:mi:ss') from dual;exec dbms_flashback.enable_at_time(sysdate-3/1440);exec dbms_flashback.disable();DECLAR...
oracle 集合collection
集合分类:1、变长数组varray create type varray_typ as varray(2) of varchar2(20); 2、嵌套表create type nested_typ as table of varchar2(2)[or other type];1和2的混合体:多级集合。oracle 10g新...
oracle 数据库对象学习一
学习数据库对讲的定义,使用对象创建表,对象表,及dml操作。对象引用(不使用外键)的操作,构造函数的定义及使用等。关键字:type ,type body ,value ,ref ,deref ,construtor ,self......
oracle instead of trigger
链接http://blogger.org.cn/blog/more.asp?name=RandomRen&id=20956 触发器中使用instead 实践