Telescope (core)
Como ajustar field-usages incorretas?
ADS.FAQ-12209
update componentes a
set text_04 =
(
select
case when tt.nome in ('DELETE','REPORT','LIST','SHEET','EXPORT') then 'view'
when tt.nome = 'IMPORT' and c.altura = 0 then 'opt'
when tt.nome = 'SEARCH' then 'search'
when c.altura = 0 then 'view'
when c.altura = -1 then 'hidden'
when c.opcional = 'N' then 'rqd'
else 'opt'
end
from componentes c
join componentes t on t.id = c.pai_comp_id
join componentes tt on tt.id = t.dominio_comp_id
where c.id = a.id
)
where id in
(
select c.id
from componentes c
join componentes t on t.id = c.pai_comp_id
join componentes tt on tt.id = t.dominio_comp_id
join componentes p on p.pai_comp_id = tt.id and p.nome='USAGE_OPTIONS'
join componentes s on s.id = c.raiz_id
where c.tipo_componente_id = 26
and (position (c.text_04 in p.notas) = 0
or c.text_04 is null
)
and a.tipo_componente_id = 26
)