PL/SQL Library Code
-------------------
FUNCTION BONUS_PAY(JOB_ID IN CHAR, SAL IN NUMBER, COMM_PCT IN NUMBER) RETURN NUMBER IS
BEGIN
  IF JOB_ID != 'SA_REP' THEN
    RETURN (SAL * 0.15);
  ELSE
    IF SAL * COMM_PCT >= 500 THEN
      RETURN ((SAL + SAL * COMM_PCT) * 0.15);
    ELSE
       RETURN ((SAL + SAL * COMM_PCT) * 0.10);
    END IF;
  END IF;
END;



Query Code
----------
SELECT FIRST_NAME, LAST_NAME,  JOB_ID, SALARY,COMMISSION_PCT
FROM EMPLOYEES
ORDER BY LAST_NAME



Bonus Formula Column Code
-------------------------
function BONUSFormula return Number is
begin
  return BONUS_PAY(:JOB_ID, :SALARY, :COMMISSION_PCT);
end;


Final Calc Code
---------------
FUNCTION FINAL_CALC RETURN NUMBER IS
BEGIN
  IF :JOB_ID = 'SA_REP' THEN
  	RETURN (:BONUS + :SALARY + :COMMISSION_PCT * :SALARY);
  ELSE
  	RETURN (:BONUS + :SALARY);
  END IF;
END;



Total Comp Formula Column Code
------------------------------
function TOTAL_COMPFormula return Number is
begin
  return FINAL_CALC;
end;



Format Trigger Code
-------------------
function B_1FormatTrigger return boolean is
begin
   If :CNT_COLUMN mod :SPACE = 0 then
		return(TRUE);
	else
		return(FALSE);
	end if;
end;
