Hi all,
 
I have the following select:
 
 
select  cons_nome as "Consultorio",
 dent_nome as "Dentista", 
 pac_nome as "Paciente", 
 pac_convenio as "Tipo", 
 Pac_matricula as "Matricula", 
 concat(consulta_dia, 
 "/", 
 consulta_mes, 
 "/", 
 consulta_ano) as "Data", 
 concat(Consulta_hora, 
 ":", 
 consulta_minuto) as "Hora", 
 Consulta_procedimento as "Proced."
 from consulta c, dentista d, paciente p, consultorio cc
 where  cc.cons_codigo  = c.consulta_codigo_cons
 and  c.consulta_codigo_dentista = d.dent_codigo
 and  c.consulta_codigo_paciente = p.pac_codigo
 and   cons_codigo   =   1
 and  consulta_ano  =  2004 
 and  consulta_mes  =  09 
 order by
 cons_codigo,
 dent_codigo,
 consulta_ano, 
 consulta_mes, 
 consulta_dia, 
 Consulta_hora, 
 consulta_minuto
 into outfile 'teste01.txt';
 
This select produces the file teste01.txt above:
 
It�¡lica Paulista       Dentista 1      MARIA DA DORES CIRIACO DE SOUZA S
99890   8/9/2004       17:20   ORTO
It�¡lica Paulista       Dentista 1      MARIBEL ROCIO MELGAR PACHECO    S
187635  8/9/2004       17:40   EXO
It�¡lica Paulista       Dentista 1      PAULA CRISTINA CAPUCHO  S
155181  15/9/2004       80     ORTO
It�¡lica Paulista       Dentista 1      JOSEANE DORIA RICARDO   S
172261  15/9/2004       820    ORTO
It�¡lica Paulista       Dentista 1      RICARDO TERASSI MORAES  S       \N
15/9/2004       840    EXO
It�¡lica Paulista       Dentista 1      RICARDO TERASSI MORAES  S       \N
15/9/2004       90     ORTO
It�¡lica Paulista       Dentista 1      ERICA GAMA PIMENTEL VIEIRA      S
199166  15/9/2004      9:40    ORTO
It�¡lica Paulista       Dentista 2      YASMIN MACHADO SILVA    S
194194  15/9/2004       1:0    ORTO
It�¡lica Paulista       Dentista 2      JAMIL DIAS SILVA        S
135453  15/9/2004       1:0    ORTO
It�¡lica Paulista       Dentista 2      FERNANDA MARTINS FERREIRA       N
\N      15/9/2004      15:0    ORTO
It�¡lica Paulista       Dentista 2      ARIANE TELES NASCIMENTO S       \N
15/9/2004       1:20   ORTO
It�¡lica Paulista       Dentista 2      IVONEIDE SOUSA DE MENEZES       S
148769  15/9/2004      15:40   ORTO
It�¡lica Paulista       Dentista 2      JOAO RICARDO DE ABRAHAO S       \N
15/9/2004       1:20   ORTO
It�¡lica Paulista       Dentista 2      AMANDA GONCALVES RODRIGUES      S
169180  15/9/2004      17:0    CLINICA
It�¡lica Paulista       Dentista 2      ALINE OLIVIA SILVA OLIVEIRA     S
142403  22/9/2004      10:0    ORTO
It�¡lica Paulista       Dentista 2      FABIANA SANCHES OCANHA  S
152810  22/9/2004       1:0    ORTO

and so on...
 
I need that the report have the column headers I put in the select and seems
like The following:          
 
 
Consultorio           Dentista        Paciente
Tipo  Matricula   Data        Hora   Proced.
 
It�¡lica Paulista      Dentista 1       MARIA DA DORES CIRIACO DE SOUZA
S       99890         8/9/2004    17:20   ORTO
                                                     MARIBEL ROCIO MELGAR
PACHECO       S       187635       8/9/2004    17:40   EXO
                                                     PAULA CRISTINA CAPUCHO
S       155181      15/9/2004    80       ORTO
                                                     JOSEANE DORIA RICARDO
S       172261     15/9/2004     820     ORTO
                                                     RICARDO TERASSI MORAES
S       \N             15/9/2004    840     EXO
                                                     RICARDO TERASSI MORAES
S       \N             15/9/2004    90       ORTO
                                                     ERICA GAMA PIMENTEL
VIEIRA                S       199166     15/9/2004    9:40    ORTO
                               Dentista 2       YASMIN MACHADO SILVA
S       194194     15/9/2004    1:0      ORTO
                                                     JAMIL DIAS SILVA
S       135453     15/9/2004    1:0      ORTO
                                                     FERNANDA MARTINS
FERREIRA               N       \N            15/9/2004    15:0    ORTO
                                                     ARIANE TELES NASCIMENTO
S       \N            15/9/2004    1:20    ORTO
                                                     IVONEIDE SOUSA DE
MENEZES               S       148769     15/9/2004    15:40   ORTO
                                                     JOAO RICARDO DE ABRAHAO
S       \N            15/9/2004     1:20    ORTO
                                                     AMANDA GONCALVES
RODRIGUES         S       169180     15/9/2004     17:0    CLINICA
                                                     ALINE OLIVIA SILVA
OLIVEIRA                  S       142403      22/9/2004    10:0    ORTO
                                                     FABIANA SANCHES OCANHA
S       152810      22/9/2004    1:0      ORTO
 
And this text "It�¡lica" should be "It�lica"
 
Can anybody help me please?


Laercio Xisto Braga Cavalcanti

Endless Technology Sistemas de Informa��o 

Rua Peixoto Gomide 321 

Cerqueira C�sar S�o Paulo SP 

CEP: 01409-001

Fone: +5511-3255-3430

mailto: [EMAIL PROTECTED]

 

Reply via email to