Home » RDBMS Server » Server Administration » Leading Zeros
Leading Zeros [message #374160] Mon, 28 May 2001 21:28 Go to next message
damos
Messages: 1
Registered: May 2001
Junior Member
Hi folks,

this might sound really dumb to you but i'm only a beginner at all this stuff! :)

I'm using Oracle 8 to do a project and the damn thing keeps removing the leading zero's from my table entries...but i need them there.

Any help you can give me on getting around this would be hugely appreciated!

Thanks in advance,
Damos
Re: Leading Zeros [message #374161 is a reply to message #374160] Tue, 29 May 2001 01:03 Go to previous messageGo to next message
Sarada
Messages: 27
Registered: April 2001
Junior Member
Oracle will not keep the leading zeroes in the number column. You just have to format the column before displaying according to your needs.

SQL> column cnt format 99999
SQL> select count(*) cnt from all_users;

CNT
------
70

SQL> column cnt format 00000
SQL> /

CNT
------
00070

HTH,

ORashark
Re: Leading Zeros [message #374177 is a reply to message #374161] Tue, 29 May 2001 11:25 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
If you want to store leading 0's in the tables, you must sore the data as a string, not a number (typically varchar2)
Previous Topic: Invoking methods on objects using SQL (not PL/SQL)
Next Topic: Difference between Select Decode.... and Select Replace...
Goto Forum:
  


Current Time: Wed Jul 03 18:16:45 CDT 2024