Removing spaces from database text columns

I’ve noticed that the iPhone will not call a phone number that you have coded into your App, if it has spaces in.
This can be a problem if you have hundreds of rows in a Sqlite Database, which contain phone numbers that have spaces within the phone number.
Rather then manually updating them, which can take [...]

I’ve noticed that the iPhone will not call a phone number that you have coded into your App, if it has spaces in.

This can be a problem if you have hundreds of rows in a Sqlite Database, which contain phone numbers that have spaces within the phone number.

Rather then manually updating them, which can take many hours, here is a simple command to run.

UPDATE [TableName] SET PhoneNo = REPLACE(PhoneNo, ‘ ‘, ”)

This takes each row in turn and replaces any spaces with no spaces, regardless of how many spaces are in the phone number.
Hope this helps.

Cheers

Graham

 

Leave a Reply




Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!