-- run_invalid.sql

DECLARE
   c NUMBER;
BEGIN
   c := pay_type_count;
   DBMS_OUTPUT.PUT_LINE('The number of pay types is ' || c);
END;
/

-- Since the pay_type_count function is dependent on the
-- pay_type_copy table, it was marked invalid when the
-- table was dropped.  Oracle attempts to revalidate the
-- function when it is executed, but can't (since the table
-- still doesn't exist) and generates an error.
-- ERROR at line 4:
-- ORA-06550: line 4, column 9:
-- PLS-00905: object S1.PAY_TYPE_COUNT is invalid
-- ORA-06550: line 4, column 4:
-- PL/SQL: Statement ignored

