string(233) " FROM tabarquivos A LEFT JOIN tabcompetencia cp on (A.NComp = cp.IdComp), tabtipoarq T, tabcatarq C WHERE (A.NTipoArq = T.IdTipoArq) AND (T.NTipoCat = C.Id) AND T.NTipoCat = 5 AND (VSite = 'S' or (VSite IS NULL)) AND NTipoArq = :cat "