chin
2010-11-05 22:56:40 UTC
CREATE OR REPLACE FUNCTION
DECLARE
BEGIN
-- execution
SELECT skills_price, StartDate, FinishDate, No_hrs
FROM Skills, Daily_Work, Contract;
SELECT SUM(skills_price*No_hrs) as SALARY
FROM Skills, Daily_Work, Contract
WHERE (StartDate IS NOT NULL AND FinishDate IS NOT NULL);
-- exception
IF (v_salary = StartDate IS NOT NULL && v_salary = FinishDate IS NOT NULL)
-- display salary calculate
ELSE -- display salary not counted due to unfinish job performed
raise;
END;
/
any hints on this as i want to calculate the salary of the contractor and the exception, what exception should i write so that it can display salary and display errors when salary is not display ??
pls guide me and feel free to comment to improve this script
thanks...