Search code examples
sqloracle-databaseplsqlplsql-package

Warning: Package Body created with compilation errors...in plsql


Error:

Warning: Package Body created with compilation errors. BEGIN * ERROR at line 1: ORA-04063: package body "P12284.EMP_DESIGNATION" has errors ORA-06508: PL/SQL: could not find program unit being called: "P12284.EMP_DESIGNATION" ORA-06512: at line 2

How to solve This ? Please Help me I'm New to PL/SQL

`

set serveroutput on;
    CREATE OR REPLACE PACKAGE EMP_DESIGNATION 
    AS
    PROCEDURE EMP_DETAILS(PS_design employee.designation%TYPE, PS_incentive number);
    END EMP_DESIGNATION;
    /
    CREATE OR REPLACE PACKAGE BODY EMP_DESIGNATION
    AS
    PROCEDURE EMP_DETAILS(design employee.designation%TYPE, incentive number)
    IS
    BEGIN
        update employee set employee.salary = employee.salary + incentive where designation = design ;
        DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ' employee(s) are updated');
         
    END;
    /
    `

Solution

  • You need to end your package body too -

    CREATE OR REPLACE PACKAGE BODY EMP_DESIGNATION
    AS
        PROCEDURE EMP_DETAILS(design employee.designation%TYPE, incentive number)
        IS
        BEGIN
            update employee set employee.salary = employee.salary + incentive where designation = design ;
            DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || ' employee(s) are updated');
             
        END;
    END EMP_DESIGNATION;
    /