Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Conversion of datatype

Re: Conversion of datatype

From: Eriovaldo do Carmo Andrietta <eca_at_widesoft.com.br>
Date: Tue, 27 Feb 2001 11:58:03 -0800
Message-ID: <F001.002BEAB6.20010227105524@fatcity.com>

Right, but
in pl/sql it does not work correcty ...

Why ?

I also did it in sql plus. It works correct but in procedure , no.

Eriovaldo do Carmo Andrietta
ICQ #102604225

> I threw this together and it works fine. I had to have the char field
> be 7 when the number was set to 6 otherwise I received ORA-06502:
> PL/SQL: numeric or value error: character string buffer too small
>
> SQL> declare
> 2 test_int number(6) := 1;
> 3 test_char char(7);
> 4
> 5 begin
> 6 test_char := to_char(test_int, '000009');
> 7 dbms_output.put_line(test_char);
> 8 test_int := 33;
> 9 test_char := to_char(test_int, '000009');
> 10 dbms_output.put_line(test_char);
> 11 end;
> 12 /
>
> 000001
> 000033
>
> - Brian
>
> --- Eriovaldo do Carmo Andrietta <eca_at_widesoft.com.br> wrote:
> > I have this sentence in a pl/sql block :
> >
> > w_nseqline := w_seqline;
> > select lpad(to_char(w_seqline, '00009'), '0') into
> > w_nseqline from
> > dual;
> > w_nseqline := w_seqline;
> >
> > w_nseqline is char(6);
> > w_seqline is number(6).
> >
> > I want the result '00001' but the code above is giving me '1
> > '
> >
> > How can I solve it ?
> >
> > Thanks
> >
> > Eriovaldo do Carmo Andrietta
> > ICQ #102604225
> >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Eriovaldo do Carmo Andrietta
> > INET: eca_at_widesoft.com.br
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing
> > Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Brian Wisniewski
> INET: brian_wisniewski_at_yahoo.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Eriovaldo do Carmo Andrietta
  INET: eca_at_widesoft.com.br

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 27 2001 - 13:58:03 CST

Original text of this message

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