Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Cursor Parameter Problems/Question
I'm trying to write a package and in the package header I have this cursor
declared:
CURSOR c_batting ( p_player_id_char IN in_player.player_id_char%TYPE )
IS
SELECT year,
stint, team, nvl(at_bats,0), nvl(runs,0), nvl(hits,0), nvl(doubles,0), nvl(triples,0), nvl(home_runs,0), nvl(rbi,0) FROM in_batting WHERE player_id_char = p_player_id_char AND year < 1995;
In my package body I'm trying to get this section of code to work:
PROCEDURE Load_BattingInfo ( p_player_id_char IN
in_player.player_id_char%TYPE )
IS
v_singles batting.singles%TYPE;
BEGIN FOR c1 IN c_batting( p_player_id_char ) LOOP v_singles := ( c1.hits - ( c1.doubles + c1.triples + c1.home_runs ) );
END LOOP; END Load_BattingInfo;
The problem I'm getting is that I get 'PLS-00302: component 'HITS' must be declared'. I thought I was passing the parameter correctly but I'm obviously not doing something correctly and I can't find the answer in any of my books.
Can/will anybody please tell me what I'm doing wrong?
Thanks very much. Received on Sun Apr 09 2006 - 12:05:17 CDT