一,Oracle中的过程,函数对于oracle中的过程和函数,个人觉得可以化为一类,因为它们在写法上并没有什么的不同。公式无非就是 create or replace Package_name(paramater1 in type,paramater2 in type,out_message out type) is locate_paramater1 type; locate_paramater2 type; begin begin select sth into locate_paramater1 from table_name where 。。。。 exception when no_d Read More
posted @ 2012-02-09 15:41 汉卿 Views(526) Comments(0) Diggs(0) Edit
create or replace trigger is tri_update[/insert/delete/UID]_tableName before[after] insert[update/delete/or 。。。] on tableName [for each row]--这个一般都要加上,因为我们一般都是行级触发器,即对每一行都操作 [declare locateParamater1 type; locateParamater1 type;] --又见begin...end; begin --do something; end;在给实例之前,想说说自己使用触发器的几个感受:(1). Read More
posted @ 2012-02-09 15:39 汉卿 Views(438) Comments(0) Diggs(0) Edit
这个文档几乎包含了oracle游标使用的方方面面,全部通过了测试-- 声明游标;CURSOR cursor_name IS select_statement--For 循环游标--(1)定义游标--(2)定义游标变量--(3)使用for循环来使用这个游标declare--类型定义cursor c_jobisselect empno,ename,job,salfrom empwhere job='MANAGER';--定义一个游标变量v_cinfo c_emp%ROWTYPE ,该类型为游标c_emp中的一行数据类型c_row c_job%rowtype;beginfor c_r Read More
posted @ 2012-02-09 15:36 汉卿 Views(407) Comments(0) Diggs(0) Edit