Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 06502 - char string buffer too small error
Sybrand Bakker <sybrandb_at_hccnet.nl> wrote -
>
> >Today, I tried to run a piece of code which had run
> >before but got an error.
> >
> >Contents of myfile.sql are :
> >---------------------------------
> >declare
> >my_str char(2) ;
> >my_number integer ;
> >begin
> >my_number := 15 ;
> >my_str := to_char(my_number , '00') ;
> >end ;
> >/
> >---------------------------------
> >
>
> to_char(...,'fm00') to avoid the extra space in front of the number.
> Try
> select to_char(66,'00') from dual and compare it to select
> to_char(66,'fm00') and you will see in the former case you have a
> leading space.
>
If I run : 'select to_char(66,'00') from dual', I do
get a leading space. But when I run it with fm00,
the results screen's first row shows "TO_" (that is
3 characters), which suggests
to me that this time there is a trailing space. Is
my guess correct or not?
Of course one difference is that :
my_str char(2) ;
my_str = to_char(15,'format') ; works only with format = 'fm00'
and not with '00' format.
So my guess about trailing space looks shaky to me.
But then why does the first row show "TO_" instead of "TO" .
Received on Wed Jul 28 2004 - 21:44:47 CDT
![]() |
![]() |