create or replace function calc_player_avg
(v_id IN player_bat_stat.player_id%type)
return number
is
v_avg number;
begin
select hits / at_bats
into v_avg
from player_bat_stat
where player_id = v_id;
return (v_avg);
end;
调用包括“执行”语句,但这里以下语句被标记为错误:
Execute calc_player_avg(31);
正确的是:
select calc_palyer_avg(player_id) from player_bat_stat;