I'm not very familiar with PL/SQL but I spotted a bunch of code on a buddy's project that looks very wrong to me, could I get a better alternative?
SET filter_conditions =
'
AND
(
((
processes.get_main_GC_id(nov.GCID) IN ('''', ''01'',''02'',''03'',''04'',''05'',''07'',''08'',''09'',''10'',''12'',''13'',''14'',''16'')
OR (processes.get_main_GC_id(nov.idGrupoCliente) IN (''23'', ''29'') AND ExtraNumber != 0)
OR (processes.get_main_GC_id(nov.idGrupoCliente) IN (''28'',''35'',''36'',''37''))
OR (processes.get_main_GC_id(nov.idGrupoCliente) IN (''40'') AND ExtraNumber != 0)
OR (processes.get_main_GC_id(nov.idGrupoCliente) IN (''151'', ''152'', ''153''))
) AND Cortesia != ''S'')
OR
(Cortesia = ''S'' AND cortesiaGrupo = 6 AND cortesiaCampania = 5 AND calle != '''')
)
';
Particularly the ridiculous amount of OR-INs. I edited a lot of them out but trust me there were hundreds. Is there a way to use a vector or something and check whether the variable matches?