今天外面风真是不小。继续!
存储过程的创建
create [or replace] procedure pro_name [(para1[,para2]...)] is | as
begin
plsql_sentence;
[exception]
[do_sentence;]
end [pro_name];
函数
创建:
create [or replace] function fun_name[(para1[.para2]...)] return data_type is
[inner_variable]
begin
plsql_sentence;
[exception]
[do_sentence;]
end [fun_name];
调用:
必须使用一个变量来保存函数的返回值。
删除:
drop function fun_name;
触发器
create [or replace] trigger tri_name
[before | after | instead of] tri_event
on table_name |view_name |user_name |db_name
[for each row [when tri_condition]]
begin
plsql_sentence;
end tri_name
程序包:
create [or replace] package pack_name is
[declare_variable];
[declare_type];
[declare_cursor];
[declare_function];
[declare_procedure];
end [pack_name];
包主体:
create [or replace] package body pack_name is
[inner_variable]
[cursor_body]
[function_title]
{begin
fun_plsql;
[exception]
[do_sentence;]
end [fun_name]}
[procedure_title]
{begin
pro_plsql;
[exception]
[do_sentence;]
end [pro_name]}
...
end [pack_name];
阅读(2265) | 评论(0) | 转发(0) |