Identificar motivo de Nomes/Matrículas/COd Único trocado no Balcão

Identificar motivo de Nomes/Matrículas/COd Único trocado no Balcão

1) Verificar se a pessoa procurada existe no BNWEB

SELECT ‘BNWEB – PESSOA’ AS tabela, bm.matricula, bp.cod_pessoa, bp.nome, bp.email
FROM tbibpes0 bp, tbibmat0 bm
WHERE bp.tit1 LIKE ‘CLAUDIA CRISTINA MINHOTO%’
AND bp.cod_pessoa = bm.cod_pessoa

2) Verificar a matricula, codigo unico e nome da pessoa procurada na VIEW de Integracao

SELECT ‘VIEW ‘ AS tabela, m.codigo AS matricula, m.cod_pessoa AS codigo_unico, fbibtit1(p.nome) AS nome, p.email
FROM VIBIBUSU0 p, VIBIBMAT0 m
WHERE fbibtit1(p.nome) LIKE ‘CLAUDIA CRISTINA MINHOTO%’
AND p.codigo = m.cod_pessoa

2.1) Anotar Matrícula(s) e Código(s) Único

3) Verificar se algumas das matriculas da VIEW já existe no BNWEB

SELECT ‘BNWEB – PESSOA’ AS tabela, bm.matricula, bp.cod_unico, bp.tit1
FROM tbibpes0 bp, tbibmat0 bm, tbibuni0 bu
WHERE ( bp.cod_unico IN( 4590153 ) OR bm.matricula IN ( ‘5200653880-2’, ‘2525178042-2’ ) )
AND bp.cod_pessoa = bm.cod_pessoa
AND bm.cod_unidade = bu.cod_unidade

POSIÇÃO: O cadastro do BNWEB é prioritário, ou seja, se já possuir a matricula ou cod_unico, a informação cadastrada terá prioridade em relação à VIEW.