color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia# color="darkblue"color="4F4A62" face="verdana" size="1">#dia#
  #session.autoridade#
SELECT utl_raw.cast_to_varchar2(a.comp_cd ) rid,DECODE(substr(COMP_HH_FIM,1,2),' ',substr(COMP_HH_INI,1,2) || ':' || substr(COMP_HH_INI,3,2) , substr(COMP_HH_INI,1,2) || ':' || substr(COMP_HH_INI,3,2) || ' às ' || substr(COMP_HH_FIM,1,2) || ':' || substr(COMP_HH_FIM,3,2)) DT, COMP_DS, CATE_COR_FUNDO, CATE_COR_TEXTO, CATE_ST_NEGRITO, CATE_ST_CAIXA, COMP_CATE_CD, CATE_DS, COMP_ST_EFETIVADO ,COMP_LOCAL, DECODE(COMP_LOCAL,NULL,COMP_DS || DECODE(COMP_ST_EFETIVADO,'S',' (a confirmar)','') , COMP_DS || ' - Local: '|| COMP_LOCAL || DECODE(COMP_ST_EFETIVADO,'S',' (a confirmar)','') ) LOCAL_REL, COMP_OBS, COMP_ST_LEMBRETE, COMP_ST_AVISO, comp_cd FROM COMPROMISSO_AGE a, CATEGORIA_AGE where COMP_CATE_CD = CATE_CD and CATE_AUTO_CD = #Session.autoridade_cd# and COMP_DT = to_date('#data_pesquisa#','dd/mm/yy') UNION ALL SELECT ' ',substr(CTA_HH_INI,1,2) || ':' || substr(CTA_HH_INI,3,2) DT,NULL, NULL,NULL,NULL,NULL,0,NULL,NULL, NULL, NULL, NULL, NULL, NULL,null FROM COMP_TEMP_AGE WHERE CTA_AUTO_CD = #Session.autoridade_cd# and CTA_HH_INI NOT IN (SELECT COMP_HH_INI FROM COMPROMISSO_AGE where COMP_DT = to_date('#data_pesquisa#','dd/mm/yy') and COMP_AUTO_CD = #Session.autoridade_cd#) ORDER BY 2
#rid#
     0000FF#FormatBaseN(CATE_COR_TEXTO,16)#"> #DT# 0000FF#FormatBaseN(CATE_COR_TEXTO,16)#"> #COMP_DS# #desc# (continua ...)
SELECT cate_ds, cate_cor_fundo, cate_cor_texto,cate_st_negrito FROM categoria_age where cate_auto_cd = #Session.autoridade_cd# order by cate_ds