package and function
1.
create or replace package emp_ac as
type emprectyp is record(empid int, salaryy int);
cursor cc return emprectyp;
FUNCTION nth_highest_salary (n INT) RETURN EmpRecTyp;
end emp_ac;
2. create or replace package body emp_ac as
cursor cc return emprectyp is
select idd, salary from emp;
FUNCTION nth_highest_salary (n INT) RETURN EmpRecTyp IS
emp_rec emprectyp;
BEGIN
OPEN cc;
FOR i IN 1..n LOOP
FETCH cc INTO emp_rec;
END LOOP;
dbms_output.put_line('ff');
CLOSE cc;
RETURN emp_rec;
END nth_highest_salary;
end emp_ac;
3. I want to call the package and function. How do i do it?
declare
type highest is record();
begin
highest := emp_ac.nth_highest_salary(2);
dbms_output.put_line('ff');
end;
I get error :ORA-06550: line 2, column 24:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
<an identifier> <a double-quoted delimited-identifier>
current delete exists prior
Please advise.
Thanks.