[firebase-br] Erro View
Daniel Reis
daniel em lojasimpacto.com.br
Ter Nov 25 19:40:56 -03 2008
Estou tendando criar a view abaixo e está dando o seguinte erro.
This operation is not defined for system tables.
unsuccessful metadata update.
STORE RDB$RELATION_FIELDS failed.
attempt to store duplicate value (visible to active transactions) in unique index "RDB$INDEX_15".
CREATE VIEW VW_COBR
(CPJ_CDCLII006
,CPJ_CDCLII006
,CPJ_RZSOCA060
,CPJ_ENDERA035
,CPJ_BAIRRA020
,CEP_CDCEPI005
,CEP_DGCEPI003
,CPJ_CIDADA020
,CPJ_CDUFEA030
,CPF_EMCONA050
,CRE_DTVEND000
,CRE_DEPARA002
,CRE_VALORN017)
AS
SELECT CPJ_CDCLII006
,CPJ_CDCLII006
,CPJ_RZSOCA060
,CPJ_ENDERA035
,CPJ_BAIRRA020
,CEP_CDCEPI005
,CEP_DGCEPI003
,CPJ_CIDADA020
,CPJ_CDUFEA030
,CPF_EMCONA050
,CRE_DTVEND000
,CRE_DEPARA002
,CRE_VALORN017
FROM TB_CPJ CP1 INNER JOIN TB_CPF CP2 ON (CP1.CPJ_CDCLII006 = CP2.CPJ_CDCLII006)
INNER JOIN TB_CRE CP3 ON (CP1.CPJ_CDCLII006 = CP3.CPJ_CDCLII006)
AND CP3.CRE_DEPARA002 <> 00 AND CPJ_CDCLII006 IN
(SELECT CPJ_CDCLII006
FROM TB_CPJ CPJ INNER JOIN TB_CRE CRE ON (CPJ.CPJ_CDCLII006 = CRE.CPJ_CDCLII006)
INNER JOIN TB_CPF CPF ON (CPJ.CPJ_CDCLII006 = CPF.CPJ_CDCLII006)
WHERE
CRE.CRE_SERIEA003 = 'UNI'
AND CRE.CRE_SITUAA001 <> 6
AND CRE.EMP_CDEMPA003 = '001'
AND CRE.CRE_DTVEND000 < (SELECT cast ('now' as timestamp) - 120 from rdb$database)
AND CRE.CRE_VLPAGN017 < CRE.CRE_VALORN017
AND CRE.CRE_EMFATA003 <> '1'
AND CPJ.CPJ_CCOEMA001 = 'S'
AND CRE.CRE_VALORN017 > 5
AND CRE.CPJ_CDCLII006 NOT IN (29,85) );
____________________________________________________
Daniel Reis
Mais detalhes sobre a lista de discussão lista