Example table (IP)
ID IP_NO PHONE
----- -------- ---------
101 192.205.230.70 +535950331
10# 192.205a.230.70 +672819233
103 192.205.230.72 +991873112
10! 192.205.230.78 +764616233
Query which I am using right now:
SELECT 'IP' as TABLE, COUNT(*) AS ERROR_COUNT, 'mt.ID' AS COLUMN FROM ip
WHERE LENGTH(TRIM(TRANSLATE(ip.id, '0123456789', ' '))) > 0
OR ip.id IS NULL
UNION
SELECT 'IP' as TABLE, COUNT(*) AS ERROR_COUNT, 'mt.ip_no' AS COLUMN FROM ip
WHERE LENGTH(TRIM(TRANSLATE(ip.ip_no, '0123456789.', ' '))) > 0
OR ip.ip_no IS NULL
UNION
SELECT 'IP' as TABLE, COUNT(*) AS ERROR_COUNT, 'mt.phone' AS COLUMN FROM ip
WHERE LENGTH(TRIM(TRANSLATE(ip.phone, '+0123456789', ' '))) > 0
OR ip.phone IS NULL
Result table of above queries:
TABLE ERROR_COUNT COLUMN
----- ----------- ------
IP 2 mt.id
IP 1 mt.ip_no
IP 0 mt.phone
Result table which I want:
TABLE INVALID_CHAR COLUMN
----- ----------- ------
IP # mt.id
IP ! mt.id
IP a mt.ip_no
Is it possible to transform above queries to see invalid characters in the result table?
