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: ORA-06502: PL/SQL Error: numeric or value error

Re: ORA-06502: PL/SQL Error: numeric or value error

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 30 May 2007 08:07:44 -0700
Message-ID: <1180537662.889198@bubbleator.drizzle.com>


nodge wrote:
> I've got an PL/SQL Error:
>
> SQL> declare
> 2 v_tmp char(15);
> 3 BEGIN
> 4 v_tmp := '';
> 5 v_tmp := v_tmp || 'thw';
> 6 insert into thwtab values (42, v_tmp);
> 7 commit;
> 8 end;
> 9 /
> declare
> *
> ERROR at line 1:
> ORA-06502: PL/SQL: numeric or value error
> ORA-06512: at line 5
>
> Any Suggestions? Whats wrong?
>
> thx!
> nodge

There is almost no reason to ever use CHAR. You can not add three characters to what is already a 15 character string.

Also note that := '' has no meaning in Oracle as you are using it. v_tmp is already NULL and if you want to set it to NULL at some other point then just do so.

v_tmp := NULL;

In Oracle, unlike SQL Server, closed quotes is not null.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed May 30 2007 - 10:07:44 CDT

Original text of this message

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