WITH Query AS (
SELECT 'Insert into PERSON (PERSONID,STATUS,DISPLAYNAME,EMPLOYEETYPE) values (''JACOB'',''ACTIVE'',''Jacob'',(select * from user where userid=''JACOB''))' AS QueryText)SELECT
CASE
WHEN LOCATE('*' IN QueryText) > 0 THEN 'Contains *'
ELSE 'Does not contain *'
END AS result FROM Query;