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

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP! PL/SQL-LEADING ZERO

Re: HELP! PL/SQL-LEADING ZERO

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Sun, 05 Nov 2000 09:46:55 -0500
Message-ID: <3A0572DF.A14396F2@Unforgetable.com>

Ho wrote:

> I need to create a table with 1000 records. I issue the INSERT command
> within a loop.
>
> INSERT INTO TEST (RUNNO) VALUES(I)
>
> After running the SQL, the records are:
>
> 1
> 2
> 3.....
>
> What I want is :
>
> 0001
> 0002
> .
> .
> .
> 0999
> 1000
>
> How to achieve this ?
>
> Many thanks for your help in advance.

When yout select the records in sqlplus just use a 'column' command to format the data. No need to tamper with the actual data itself.

column mycol format '0999' Received on Sun Nov 05 2000 - 08:46:55 CST

Original text of this message

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