How to escape the ' delimiter to add it to a REGEX pattern in SQL
I added a REGEX pattern to Talend to check for valid alpha only names, I got the pattern correct except I need to add the ' character as a valid name could be O'Brian. The only issue is that that character is used to enclose the pattern in the SQL statement and if I add it causes a syntax error. Would appreciate it if someone could tell me how to include the character to the below. Thank you in advance!
[size=2][font=Verdana, sans-serif]SELECT "LASTNAME" FROM "CAIDAN"."MEMBERMASTER" WHERE ( NOT REGEXP_LIKE("LASTNAME" ,
'^[a-zA-Z .-]+$' ) OR "LASTNAME" IS NULL )[/font][/size]
Yes, tried that and it seemed to cause a syntax error. I also noticed that a name like O'Brian in the test window also caused an error? It someone at Talend could take the REGEX posted and try it in Talend with a test name like O'Brian you should get the same error.