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: 06502 - char string buffer too small error

Re: 06502 - char string buffer too small error

From: naniwadekar <nani3skip45_at_hotmail.com>
Date: 28 Jul 2004 19:44:47 -0700
Message-ID: <dd0da81c.0407281844.2b2562e@posting.google.com>


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

Original text of this message

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