Re: ORA-06502 error when returning varchar2...

From: DA Morgan <>
Date: Sat, 08 Mar 2008 17:25:59 -0800
Message-ID: <>

buu wrote:
> I have an procedure with an query like:
> function aa() return varchar2 as
> begin
> update table1
> set field_1='xxx'
> where id=1
> returning field_2 into v_retval:
> return v_retval;
> end;
> I'm handling that simple function in 2005.
> But, in I receive an ORA 6502 error.. why? fileld size is not a
> problem.

I've read all of the replies so far and trying to get help when you do not include the real code, do not include the real error message, and do not include the version number is pretty bad. But one problem that jumps out here is that v_retval is undeclared. I am amazed this compiles at all.

Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington (replace x with u to respond)
Puget Sound Oracle Users Group
Received on Sat Mar 08 2008 - 19:25:59 CST

Original text of this message