Oracle - RegEx en Oracle pl/SQL, mirada positiva y negativa hacia el futuro

 
Vista:
sin imagen de perfil

RegEx en Oracle pl/SQL, mirada positiva y negativa hacia el futuro

Publicado por Andrea (1 intervención) el 08/11/2022 17:02:50
Tengo una cadena y me gustaría capturar todo antes de "where" pero el que No esta entre parentesis:

cadena:'update sa.table_bpm_proc_inst set assignee=(select parametro_8 from mqm.fc_launcher_parametrizacion where nombre_lista = tablas_permitidas_sentencia_libre and flag = 1 and parametro_2 = sa.table_bpm_proc_inst) ,focus_table_num =(select 65 from dual where 1=1),focus_objid= 2 where objid =-4t30000(d-je1000)abcde~0006461

La única solución que se me ocurrió utiliza la anticipación positiva, esto funciona cuando lo pruebo en https://regex101.com/

(.*)(?=where(?![^\(]*\)))



Pero ahora necesito usarlo en una declaración Oracle SQL:

select REGEXP_SUBSTR ('update sa.table_bpm_proc_inst set assignee=(select parametro_8 from mqm.fc_launcher_parametrizacion where nombre_lista = tablas_permitidas_sentencia_libre and flag = 1 and parametro_2 = sa.table_bpm_proc_inst) ,focus_table_num =(select 65 from dual where 1=1),focus_objid= 2 WHERE objid =-4t30000(d-je1000)abcde~0006461
','(.*)(?=where(?![^\(]*\)))',1,1,'i') from dual

y no funciona ya que (creo) mirar hacia adelante no es compatible. ¿Alguien puede ayudar con una expresión alternativa que funcione en pl/sql?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder