Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Keep getting erro Component must me declared?

Author  Topic 

vb89
Starting Member

9 Posts

Posted - 2008-10-02 : 15:21:10
im working in pl/sql and I keep getting the error componet 'first' must be declared, and i have no idea why...

here is my code for my cursor and proc

cursor cGetTeamStats is
select *
from varsity.soccer_period_results
where game_code = p_GameCode;

type team_stats_1d is table of cGetTeamStats%rowtype index by varsity.soccer_period_results.team_id%type;
type team_stats_2d is table of team_stats_1d index by pls_integer;
aTeamStats team_stats_1d;
xTeamStats team_stats_2d;



procedure pWriteTeamStats(tTeamID in varchar2, tTeamType in varchar2, iIndent in number) as
iCurrStatType number;
tCurrTeamID varsity.soccer_period_results.team_id%type;
begin
utl_file.put_line(file_handle, sp(iIndent) || '<' || tTeamType || '-team-stats>');

iCurrStatType := xTeamStats(tTeamID).first;
loop
exit when iCurrStatType is null;


tCurrTeamID := xTeamStats(tTeamID)(iCurrStatType).first;
loop
exit when tCurrTeamID is null;

utl_file.put(file_handle, sp(iIndent + 2) || '<' || aStatTypes(iCurrStatType) || ' ');


case iCurrStatType
when 2 then -- goal
utl_file.put_line(file_handle, 'goals="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).goals || '">');
when 4 then -- shots
utl_file.put_line(file_handle, 'shots="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).shots || '">');
when 5 then -- shots on goal
utl_file.put_line(file_handle, 'shots on goal="' || xTeamStats (tTeamID)(iCurrStatType)(tCurrTeamID).shots_on_goal || '">');
when 9 then -- saves
utl_file.put_line(file_handle, 'saves="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).saves || '">');
when 10 then -- fouls committed
utl_file.put_line(file_handle, 'fouls committed="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).fouls_committed || '">');
when 11 then -- corner kicks
utl_file.put_line(file_handle, 'corner kicks="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).corner_kicks || '">');
when 12 then -- yellow cards
utl_file.put_line(file_handle, 'yellow cards="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).yellow_cards || '">');
when 13 then -- red cards
utl_file.put_line(file_handle, 'red cards="' || xTeamStats(tTeamID)(iCurrStatType)(tCurrTeamID).red_cards || '">');
end case;

tCurrTeamID := xTeamStats(tTeamID)(iCurrStatType).next(tCurrTeamID);
end loop;

iCurrStatType := xTeamStats(tTeamID).next(iCurrStatType);
end loop;

utl_file.put_line(file_handle, sp(iIndent) || '</' || tTeamType || '-team-stats>');


end pWriteTeamStats;

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-10-02 : 15:37:56
this is a forum from Microsoft SQL Server. You're working with Oracle. maybe you should ask your question in an Oracle forum because you'll get an answer quicker.

_______________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.0 out!
Go to Top of Page
   

- Advertisement -