--创建不带参数(不能加括号表示无参)存储过程
create or replace procedure procedure1
as
--as 与 is 区别:在存储过程(PROCEDURE)和函数(FUNCTION)中没有区别,在视图(VIEW)中只能用
AS 不能用 IS,在游标(CURSOR)中只能用 IS 不能用 AS。
--声明部分
countint number;
--执行部分
begin
select count(1) into countint from emp;
dbms_output.put_line('emp 表共有' || countint || '行记录');
--异常处理部分
exception
when others
then
null;
end;
评论