Created
June 7, 2017 00:28
-
-
Save sevaine/4e3356af93f016ecef2ba9ecf370047e to your computer and use it in GitHub Desktop.
SQL Select update http url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment