星期二, 十月 17, 2006

plsql读书笔记1

1,基本格式
DECLARE
BEGIN
EXCEPTION
END;
2,PLSQL块分类
1),匿名块
2)命名块
<<outer_name>>
DECLARE
BEGIN
<<inner_name>>
BEGIN
END;--<<inner_name>>
END;--<<outer_name>>
3)子程序
a,过程
CREATE PROCEDURE procedure_name(name1 VARCHEAR2, name2 NUMBER)
IS
BEGIN
END;
调用过程时用命令:execute或者call
b,函数
CREATE FUNCTION function_name(name1 NUMBER,name2 VARCHAR2)
RETURN NUMBER IS
return_name NUMBER(7,2)
BEGIN
END;
c,包
CREATE PACKAGE page_name IS
PROCEDURE procedure_name;
FUNCTION function_name;
END
4,触发器
CREATE TIGGER tigger_name
AFTER UPDATE OF deptno ON dept
FOR EACH ROW
BEGIN 
END;

没有评论: