Plsql 第6行错误:PL/SQL:SQL语句被忽略
第6行出现错误:Plsql 第6行错误:PL/SQL:SQL语句被忽略,plsql,Plsql,第6行出现错误:PL/SQL:SQL语句被忽略 带有“”select count(*)into ecount“的行给出了错误 有人能帮我吗 我的代码: create or replace function empcount(department in table_employee.dept_name%type) return integer as ecount integer; begin select count(*) into ecount fro
PL/SQL:SQL语句被忽略
带有“”select count(*)into ecount“
的行给出了错误
有人能帮我吗
我的代码:
create or replace function empcount(department in table_employee.dept_name%type)
return integer
as
ecount integer;
begin
select count(*) into ecount
from table_employee
where table_employee.dept_name=deparment and salary>500000;
return ecount;
end;
显而易见的是:
部门
与部门
:
create or replace function empcount(department in table_employee.dept_name%type)
^^^^^^^^^^
vvvvvvvvv
where table_employee.dept_name =deparment and salary>500000;
除此之外,您还可以:
SQL> create or replace function empcount
2 (department in table_employee.dept_name%type)
3 return integer
4 as
5 ecount integer;
6 begin
7 select count(*) into ecount
8 from table_employee
9 where table_employee.dept_name = department --> fixed
10 and salary > 50000;
11 return ecount;
12 end;
13 /
Function created.
SQL> select empcount(20) from dual;
EMPCOUNT(20)
------------
2
SQL>
显而易见的是:
部门
与部门
:
create or replace function empcount(department in table_employee.dept_name%type)
^^^^^^^^^^
vvvvvvvvv
where table_employee.dept_name =deparment and salary>500000;
除此之外,您还可以:
SQL> create or replace function empcount
2 (department in table_employee.dept_name%type)
3 return integer
4 as
5 ecount integer;
6 begin
7 select count(*) into ecount
8 from table_employee
9 where table_employee.dept_name = department --> fixed
10 and salary > 50000;
11 return ecount;
12 end;
13 /
Function created.
SQL> select empcount(20) from dual;
EMPCOUNT(20)
------------
2
SQL>
“忽略语句”始终是次要错误消息。什么是完整消息?“语句被忽略”始终是次要错误消息。完整的信息是什么?