CREATE OR REPLACE VIEW VW_FCO_MUNI_TRA AS
SELECT compania,
       trabajador,
       substr(dato, 1, 2) dpto_tra,
       SubStr(dato, 4, 3) muni_tra
  FROM rel_trab_agr a
 WHERE rtrim(ltrim(agrupacion)) = (SELECT x.dato
                       FROM vw_fdt_parametros x
                      WHERE x.pais = 'COL'
                        AND x.compania = a.compania
                        AND x.parametro = 'autoliq'
                        AND x.secuencia = 44)


