Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL error

Re: PL/SQL error

From: Matthias Rogel <rogelREMOVE_at_THISweb.de>
Date: Tue, 28 Jan 2003 17:38:49 +0100
Message-ID: <b16bmp$ufvih$2@ID-86071.news.dfncis.de>


PLS-00360 cursor declaration without body needs return type

     Cause: A cursor declaration lacks either a body (SELECT statement) or a return type. If you want to separate a cursor specification from its body, a return type must be supplied, as in:

CURSOR c1 RETURN emp%ROWTYPE;

     Action: Add a SELECT statement or return type to the cursor declaration.

shiva wrote:
> the following procedure give errors:
>
> create or replace procedure plan(sys in varchar2) as
> iTmp integer;
> iKeyVal integer;
> cursor cur;
> ctname varchar2(40);
> begin
> open cur for 'select table_name from user_tab_columns where
> substr(table_name,1,2) = :1' using sys;
> loop
> exit when cur%NOTFOUND;
> fetch cur into ctname;
> execute immediate('select nvl(max(contkey),0) from '||ctname) into
> iTmp;
> if iTmp > iKeyVal then iKeyVal := iTemp; end if;
> end loop;
> close cur;
> execute immediate('drop sequence seq'||sys||'cntkeycontkey');
> dbms_output.put_line('create sequence seq'||sys||'cntkeycontkey
> cache 10 start with '||to_char(iKeyVal+1));
> execute immediate('create sequence seq'||sys||'cntkeycontkey cache
> 10 start with '||to_char(iKeyVal+1));
>
> execute immediate('select nvl(max(actionkey),0) from
> '||sys||'actns') into iKeyVal;
> execute immediate('drop sequence seq'||sys||'actkeyactionkey');
> execute immediate('create sequence seq'||sys||'actkeyactionkey cache
> 10 start with '||to_char(iKeyVal+1));
> dbms_output.put_line('create sequence seq'||sys||'actkeyactionkey
> cache 10 start with '||to_char(iKeyVal+1));
>
> end;
> /
>
> The error is:
> PLS-00360: cursor declaration without body needs return type
>
> Can anyone help.
> Thanks
> Shiva
Received on Tue Jan 28 2003 - 10:38:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US