Home » SQL & PL/SQL » SQL & PL/SQL » package query
package query [message #223943] Mon, 12 March 2007 06:23 Go to next message
bittu1984
Messages: 1
Registered: February 2007
Location: hyderabad
Junior Member
hi every body
when i tried to create the following package the oracle server created the package with compilation errors...please guide
-----------------------------------------------------------
create or replace package employee_data as
type emp_rec_type is record(name varchar2(10),job varchar2(20),sal number);
type emp_cur_type is ref cursor return emp_rec_type;
procedure get_staff(dept in number,emp_cv in out emp_rec_type);
end employee_data;
create or replace package body employee_data as
procedure get_staff(dept in number,emp_cv in out emp_cur_type)
is
begin
open emp_cv for select name,job,sal
from emp
where deptno=dept;
end get_staff;
end employee_data;
Re: package query [message #223944 is a reply to message #223943] Mon, 12 March 2007 06:25 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
Can you send us the output from :
select * from dba_errors;

In that way we know what the errors are.
Re: package query [message #223994 is a reply to message #223944] Mon, 12 March 2007 10:29 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
The signature of the procedure in the spec and the body don't match. (spec: emp_rec_type; body: emp_cur_type).

Why is your ref cursor defined as IN OUT? Since you don't provide anything, you should make it an OUT parameter.
Re: package query [message #224071 is a reply to message #223943] Mon, 12 March 2007 18:20 Go to previous message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
Depending on the application you are using to compile the PL/SQL (SQL*Plus etc) you may need to enter a slash character on its own line after each PL/SQL block.

You can enter

show errors

in SQL*Plus immediately after attempting to compile some PL/SQL, and it will report compilation errors for that object; or you can enter

show errors package employee_data

or

show errors package body employee_data

etc
Previous Topic: how to fill gap between two dates
Next Topic: Newbie SQL Plus question
Goto Forum:
  


Current Time: Fri Dec 09 19:15:48 CST 2016

Total time taken to generate the page: 0.32103 seconds