Skip to content

Instantly share code, notes, and snippets.

@sevaine
Created June 7, 2017 00:28
Show Gist options
  • Save sevaine/4e3356af93f016ecef2ba9ecf370047e to your computer and use it in GitHub Desktop.
Save sevaine/4e3356af93f016ecef2ba9ecf370047e to your computer and use it in GitHub Desktop.

Revisions

  1. sevaine created this gist Jun 7, 2017.
    9 changes: 9 additions & 0 deletions update_http_url.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #
    # This should update the url to NEW_IP and NEW_PORT ( UNTESTED )
    #
    DEFINE NEW_IP = '10.10.10.10'
    DEFINE NEW_PORT = '443'
    UPDATE DB_NAME.TABLE_NAME
    SET field_name=REGEXP_REPLACE(field_name, '(http?://)(.*):(.*)/(.*)', '\1&NEW_IP:&NEW_PORT/\4')
    WHERE field_name LIKE 'http%'
    AND field_name NOT LIKE '%uri/path%'