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 -> PL/SQL error

PL/SQL error

From: shiva <shivas_bhat_at_yahoo.co.in>
Date: 28 Jan 2003 07:57:31 -0800
Message-ID: <fe32bedd.0301280757.63d0befa@posting.google.com>


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 - 09:57:31 CST

Original text of this message

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