2012年2月22日

Oracle Cusor

摘要: Ref:http://blog.csdn.net/yhmhappy2006/article/details/5552574一 概念 游标是SQL的一个内存工作区,由系统或用户以变量的形式定义。游标的作用就是用于临时存储从数据库中提取的数据块。在某些情况下,需要把数据从存放在磁盘的表中调到计算机内存中进行处理,最后将处理结果显示出来或最终写回数据库。这样数据处理的速度才会提高,否则频繁的磁盘数据交换会降低效率。 二 类型 Cursor类型包含三种: 隐式Cursor,显式Cursor和Ref Cursor(动态Cursor)。 1. 隐式Cursor: 1).对于Select …INTO…语句. 阅读全文

posted @ 2012-02-22 16:50 Kevin Kim 阅读(760) 评论(0) 推荐(0) 编辑

table() function

摘要: -- create objectscreate or replace type obj_type1 as object ( c1 int, c2 int);/create or replace type obj_tbl_type1 as table of obj_type1;/+++++++++++++++++++++++++++++++++++++++++create or replace function func1return obj_tbl_type1pipelinedis v_obj obj_type1;begin for idx in 1 .. 100 loop v_obj := 阅读全文

posted @ 2012-02-22 16:33 Kevin Kim 阅读(188) 评论(0) 推荐(0) 编辑

Oracle View Build Date

摘要: Ref:http://www.adp-gmbh.ch/ora/sql/table_cast.htmlcreate or replace type date_obj as object (dt date)/create or replace type date_table as table of date_obj/create or replace function date_range(from_dt in date, to_dt in date) return date_table as a_date_table date_table := date_table(); cur... 阅读全文

posted @ 2012-02-22 16:06 Kevin Kim 阅读(487) 评论(0) 推荐(0) 编辑

导航