当前位置:Gxlcms >
数据库问题 >
Oracle PLSQL Demo - 12.定义包体[Define PACKAGE BODY]
Oracle PLSQL Demo - 12.定义包体[Define PACKAGE BODY]
时间:2021-07-01 10:21:17
帮助过:5人阅读
OR REPLACE PACKAGE BODY temp_package_demo
is
FUNCTION f_demo(userid
NUMBER)
RETURN BOOLEAN
IS
v_temp varchar2(
1);
BEGIN
SELECT 1 INTO v_temp
FROM scott.emp
WHERE empno
= userid;
RETURN TRUE;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN FALSE;
END;
PROCEDURE p_demo_1(userid
NUMBER DEFAULT v_demo, sal
number)
is
v_temp varchar2(
1);
BEGIN
SELECT 1 INTO v_temp
FROM scott.emp
WHERE empno
= userid;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RAISE_APPLICATION_ERROR(-20011,
‘Not found‘);
END;
END temp_package_demo;
Oracle PLSQL Demo - 12.定义包体[Define PACKAGE BODY]
标签: