problem!!! [message #36840] |
Wed, 26 December 2001 01:05 |
s arora
Messages: 1 Registered: December 2001
|
Junior Member |
|
|
Could u plz tell me what is the error in this code:its giving me error no PLS-00103 encountered the symbol "CREATE"
the code:
Create or replace PACKAGE nav_rec
as
TYPE getcur IS REF CURSOR;
p_cursor getcur;
Type reclist is table of p_cursor%ROWTYPE;
rec reclist;
PROCEDURE getrecords(r_from IN number,r_to IN number,rec OUT reclist);
END nav_rec;
Create or replace PACKAGE BODY nav_rec as
Create or replace PROCEDURE getrecords(r_from IN number,r_to IN number,rec OUT reclist)
as
BEGIN
record number;
i number :=1;
j number;
k number;
OPEN p_cursor FOR SELECT name FROM visitor ORDER BY name;
while p_cursor%found
loop
FETCH p_cursor INTO rec(i);
i := i+1;
exit when p_cursor%notfound;
close p_cursor;
end loop;
if r_from <=rec.count and r_to <=rec.count then
j := r_from;
k := r_to;
for record in j..k
loop
open p_cursor;
FETCH p_cursor INTO rec(record);
i := i+1;
end loop;
end if;
close p_cursor;
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line("no data");
WHEN TOO_MANY_ROWS THEN
dbms_output.put_line("too many rows");
WHEN OTHERS THEN
dbms_output.put_line("some error occurred");
end getrecords;
END nav_rec;
/
----------------------------------------------------------------------
|
|
|
Re: problem!!! [message #36842 is a reply to message #36840] |
Wed, 26 December 2001 03:57 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
remove create or replace in following sentence
Create or replace PROCEDURE getrecords(r_from IN number,r_to IN number,rec OUT reclist)
as
it should be
PROCEDURE getrecords(r_from IN number,r_to IN number,rec OUT reclist)
as
you dont need to use create or replace inside package
----------------------------------------------------------------------
|
|
|