Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Glendale california

    Cool Unanswered: Strip unwanted characters from phone no in Informix DB

    I need to remove any quotation marks from a phone no ie: (,),- field. The phone numbers are in the database as a string. I need to end up with only 10 numbers, then format this field as 999-999-9999 deleting anything that does not match. Please help I am a novice in SQL.

  2. #2
    Join Date
    Aug 2005
    you can use REPLACE sql function.

    insert into new_table
    select replace(no,'-','') from old_table;


    update old_table set no=replace(no,'-','');

    unfortunately there is no built-in support for regular expressions, so you have to user replace function for every different character you want to remove.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts