On Tue, May 15, 2018 at 4:10 AM, tango ward <tangowar...@gmail.com> wrote:

>
> Hi,
>
> Sorry for asking question again.
>
> I would like to know if it is possible to control the phone number in SQL
> before inserting it to the destination DB?
>
> I have a model in Django:
>
> class BasePerson(TimeStampedModel):
>  phone_number = PhoneNumberField(max_length=50, verbose_name=_(u'phone
> number'), blank=True)
>
>
> The data for phone number that I am migrating doesn't have country code. I
> want to determine first if the number has country code in it, if it doesn't
> then I will add the country code on the number before INSERTING it to the
> destination database.
>
> Any suggestion will be highly appreciated.
>
>
> Thanks,
> J
>
​
I don't have any code for you, if that is what you are soliciting. I did
find a couple of informative web sites which help explain how international
phone numbers are formatted. These are known as E.164 numbers.


https://support.twilio.com/hc/en-us/articles/223183008-Formatting-International-Phone-Numbershttps://en.wikipedia.org/wiki/List_of_country_calling_codes#Alphabetical_listing_by_country_or_region

Note that the above mainly talk about how a number is formatted, not on how
to validate that it is an actual phone number. You must trust the end user.
Which is another can of worms. Case in point -- Yesterday I got 6 automated
phone calls from the local cable company to verify some installation. The
problem is, I am not installing anything. The person either gave them a bad
number or mistyped it into a web page or the customer service rep mistyped
it.​

-- 
We all have skeletons in our closet.
Mine are so old, they have osteoporosis.

Maranatha! <><
John McKown

Reply via email to