Home » SQL & PL/SQL » SQL & PL/SQL » problem!!!
problem!!! [message #36840] Wed, 26 December 2001 01:05 Go to next message
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 Go to previous message
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

----------------------------------------------------------------------
Previous Topic: Re: Array Processing - Oracle URL
Next Topic: Re: How to Retrieve CLOB withADODB Command Parameter...?
Goto Forum:
  


Current Time: Wed Dec 25 10:12:21 CST 2024