App Muncher

Issues faced - solutions identified - shared with community.

I was trying to search for ways to list all columns where special characters are entered.

If some one can help in doing a lookup in a certain tables where any column contains a special character.

Till now i'm using the following code to lookup one column at a time.


SELECT * FROM patients WHERE REGEXP_LIKE(forename, '[^]^A-Z^a-z^0-9^[^.^{^}^ ]' )
and
archv_flag = 'N'
;


Another way i tried to count the total number of records with special characters. Here we can specify multiple columns for lookup.

SELECT
special_char,
COUNT (*)
FROM
(
SELECT DISTINCT Forename, surname,
SUBSTR(surname,REGEXP_INSTR (surname, '[^a-z|A-Z|0-9| ]'),1) special_char
FROM PIMS.PATIENTS
WHERE REGEXP_LIKE (surname, '[^a-z|0-9| ]', 'i')
) temp
GROUP BY special_char;

Need a way to fetch primary constraint and of each row and table name.

No comments:

Post a Comment

| Designed by AppMuncher