PROMPT CREATE OR REPLACE VIEW vw_invbase
CREATE OR REPLACE VIEW vw_invbase (
  documento,
  status,
  empresa,
  filial,
  departamento,
  deposito,
  setor,
  corredor,
  endereco,
  produto,
  usuario1,
  usuario2,
  usuario3,
  usuario4,
  saldo,
  cont1a,
  cont2a,
  cont3a,
  cont4a
) AS
select
        DOCCAB_SEQ         as documento,
        INVITM_STATUS      as status,
        EMPRES_CODIGO      as empresa,
        FILIAL_CODIGO      as filial,
        DEPART_CODIGO      as departamento,
        DEPOSI_CODIGO      as deposito,
        SETOR_CODIGO       as setor,
        CORRED_CODIGO      as corredor,
        ENDERE_CODFANTASIA as endereco,
        PRDCAD_CODIGO      as produto,
        INVITM_USU1ACONT   as usuario1,
        INVITM_USU2ACONT   as usuario2,
        INVITM_USU3ACONT   as usuario3,
        INVITM_USU4ACONT   as usuario4,
        INVITM_SALDOWMS    as saldo,
        INVITM_QDE1ACONT   as cont1a,
        INVITM_QDE2ACONT   as cont2a,
        INVITM_QDE3ACONT   as cont3a,
        INVITM_QDE4ACONT   as cont4a
  from invitm
 where INVITM_STATUS != 9
/