Home » SQL & PL/SQL » SQL & PL/SQL » Filling zeros in the data
Filling zeros in the data [message #777] Mon, 04 March 2002 06:25 Go to next message
Sue
Messages: 49
Registered: May 2000
Member
Hi
I have a table with char data fields. Say, for one field (char 6) i have about 1000 records. I need to fill '0000' in front. For instance I have '20' in one field and it has to be '000020'. How do I do this with a sql plus command?
Sue
Re: Filling zeros in the data [message #780 is a reply to message #777] Mon, 04 March 2002 06:44 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
update your_table_name
set column_name=lpad(column_name,6,'0')

where 6 is the length of the character field
Previous Topic: Duplicates in sql query
Next Topic: Sql Queries
Goto Forum:
  


Current Time: Thu Apr 25 09:29:47 CDT 2024