Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-06502: PL/SQL Error: numeric or value error
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.orgReceived on Wed May 30 2007 - 10:07:44 CDT
![]() |
![]() |