Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Ola pessoal, boa noite!
Venho aqui solicitar uma orientacao, dicas dos mais experientes.
Trabalho em uma empresa onde a pessoa que cuida do BAnco nao esta mais na empresa e deixou de um belo pepino para eu cuidar. Preciso gerar novos relatorios, e bem verdade que ja existe varias queryes montadas e funcionando perfeitamente.
Exemplo abaixo, e uma query funcionando prefeitamente e do campo que tanto necessito para futuras querys e utilizar com php mais oracle.
------------------------------------ QUERY CHAMADOS ABERTOS PARA DETERMINADA CLASSIFICAÇÃO----------------------------------------
/*OBS: ATRAVÉS DA ALTERAÇÃO DOS DADOS NOS CAMPOS
and f.tm_name = 'SERVIÇOS'
and g.tm_name = 'SISTEMAS CORPORATIVOS'
and h.tm_name = 'MOBILE'
and i.tm_name = 'REPROCESSAMENTO ARQUIVOS AFG'
PODE-SE GERAR O RELATÓRIO DETALHADO DE CHAMADOS ABERTOS PARA DETERMINADA CLASSIFICAÇÃO EM DETERMINADO PERÍODO.
BASTA ALTERAR O INTERVALO DA DATA NO CAMPO:
where trunc(a.swdatecreated) between '01-jan-2007' and '31-mai-2007'
*/
select trunc(a.swhdcaseid) chamado
, to_char(a.swdatecreated, 'dd/mm/yyyy hh24:mi:ss') Data_Abertura
, r.taname Responsavel
, c.taname solicitante
, cc.TACOSTCENTERCODE Centro_de_Custo
, cc.TANAME Área
, ben.taname Beneficiado
, f.tm_name Classificacao1
, g.tm_name Classificacao2
, h.tm_name Classificacao3
--, h.tacritical CRIT3
, i.tm_name Classificacao4
--, decode(i.tacritical, '1', 'CRÍTICO', 'NÃO') CRITICIDADE
, a.swnote Descricao
, j.swname Empresa
, k.swsitename Site
, b.taname fila
[b], w.swnote ultima_acao[/b] Esse campo que preciso, mas nao consigo encontrar em qual tabela do banco ela se encontra!!!
, to_char(w.swdatecreated, 'dd/mm/yyyy hh24:mi:ss') data_ultima_acao
, a.taclosedby ultima_acao_por
, d.taname Status
, e.taname Detalhe_Status
, decode(i.tm_prazo_resp, '', h.tm_prazo_resp, i.tm_prazo_resp) SLA_previsto
, decode(i.tm_und_tempo, '', h.tm_und_tempo, i.tm_und_tempo) Unidade_Tempo
--, to_char(thcw.TADATAPREVINICIAL, 'dd/mm/yyyy hh24:mi:ss') PREVISAO_INICIAL
, to_char(thcw.TADATAPREVFINAL, 'dd/mm/yyyy hh24:mi:ss') PREVISAO_FINAL
, a.swcreatedby Criado_Por
--, a.swreceivedvia Via_Abertura
from swbappsp.sw_hd_case a
, swbappsp.ta_fila b
, swbappsp.sw_person c
, swbappsp.ta_cost_center cc
, swbappsp.ta_status d
, swbappsp.ta_status_detail e
, swbappsp.tm_motivo f
, swbappsp.tm_motivo g
, swbappsp.tm_motivo h
, swbappsp.tm_motivo i
, swbappsp.sw_customer j
, swbappsp.sw_site k
, swbappsp.sw_person r
, swbappsp.sw_person ben
, swbappsp.sw_work_log w
, swbappsp.ta_hd_case_workflow thcw
--where b.swprovidergrpid in ('627','622','647')
where trunc(a.SWDATECREATED) between '01-abr-2009' and '09-ago-2009' -- LINHA PARA ALTERAÇÃO DA DATA --
and a.tafilaid = b.tafilaid(+)
and a.swreportedby = c.swpersonid
and c.tacostcenterid = cc.tacostcenterid(+)
and a.swcontactid = ben.swpersonid(+)
--and a.tastatusid = 2
and a.tastatusid = d.tastatusid
and a.tastatusdetailid = e.tastatusdetailsid
and a.tatype = f.tm_motivoid
and a.talevel1 = g.tm_motivoid
and a.talevel2 = h.tm_motivoid(+)
and a.talevel3 = i.tm_motivoid(+)
and j.swcustomerid(+) = a.tacustomerid
and k.swsiteid(+) = a.tasiteid
--and (k.swsitename = 'REGIONAL GOIANIA'
--and k.swsitename = 'REGIONAL CAMPINAS'
--or k.swsitename = 'REGIONAL PORTO ALEGRE (BIT)')
--and a.swcreatedby = '21014119'
--and c.taname = 'Mauro Benedito S. De Carvalho'
--and (f.tm_name in ('PROBLEMAS'))
--and (g.tm_name in ('REDE'))
--and (h.tm_name = 'SIGA')
--and (h.tm_name = 'CRIACAO DE LOGIN')
and d.taname = 'ABERTO'
--and g.tm_name in ('SISTEMAS CORPORATIVOS')
--and h.tm_name = 'P2K'
--and h.tm_name in ('WEB ACTIVATION (SISTEMA DE ATIVAÇÃO)','WEB ACTIVATION MIGRAÇÕES')
--and h.tm_name = 'CRIAÇÃO DE LOGIN DE REDE E E-MAIL'--,'DUVIDAS DE UTILIZACAO','ALTERAÇÃO DE PROCEDIMENTO','EXCLUSÃO DE PROCEDIMENTO','EXCLUSÃO DE SCRIPT','IMPLANTAÇÃO DE PROCEDIMENTO','IMPLANTAÇÃO DE SCRIPT')
--and i.tm_name = 'BACKUP - ERROS DE EXECUÇÃO'
and a.swassignedto = r.swpersonid(+)
and a.swhdcaseid = w.swobjectid(+)
and a.swhdcaseid = thcw.swhdcaseid(+)
and ((w.swworklogid = (select max(w2.swworklogid) from swbappsp.sw_work_log w2 where w2.swobjectid = a.swhdcaseid))
or (w.swobjectid is null))
and ((thcw.TAHDCASEWORKFLOWID = (select max(TAHDCASEWORKFLOWID) from swbappsp.ta_hd_case_workflow thcw2 where thcw2.swhdcaseid = a.swhdcaseid))
or (thcw.TAHDCASEWORKFLOWID is null))
--and sysdate > thcw.TADATAPREVFINAL
order by a.swhdcaseid;
select sysdate from dual
select *
from swbappsp.sw_hd_case
where swhdcaseid = 2209884
select *
from swbappsp.tm_motivo
select *
from swbappsp.sw_work_log
where swobjectid = 2208338
select *where swhdcaseid = 2438307
select *select *
from swbappsp.sw_person
select *
from swbappsp.sw_customer
O campo que tanto necessito: ultima_acaoUtilizo esse programa para gerar a query acima:
/applications/core/interface/imageproxy/imageproxy.php?img=http://www.uploadimagens.com/upload/3a51054c6db6ba89db16b84809992e98.jpg&key=c435863c1eee4867f4ab7221bd682c38092d30998d0327dbe8724af879dd2eb5" alt="Imagem Postada" />
Carregando comentários...