这是一个简单的 PL/SQL 块,我有一个非常简单的错误,ORA-06550 但我找不到它,请帮我解决这个错误............
问题:显示最昂贵项目的类别明智奖
创建表格菜单 ( item_id 编号主键, name_varchar2(20), 奖品号码, 类 varchar(15) ); 创建表顺序_ ( o_id 编号主键, item_id 编号参考菜单(item_id), table_no 编号, 数量 );
SQL> declare
2 cursor data1 is select max(prize) as "prize_", category
3 from menu
4 group by category;
5
6 cursor data2(pr number, cat varchar(15)) is
7 select prize, name_, category
8 from menu
9 where prize = pr and category = cat;
10
11
12 data1_cat varchar(15);
13 data1_pri number;
14
15 data2_cat varchar(15);
16 data2_pri number;
17 data2_name varchar(15);
18 begin
19 open data1;
20 open data2;
21
22 fetch data1 into data1_pri, data1_cat;
23 while data1%found
24 loop
25 fetch data2(data1_pri, data1_cat) into data2_pri, data2_name, data2_cat;
26 while data2%found
27 loop
28 dbms_output.put_line(data2_name || ' ' || data2_pri || ' ' || data2_cat);
29 fetch data2(data1_pri, data1_cat) into data2_pri, data2_name, data2_cat;
30 end loop;
31
32
33 fetch data1 into data1_pri, data1_cat;
34 end loop;
35 close data2;
36 close data1;
37 end;
38 /
错误是打击
ERROR at line 6:
ORA-06550: line 6, column 40:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue.
ORA-06550: line 25, column 20:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
. into bulk
ORA-06550: line 25, column 80:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( , % from
ORA-06550: line 29, column 24:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
. into bulk
ORA-06550: line 29, column 84:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
. ( , % from
ORA-06550: line 35, column 5:
PLS-00103: Encountered the symbol "CLOSE" when expecting one of the following:
end not pragma final instantiable order overriding static
member constructor map