Subject | It works on FB 2.5 but does not work in FB 1.5 |
---|---|
Author | Israel Pinheiro |
Post date | 2016-06-23T16:39:35Z |
I created a view that works perfectly on FB 2.5, but now need to create the
same view on FB 1.5, but appears error in creation. Can help me?
CREATE OR ALTER VIEW ESPELHO(
DTMOVPROD,
TIPOMOV,
CODNAT,
CODVENDA,
CODCOMPRA,
CODPROD,
DESCPROD,
CODFISC,
TIPOMOVPROD,
DOCMOVPROD,
CODALMOX,
CODLOTE,
QTDMOVPROD,
PRECOMOVPROD,
ESTOQMOVPROD,
SLDMOVPRODAX,
TIPOPROD,
CUSTOMPMMOVPRODAX,
SLDMOVPROD,
CUSTOMPMMOVPROD,
CODMOVPROD,
CODEMPTM,
CODEMP,
CODFILIALTM,
CODFILIAL,
SALDO,
NOME)
AS
SELECT
MP.DTMOVPROD,
TM.TIPOMOV,
MP.CODNAT,
MP.CODVENDA,
MP.CODCOMPRA,
MP.CODPROD,
eq.descprod,
eq.codfisc,
MP.TIPOMOVPROD,
MP.DOCMOVPROD,
MP.CODALMOX,
MP.CODLOTE,
MP.QTDMOVPROD,
MP.PRECOMOVPROD,
MP.ESTOQMOVPROD,
MP.SLDMOVPRODAX,
EQ.TIPOPROD,
MP.CUSTOMPMMOVPRODAX,
MP.SLDMOVPROD,
MP.CUSTOMPMMOVPROD,
MP.CODMOVPROD,
MP.CODEMPTM,
TM.CODEMP,
MP.CODFILIALTM,
TM.CODFILIAL,
(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,
CLI.NOMECLI
CODTIPOMOV
FROM EQMOVPROD MP, EQTIPOMOV TM
INNER JOIN EQPRODUTO eq on mp.codprod = eq.codprod
inner join vdvenda vd on mp.codvenda=vd.codvenda
inner join vdcliente cli on vd.codcli = cli.codcli
where MP.CODEMPTM=TM.CODEMP AND MP.CODFILIALTM=TM.CODFILIAL AND
MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' and mp.codcompra is null
union all
SELECT MP.DTMOVPROD,
TM.TIPOMOV,
MP.CODNAT,
MP.CODVENDA,
MP.CODCOMPRA,
MP.CODPROD,
eq.descprod,
eq.codfisc,
MP.TIPOMOVPROD,
MP.DOCMOVPROD,
MP.CODALMOX,
MP.CODLOTE,
MP.QTDMOVPROD,
MP.PRECOMOVPROD,
MP.ESTOQMOVPROD,
MP.SLDMOVPRODAX,
EQ.TIPOPROD,
MP.CUSTOMPMMOVPRODAX,
MP.SLDMOVPROD,
MP.CUSTOMPMMOVPROD,
MP.CODMOVPROD,
MP.CODEMPTM,
TM.CODEMP,
MP.CODFILIALTM,
TM.CODFILIAL,
(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,
FORN.RAZFOR
CODTIPOMOV
FROM EQMOVPROD MP, EQTIPOMOV TM
INNER JOIN EQPRODUTO eq on mp.codprod = eq.codprod
inner join cpcompra cp on mp.codcompra = cp.codcompra
inner join cpforneced forn on cp.codfor =forn.codfor
where MP.CODEMPTM=TM.CODEMP AND MP.CODFILIALTM=TM.CODFILIAL AND
MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' and mp.codvenda is null
;
---
Este email foi escaneado pelo Avast antivĂrus.
https://www.avast.com/antivirus
[Non-text portions of this message have been removed]
same view on FB 1.5, but appears error in creation. Can help me?
CREATE OR ALTER VIEW ESPELHO(
DTMOVPROD,
TIPOMOV,
CODNAT,
CODVENDA,
CODCOMPRA,
CODPROD,
DESCPROD,
CODFISC,
TIPOMOVPROD,
DOCMOVPROD,
CODALMOX,
CODLOTE,
QTDMOVPROD,
PRECOMOVPROD,
ESTOQMOVPROD,
SLDMOVPRODAX,
TIPOPROD,
CUSTOMPMMOVPRODAX,
SLDMOVPROD,
CUSTOMPMMOVPROD,
CODMOVPROD,
CODEMPTM,
CODEMP,
CODFILIALTM,
CODFILIAL,
SALDO,
NOME)
AS
SELECT
MP.DTMOVPROD,
TM.TIPOMOV,
MP.CODNAT,
MP.CODVENDA,
MP.CODCOMPRA,
MP.CODPROD,
eq.descprod,
eq.codfisc,
MP.TIPOMOVPROD,
MP.DOCMOVPROD,
MP.CODALMOX,
MP.CODLOTE,
MP.QTDMOVPROD,
MP.PRECOMOVPROD,
MP.ESTOQMOVPROD,
MP.SLDMOVPRODAX,
EQ.TIPOPROD,
MP.CUSTOMPMMOVPRODAX,
MP.SLDMOVPROD,
MP.CUSTOMPMMOVPROD,
MP.CODMOVPROD,
MP.CODEMPTM,
TM.CODEMP,
MP.CODFILIALTM,
TM.CODFILIAL,
(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,
CLI.NOMECLI
CODTIPOMOV
FROM EQMOVPROD MP, EQTIPOMOV TM
INNER JOIN EQPRODUTO eq on mp.codprod = eq.codprod
inner join vdvenda vd on mp.codvenda=vd.codvenda
inner join vdcliente cli on vd.codcli = cli.codcli
where MP.CODEMPTM=TM.CODEMP AND MP.CODFILIALTM=TM.CODFILIAL AND
MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' and mp.codcompra is null
union all
SELECT MP.DTMOVPROD,
TM.TIPOMOV,
MP.CODNAT,
MP.CODVENDA,
MP.CODCOMPRA,
MP.CODPROD,
eq.descprod,
eq.codfisc,
MP.TIPOMOVPROD,
MP.DOCMOVPROD,
MP.CODALMOX,
MP.CODLOTE,
MP.QTDMOVPROD,
MP.PRECOMOVPROD,
MP.ESTOQMOVPROD,
MP.SLDMOVPRODAX,
EQ.TIPOPROD,
MP.CUSTOMPMMOVPRODAX,
MP.SLDMOVPROD,
MP.CUSTOMPMMOVPROD,
MP.CODMOVPROD,
MP.CODEMPTM,
TM.CODEMP,
MP.CODFILIALTM,
TM.CODFILIAL,
(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,
FORN.RAZFOR
CODTIPOMOV
FROM EQMOVPROD MP, EQTIPOMOV TM
INNER JOIN EQPRODUTO eq on mp.codprod = eq.codprod
inner join cpcompra cp on mp.codcompra = cp.codcompra
inner join cpforneced forn on cp.codfor =forn.codfor
where MP.CODEMPTM=TM.CODEMP AND MP.CODFILIALTM=TM.CODFILIAL AND
MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' and mp.codvenda is null
;
---
Este email foi escaneado pelo Avast antivĂrus.
https://www.avast.com/antivirus
[Non-text portions of this message have been removed]