Create a package specification createorreplacepackageemp_packageisg_deptnonumber (3): 30; procedureadd_employee (enonumber
Create or replace package emp_package is g_deptno number (3): = 30; procedure add_employee (eno number
Begin select sal into v_sal from emp where empno = eno; return v_sal; exception when no_data_found then RAISE_ApPLICATION_ERROR (-20012, 'this employee does not exist'); end get_sal; end emp_package; call package component 1. call in the same package
Procedure add_employee (eno numberk, ename varchar2, salary number, dno number default g_deptno) isbegin if exist (dno) then insert into emp (empno, ename, sal, deptno) values (eno, ename, salary, dno); else raise_application_error (-20010, 'this department does not exist'); end if; exception when dup_val_on_index then raise_application_error (-20011, 'this employee already exists '); end; 2. call Public Variables
3. Call the public process
4. Call Public Functions
---- When using other user identities to call a public component, you must add the user name and package name as the prefix before the component name
---- SCOTT. EMP_PACKAGE .....
---- When the public component that calls the remote database package is, add the package name as the prefix before the component name. After the component name, the database chain name must be followed as the suffix.
---- EMP_PACKAGE.ADD_EMPLOYEE @ Clerk (1111, 'Scott ', 1233,10)
---- View source code
---- Select text from user_source whereand type = 'package'