-
I am trying to compile my package and I am getting the following error:
LINE/COL ERROR
-------- -----------------------------------------------------------------
7/1 PLS-00103: Encountered the symbol "CURSOR" when expecting one of
the following:
language
the first couple lines of my code look like:
create or replace package retention_pack as
procedure check_retention(
p_out out number) as
cursor c1 is
select * from ccfdba.retention where export = 'Y'
and table_name = 'TODD' and owner = 'CCFDBA';
Any ides?
-
create or replace package retention_pack is
procedure check_retention(
p_out out number) is
cursor c1 is
select * from ccfdba.retention where export = 'Y'
and table_name = 'TODD' and owner = 'CCFDBA';
Jeff Hunter
-
-
found it
I didn't have the word body in create or replace package body. Thanks for your help.
-
Here's a quickie example to get you started:
Code:
SQL> create or replace package jh1 is
2 function version return varchar2;
3 function doit return integer;
4 end jh1;
5 /
Package created.
SQL> create or replace package body jh1 is
2 function version return varchar2
3 is
4 ver varchar2(80) := '1.01';
5 begin
6 return ver;
7 end version;
8
9 function doit return integer
10 is
11 i number;
12 cursor c1 is select table_name from user_tables;
13
14 begin
15 i := 0;
16 for x in c1 loop
17 i:=i+1;
18 end loop;
19 return i;
20 end doit;
21 end jh1;
22 /
Package body created.
SQL> exec dbms_output.put_line(jh1.doit);
32
PL/SQL procedure successfully completed.
Jeff Hunter
-
create or replace package retention_pack as
procedure check_retention(
p_out out number);
cursor c1 is
select * from ccfdba.retention where export = 'Y'
and table_name = 'TODD' and owner = 'CCFDBA';
END retention_pack;
If you are planning to use the cursor in the package then you would have somethink like this. Or you can just define things like
create or replace package retention_pack as
procedure check_retention(
p_out out number);
end retention_pack;
and in your package body, under the procedure declaration you can write the cursor.
Sam
Thanx
Sam
Life is a journey, not a destination!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|