我是 pl/sql 的菜鸟。我正在尝试使用 pl sql 计算 gpa。我创建了一个表,其中包含带有值的等级。
SSN CNO GRADE
--------------- -------- ----------
55555 cs101 1
55555 math101 4
55555 bio101 1
55555 cgdd101 3
55555 swe203 3
55555 eng101 3
11111 bio101 4
11111 cgdd101 4
55555 cs101 1
55555 math101 4
55555 bio101 1
我正在尝试使用以下 pl sql 函数计算 gpa,但出现以下错误。
55555 eng101 3
36 rows selected.
SQL> create or replace function get_count
2 return is
3 declare
4 v_count number;
5 begin
6 select count(*) into v_count from grade;
7 return grade;
8
9 end;
10 /
Warning: Function created with compilation errors.
SQL> show errors
Errors for FUNCTION GET_COUNT:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/8 PLS-00103: Encountered the symbol "IS" when expecting one of the
following:
<an identifier> <a double-quoted delimited-identifier> self
long double ref char time timestamp interval date binary
national character nchar