Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ORA-06502 when using to_char function
Or even better, skip the to_char aswell, like:
a_string := v_num;
Works in Oracle 8, not certain about earlier versions.
//Jonas
In article <newscache$alsvxf$s1n$1_at_lnews.actcom.co.il>,
"Bastiaan Schaap" <bschaap_at_desyde.nl> wrote:
> Why are doing a select from dual anyway? It's easier to read:
> a_string := to_char( v_num );
> I don't know if you made a typo in the example you gave, but lose
the ,' you
> have in the to_char statement. The example I gave here will work
fine... So
> the answer is to use:
> a_string := to_char( v_num );
> This shouldn't cause any problems whatsoever.
>
> HTH,
>
> Bastiaan Schaap
> Oracle web development,
> Desyde BV - Baarn
> http://www.desyde.nl/
> tel. +31355411711
>
> <mfugazi_at_my-deja.com> wrote in message
news:8kvpma$cet$1_at_nnrp2.deja.com...
> > I have a stored procedure in Oracle with a
> > varchar2 out parameter.
> >
> > CREATE OR REPLACE procedure
> > a_proc ( a_string out varchar2 )
> >
> > In the body of the stored proc I've declared a
> > variable v_num number(9,3) which is initialized
> > by a select statement
> >
> > select some_col into v_num from some_table;
> >
> > Now, I want to convert v_num into a string and
> > assigned it to the out parameter.
> >
> > select to_char(v_num,') into a_string from dual;
> >
> > The stored proc is valid when I compile it, but I
> > get this error when I run it:
> >
> > ORA-06502, "PL/SQL: numeric or value error"
> >
> >
> > Can someone tell me what I'm doing wrong ?
> >
> > Thanks.
> >
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Jul 18 2000 - 00:00:00 CDT
![]() |
![]() |