ehr
ehr

Reputation: 153

"Procedure created with compilation error" cause by ORA-00936

I've created a procedure:

Create or Replace Procedure GetTotalEmployeesByDepartment
(
deptno in Employees.Department_Id%Type,
totalEmployees out number
)
as
begin
select cout(*) into totalEmployees from Employees
where Department_Id = deptno;
end;
/

with result:

Warning: Procedure created with compilation errors.

As I typed:

show errors;

Command line shown:

LINE/COL   ERROR
8/1        PL/SQL: SQL Statement ignored
8/13       PL/SQL: ORA-00936: missing expression

Do you know what may goes wrong? Why SQL ignose "cout" statement and missing "*"?

Upvotes: 0

Views: 55

Answers (1)

shippi
shippi

Reputation: 2474

Should it be not count(*) with n:)

Upvotes: 1

Related Questions