Oracle Development Kit

Source: Internet
Author: User
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'

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.