随笔分类 -  Oracle

mysql中的group_concat()
摘要:mysql> select * from tab1; +----+------+ | id | c2 | +----+------+ | 1 | 1 | | 2 | 1 | | 3 | 1 | | 4 | 1 | | 5 | 2 | | 6 | 2 | +----+------+ 6 rows in set (0.00 sec) mysql> s... 阅读全文
posted @ 2008-12-25 21:36 Oracle 阅读(481) 评论(0) 推荐(0)
over函數的妙用
摘要:一个滚动算累计值得难题,谢谢 ID je(金额) rs(人数) 1 10 2 2 20 5 1 5 1 1 40 4 1 100 10 希望得到如下结果 即当type=2的时候 累计je=上次的je(10)+本次rs(5)*上次的 je(10)/rs(2)得5 也就是 10+5*(10/2) = 35 ID je rs 1 ... 阅读全文
posted @ 2008-12-25 15:55 Oracle 阅读(269) 评论(0) 推荐(0)
自制事務
摘要:CREATE OR REPLACE procedure Test1 as begin --set transaction read write; insert into aaa values(1); commit; end; / CREATE OR REPLACE procedure Test2 as begin --set transaction read write; insert into ... 阅读全文
posted @ 2008-12-24 09:59 Oracle 阅读(337) 评论(0) 推荐(0)
dblink的創建
摘要:在自己本地運行服務器下運行下面這段script create database link test connect to gkl identified by gkl using 'LinuxORCL' LinuxORCL 是本地tnsname.ora配置的,其中yourhostIP是需要遠程連接的服務器IP LinuxORCL = (DESCRIPTION = (ADDRESS... 阅读全文
posted @ 2008-12-24 09:10 Oracle 阅读(201) 评论(0) 推荐(0)
定位導致物化視圖無法快速刷新的原因(轉)
摘要:http://yangtingkun.itpub.net/post/468/13318 物化视图的快速刷新采用了增量的机制,在刷新时,只针对基表上发生变化的数据进行刷新。因此快速刷新是物化视图刷新方式的首选。 但是快速刷新具有较多的约束,而且对于采用ON COMMIT模式进行快速刷新的物化视图更是如此。对于包含聚集和包含连接的物化视图的快速刷新机制并不相同,而且对于多层嵌套的物化视图的快速刷新更... 阅读全文
posted @ 2008-12-23 11:09 Oracle 阅读(376) 评论(0) 推荐(0)
.NET调用ORACLE存储过程使用数组参数
摘要:----------包定义 create or replace package packtest as type string_array is table of varchar2(21) index by binary_integer; type int_array is table of number(4) index by binary_integer; procedure te... 阅读全文
posted @ 2008-12-20 22:25 Oracle 阅读(2772) 评论(0) 推荐(0)
oracle ref cursor
摘要:----建立测试数据 CREATE TABLE DEPT (DEPTNO NUMBER(2,0) NOT NULL, DNAME VARCHAR2(14) NULL, LOC VARCHAR2(13) NULL, PRIMARY KEY (DEPTNO) ); INSERT INTO Dept VALUES(11,'Sales','Texas');... 阅读全文
posted @ 2008-12-10 17:23 Oracle 阅读(732) 评论(0) 推荐(0)