Si solo necesitas saber si contiene la cadena, puedes probar con LIKE
Código SQL
[-]
cadena = 'ESTO ES UNA PRUEBA DE CADENAS';
resultado_contiene = '';
resultado_empieza = '';
resultado_termina = '';
if (cadena like '%PRUEBA%') then
resultado_contiene = 'CONTIENE PRUEBA';
else
resultado_contiene = 'NO CONTIENE PRUEBA';
if (cadena like 'PRUEBA%') then
resultado_empieza = 'EMPIEZA CON LA PALABRA PRUEBA';
else
resultado_empieza = 'NO EMPIEZA CON LA PALABRA PRUEBA';
if (cadena like '%PRUEBA') then
resultado_termina = 'TERMINA CON LA PALABRA PRUEBA';
else
resultado_termina = 'NO TERMINA CON LA PALABRA PRUEBA';
Código SQL
[-]
select * from clientes
where upper(nombre) like '%GOMEZ%'