在存储过程中有许多的东西很多人都不知道,但是确实很有用,今天我就碰上了几个带%的类型。
1、%notfound
布尔型属性,当最近一次读取纪录不成功时,返回true.
eg:declare
begin
update stu set name='齐文进' where stu_id=28;
if sql%notfound then
statememnet;
end if;
end;
2、%rowtype
这是一个用来定义一个表中指定的移行纪录的变量类型。
定义时,变量名 表名%rowtype.
使用时,变量名.表中字段名
3、%type
这是用来定义表中字段与定义字段类型相同时用的。
eg:变量 表名.字段%type