How to extract area code from a 10 digit phone and put in another field in automated fashion

Report
Question

Please briefly explain why you feel this question should be reported .

Report
Cancel

I have a rather large database of phone numbers in 10 digit format.  I want to have a field in the database that just holds the prefix [ left(phonefield,3) ]

I can do update table set new-field=left(phone,3) and it will do it to all.

My question is:

Is there any way for this to happen automagically.  I.E. as soon as records are imported it would automatically do this vs me doing it manually???

in progress 0
MySQL 4 months 1 Answer 243 views 0

About Syruss

Answer ( 1 )

  1. ritwik

    Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    Well, you may use any programming language to achieve this.

Leave an answer

Browse

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>