Re: Prefixing zeros for a number column value

Re: Prefixing zeros for a number column value

 

  

the data you select is number and it stores the value its own way ,but
when you can retrieve the value as you want why you are bothered about
storing it in lpad way ,As per my knowledge of oracle data is stored in
the tables as per their data type structure ,so number field won't allow
you to store the value this way

may be someone has other way of doing so but not in number datatype

Parveen


Albert wrote:
> Thank you praveen... But,
>
> I want that to happen while insertion.. not selection...
>
>
>
> Albert
>
> -----Original Message-----
> From: Parveen Kumar
> [mailto:oracledba-ezmlmshield-x47625873.[Email address protected]
> Sent: Tuesday, July 31, 2007 10:10 AM
> To: LazyDBA Discussion
> Subject: Re: Prefixing zeros for a number column value
>
>
> select lpad(roll,10,0) from t1;
>
> will do your job
>
> Parveen
>
>
> Albert wrote:
>> Hi All,
>>
>>
>>
>>
>>
>> Can this be accomplished???
>>
>> If yes, how?
>>
>>
>>
>>
>>
>> create table t1 (roll number(10));
>>
>>
>>
>> insert into t1 values(22);
>>
>>
>>
>> commit;
>>
>>
>>
>> select roll from t1;
>>
>> output should be 0000000022 and not 22.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Regards,
>>
>> Albert
>>
>>
>>
>>
>>
>>
>>
>> DISCLAIMER:
>> This message contains privileged and confidential information and is
> intended only for an individual named. If you are not the intended
> recipient, you should not disseminate, distribute, store, print, copy or
> deliver this message. Please notify the sender immediately by e-mail if
> you have received this e-mail by mistake and delete this e-mail from
> your system. E-mail transmission cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete or contain viruses. The sender,
> therefore, does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail transmission.
> If verification is required, please request a hard-copy version.
>>
>> ---------------------------------------------------------------------
>> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
>> To post a dba job: http://jobs.lazydba.com
>> To Subscribe : http://www.LazyDBA.com
>> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>>
>>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
> DISCLAIMER:
> This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>


Oracle LazyDBA home page