Re: ERROR IS: ORA-01007: variable not in select list

From: Randolf Geist <mahrah_at_web.de>
Date: Wed, 3 Feb 2010 05:07:10 -0800 (PST)
Message-ID: <d948f1ff-a5db-4fe8-8edf-632a546ae90a_at_21g2000yqj.googlegroups.com>



On Feb 2, 3:26 pm, Sudhir <nshanmu..._at_gmail.com> wrote:
> I tried renaming to I_tcnum, but still I'm getting the same error
> "ERROR IS: ORA-01007: variable
> not in select list".

The most obvious explanation for your error would be that your FETCH statement is the actual culprit - the number of INTO variables might not be consistent with your query definition.

This simple test case raises the same error:

declare
  c sys_refcursor;
  s_dummy varchar2(1);
  s_dummy_culprit varchar2(1);
begin
  open c for 'select dummy from dual';
  fetch c into s_dummy, s_dummy_culprit; --<== here is the problem   close c;
end;
/

Regards,
Randolf

Oracle related stuff blog:
http://oracle-randolf.blogspot.com/

Co-author of the "OakTable Expert Oracle Practices" book: http://www.apress.com/book/view/1430226684 http://www.amazon.com/Expert-Oracle-Practices-Database-Administration/dp/1430226684 Received on Wed Feb 03 2010 - 07:07:10 CST

Original text of this message