use*_*669 6 sql oracle stored-procedures ora-06550
我使用 sqlplus 收到此代码的编译错误。
我的错误是:
警告:创建的过程有编译错误。
BEGIN point_triangle; 结尾;
第 1 行错误:ORA-06550:第 1 行,第 7 列:
PLS-00905:对象 POINT_TRIANGLE 无效
ORA-06550:第 1 行,第 7 列:
PL/SQL 语句被忽略
每当我输入 show errors 时,它都会告诉我没有错误。
这是代码。
create or replace procedure point_triangle
AS
A VARCHAR2(30);
B VARCHAR2(30);
C INT;
BEGIN
FOR thisteam in (select P.FIRSTNAME into A from PLAYERREGULARSEASON P where P.TEAM = 'IND' group by P.FIRSTNAME, P.LASTNAME order by SUM(P.PTS) DESC)
(select P.LASTNAME into B from PLAYERREGULARSEASON P where P.TEAM = 'IND' group by P.FIRSTNAME, P.LASTNAME order by SUM(P.PTS) DESC)
(select SUM(P.PTS) into C from PLAYERREGULARSEASON P where P.TEAM = 'IND' group by P.FIRSTNAME, P.LASTNAME order by SUM(P.PTS) DESC);
LOOP
dbms_output.put_line(A|| ' ' || B || ':' || C);
END LOOP;
END;
/
Run Code Online (Sandbox Code Playgroud)
假设将所有球员放入 A 和 B,并将他们在该团队的职业生涯积分放入 C。我知道查询有效,只是程序中没有。
create or replace procedure point_triangle
AS
BEGIN
FOR thisteam in (select FIRSTNAME,LASTNAME,SUM(PTS) from PLAYERREGULARSEASON where TEAM = 'IND' group by FIRSTNAME, LASTNAME order by SUM(PTS) DESC)
LOOP
dbms_output.put_line(thisteam.FIRSTNAME|| ' ' || thisteam.LASTNAME || ':' || thisteam.PTS);
END LOOP;
END;
/
Run Code Online (Sandbox Code Playgroud)