Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP!!!! I'm getting compiling errors for this program
Try:
create or replace procedure get_data(cl_no IN client_master.client_no%type)
is
cursor c1(cno varchar2) is
select name from client_master
cname client_master.name%type;
begin
open c1(cl_no);
loop
fetch c1 into cname;
exit when c1%notfound;
end loop;
close c1;
end;
I think it was the get_data%notfound
Did you do a SHOW ERRORS in PL/SQL to check if you had any errors?
An alternative is:
CREATE OR REPLACE PROCEDURE get_data(cl_no IN client_master.client_no%type) IS
CURSOR c1(cno VARCHAR2) IS
SELECT name FROM client_master WHERE client_no=cno;
END LOOP;
END;
(You don't need to declare the cl_no in this case, and the cursor is
automatically opened and closed for you)
Kenton Ho
Perfit Computer Systems Group Inc.
dnanda <dnanda_at_netcom.ca> wrote in message
news:VncR2.22914$134.237816_at_tor-nn1.netcom.ca...
> i'm in a fix ....i am trying to run a procedure on sql*plus 8.0 and it is
as
> follows:
>
>
> create or replace procedure get_data(cl_no IN
client_master.client_no%type)
> is
> cname client_master.name%type;
> cursor c1(cno varchar2) is select name from client_master where
> client_no=cno;
> begin
> open c1(cl_no);
> loop
> fetch c1 into cname;
> exit when getdata%notfound;
> end loop;
> close c1;
> end;
>
> this procedure is showing compilation errors and sometimes saying that the
> object already exists..i have also tried changing names.
>
>
Received on Thu Apr 15 1999 - 10:53:44 CDT