这会导致ORA-00923: From keyword not found
错误:
create or replace function gr_pay_hrly (p_wage_rate IN Number,
p_hrs_worked In number)
Return Number IS
t_wage pay_history.wage_rate%type;
t_hours pay_history.hrs_worked%type;
t_gross_pay number(10,2);
BEGIN
select wage_rate into t_wage,
hrs_worked into t_hours
from pay_history
where wage_rate = p_wage_rate
and hrs_worked = p_hrs_worked;
IF t_hours >= 40 THEN
t_gross_pay := (((t_hours - 40) * t_wage) * 1.5);
ELSE
t_gross_pay := t_hours * t_wage;
END IF;
RETURN t_gross_pay;
END;
/