Hello everyone
I'm trying to create a VDIC on my database but I keep receiving the error "invalid number of column names specified" and as result of that affect on creating the other error "table or view does not exist"
Thank you all
-----------------------------------------------------
Erro a partir da linha : 1 no comando -
CREATE OR REPLACE VIEW vdic_laudo_tst_rap --nome a ser dado a vdic
(
cd_multi_empresa, --os campos do select
nm_paciente,
CD_PACIENTE,
cd_atendimento,
nm_usuario,
dt_registro,
HIV,
SIFILIS,
REAGENTE,
NAO_REAGENTE,
NEGATIVO,
POSITIVO
)
AS
SELECT B.cd_multi_empresa, a.nm_paciente, A.CD_PACIENTE, b.cd_atendimento, F.nm_usuario, f.dt_registro,
Case
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'L_HIV') then 'HIV'
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'L_SIFILIS') then 'SIFILIS'
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'REAGENTELR') then 'REAGENTE'
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'N_REAGENTELR') then 'NAO REAGENTE'
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'POSITIVOLR') then 'POSITIVO'
when (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'NEGATIVOLR') then 'NEGATIVO'
else '' end STATUS,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'L_HIV' /*encontrar no descrição*/) THEN 1 END HIV,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'L_SIFILIS' /*encontrar no descrição*/) THEN 1 END SIFILIS,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'REAGENTELR' /*encontrar no descrição*/) THEN 1 END REAGENTE,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'N_REAGENTELR' /*encontrar no descrição*/) THEN 1 END NAO_REAGENTE,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'POSITIVOLR' /*encontrar no descrição*/) THEN 1 END NEGATIVO,
CASE
WHEN (DS_RESPOSTA = 'checked' and Ds_Pergunta = 'NEGATIVOLR' /*encontrar no descrição*/) THEN 1 END POSITIVO
from paciente a,
atendime b,
documento e,
registro_documento f,
registro_resposta g,
pergunta_doc h
where a.cd_paciente=b.cd_paciente(+)
and e.cd_documento=f.cd_documento
and b.cd_atendimento=f.cd_atendimento(+)
and f.cd_registro_documento=g.cd_registro_documento(+)
and g.cd_pergunta_doc=h.cd_pergunta_doc(+)
and g.cd_pergunta_doc IN ('4584','45855','45836','45837','45838','45839')
--and f.dt_registro between to_date ('01/07/2018','dd/mm/yyyy') and to_date ('28/07/2018','dd/mm/yyyy')
and g.ds_resposta = 'checked'
AND E.CD_DOCUMENTO = '814'
-- INICIO DO ERRO -
-
order by F.dt_registro asc,a.nm_paciente asc
Relatório de erros -
Erro de SQL: ORA-01730: número inválido de nomes de coluna especificados
01730. 00000 - "invalid number of column names specified" /*THIS ERROR I DON'T UNDERSTAND HOW TO FIX*/
*Cause:
*Action:
Erro a partir da linha : 111 no comando -
GRANT DELETE ON vdic_laudo_tst_rap TO mv2000
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 115 no comando -
GRANT INSERT ON vdic_laudo_tst_rap TO mv2000
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 119 no comando -
GRANT SELECT ON vdic_laudo_tst_rap TO mv2000
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 123 no comando -
GRANT UPDATE ON vdic_laudo_tst_rap TO mv2000
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 127 no comando -
GRANT DELETE ON vdic_laudo_tst_rap TO dbasgu
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 131 no comando -
GRANT INSERT ON vdic_laudo_tst_rap TO dbasgu
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 135 no comando -
GRANT SELECT ON vdic_laudo_tst_rap TO dbasgu
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 139 no comando -
GRANT UPDATE ON vdic_laudo_tst_rap TO dbasgu
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 143 no comando -
GRANT DELETE ON vdic_laudo_tst_rap TO mvintegra
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 147 no comando -
GRANT INSERT ON vdic_laudo_tst_rap TO mvintegra
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 151 no comando -
GRANT SELECT ON vdic_laudo_tst_rap TO mvintegra
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 155 no comando -
GRANT UPDATE ON vdic_laudo_tst_rap TO mvintegra
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 159 no comando -
GRANT DELETE ON vdic_laudo_tst_rap TO dbaps
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 163 no comando -
GRANT INSERT ON vdic_laudo_tst_rap TO dbaps
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 167 no comando -
GRANT SELECT ON vdic_laudo_tst_rap TO dbaps
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Erro a partir da linha : 171 no comando -
GRANT UPDATE ON vdic_laudo_tst_rap TO dbaps
Relatório de erros -
Erro de SQL: ORA-00942: a tabela ou view não existe
00942. 00000 - "table or view does not exist"
*Cause:
*Action: