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

Home -> Community -> Usenet -> c.d.o.tools -> Converting two numbers into one string

Converting two numbers into one string

From: Dino Hsu <dino1_nospam_at_ms1.hinet.net>
Date: Tue, 17 Apr 2001 11:26:50 +0800
Message-ID: <bhdndt0s0t302h6pe9prn3ja32upglvf9c@4ax.com>

Dear all,

When two numbers are to be converted into one string like this one: SELECT 2001 year, 12 month, LTRIM(TO_CHAR(2001,'0000')) || LTRIM(TO_CHAR(12,'00')) yyyymm FROM DUAL;

     year month YYYYMM
--------- --------- --------

     2001 12 200112

LTRIM has to be prefixed to both number conversions, which makes the SQL very time-consuming and the statement look ugly for a simple conversion like this. Any possibility to suppress the LTRIM? Thanks.

Dino Received on Mon Apr 16 2001 - 22:26:50 CDT

Original text of this message

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