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: Brian Wisniewski <brian_wisniewski_at_yahoo.com>
Date: Tue, 27 Feb 2001 08:58:35 -0800
Message-ID: <F001.002BE752.20010227083202@fatcity.com>

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


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).
Received on Tue Feb 27 2001 - 10:58:35 CST

Original text of this message

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