I don't know what your problem is because I just threw it into a proc
and executed it from sql*plus and sqlplus worksheet and it came back
with the correct results.

create or replace procedure test_proc as
        test_int        number(6) := 1;
        test_char       char(7);
...

SQL> exec test_proc
000001
000033

Sorry but it works for me.

- Brian

--- Eriovaldo do Carmo Andrietta <[EMAIL PROTECTED]> wrote:
> 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
> 
> ----- Original Message ----- 
> To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
> Sent: Tuesday, February 27, 2001 1:32 PM
> 
> 
> > 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> > > 
> > > 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]
> > 
> > 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to