Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 15 Jun 2001 @ 18:13:29 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Why redistributing?
 
From:   Rudel Simard

The default database is PROD and the table TCA_SELEC_LISTE_MED does not exist in it.

Here the DDL for the view

REPLACE VIEW PROD.D_CA_SMED_DEM_AJUS AS

SELECT
TDEM_PAIMT_MED.AGE_BEN_AN_SERV (NAMED AGE_BEN_AN_SERV),
TCA_AN_TRAIT_STATS_MED.AN_CIVIL_RETN (NAMED AN_CIVIL_RETN),
TDEM_PAIMT_MED.COD_CATG_LISTE_MED (NAMED COD_CATG_LISTE_MED),
TDEM_PAIMT_MED.COD_CLA_AHF (NAMED COD_CLA_AHF),
TDEM_PAIMT_MED.COD_CLIEN_MED (NAMED COD_CLIEN_MED),
TDEM_PAIMT_MED.COD_DIN (NAMED COD_DIN),
TDEM_PAIMT_MED.COD_NAT_EXPR_ORDNC (NAMED COD_NAT_EXPR_ORDNC),
TDEM_PAIMT_MED.COD_PGM_MED (NAMED COD_PGM_MED),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.COD_PLAN
     ELSE TAJUS_CONTB_BEN_MED.COD_PLAN_NOUV
END (CHAR(2)) (NAMED COD_PLAN),
TDEM_PAIMT_MED.COD_SCLA_AHF (NAMED COD_SCLA_AHF),
TDEM_PAIMT_MED.COD_SERV_1 (NAMED COD_SERV_1),
TDEM_PAIMT_MED.COD_SERV_2 (NAMED COD_SERV_2),
TDEM_PAIMT_MED.COD_SERV_3 (NAMED COD_SERV_3),
TDEM_PAIMT_MED.COD_SEXE (NAMED COD_SEXE),
TDEM_PAIMT_MED.COD_SSCLA_AHF (NAMED COD_SSCLA_AHF),
TDEM_PAIMT_MED.COD_STA_DECIS (NAMED COD_STA_DECIS),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.DAT_DECIS
     ELSE TAJUS_CONTB_BEN_MED.DAT_DECIS_AJUS_CONTB
END (NAMED DAT_DECIS),
TAJUS_CONTB_BEN_MED.DAT_DECIS_AJUS_CONTB (NAMED DAT_DECIS_AJUS_CONTB),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.DAT_PAIMT
     ELSE TAJUS_CONTB_BEN_MED.DAT_PAIMT_AJUS_BEN_MED
END (NAMED DAT_PAIMT),
TDEM_PAIMT_MED.DAT_SERV (NAMED DAT_SERV),
TAJUS_CONTB_BEN_MED.DD_PLAF_BEN_MED (NAMED DD_PLAF_BEN_MED),
TAJUS_CONTB_BEN_MED.DF_PLAF_BEN_MED (NAMED DF_PLAF_BEN_MED),
TDEM_PAIMT_MED.MNT_AUTOR_FRAIS_SERV (NAMED MNT_AUTOR_FRAIS_SERV),
TDEM_PAIMT_MED.MNT_AUTOR_MED (NAMED MNT_AUTOR_MED),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.MNT_COASS_PERCV
     ELSE TAJUS_CONTB_BEN_MED.MNT_COASS_MED_RECAL
END  (DECIMAL(6,2)) (NAMED MNT_COASS_PERCV),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.MNT_FRNCH_PERCV
     ELSE TAJUS_CONTB_BEN_MED.MNT_FRNCH_MED_RECAL
END  (DECIMAL(6,2)) (NAMED MNT_FRNCH_PERCV),
CASE WHEN TAJUS_CONTB_BEN_MED.NO_INDIV_BEN IS NULL
     THEN TDEM_PAIMT_MED.MNT_PAIMT
     ELSE TAJUS_CONTB_BEN_MED.MNT_PAIMT_RECAL
END  (DECIMAL(7,2)) (NAMED MNT_PAIMT),
TDEM_PAIMT_MED.NBR_JR_DUREE_TRAIT (NAMED NBR_JR_DUREE_TRAIT),
TDEM_PAIMT_MED.NO_INDIV_BEN (NAMED NO_INDIV_BEN),
TDEM_PAIMT_MED.NO_RAIS_SOC_PHCIE (NAMED NO_RAIS_SOC_PHCIE),
TDEM_PAIMT_MED.NO_RAMQ_DEM_MED (NAMED NO_RAMQ_DEM_MED),
TDEM_PAIMT_MED.NO_RAMQ_DEM_MED_REVIS (NAMED NO_RAMQ_DEM_MED_REVIS)

FROM DONNE_MAJ.TCA_AN_TRAIT_STATS_MED

INNER JOIN DONNE.TDEM_PAIMT_MED ON
TDEM_PAIMT_MED.DAT_SERV BETWEEN
TCA_AN_TRAIT_STATS_MED.DD_TRAIT_STATS_MED
                            AND TCA_AN_TRAIT_STATS_MED.DF_TRAIT_STATS_MED

LEFT JOIN DONNE.TAJUS_CONTB_BEN_MED ON
TDEM_PAIMT_MED.NO_INDIV_BEN = TAJUS_CONTB_BEN_MED.NO_INDIV_BEN
AND ((TDEM_PAIMT_MED.NO_RAMQ_DEM_MED =
TAJUS_CONTB_BEN_MED.NO_RAMQ_DEM_MED
AND
      TDEM_PAIMT_MED.NO_RAMQ_DEM_MED_REVIS IS NULL)
    OR
     (TDEM_PAIMT_MED.NO_RAMQ_DEM_MED_REVIS =
TAJUS_CONTB_BEN_MED.NO_RAMQ_DEM_MED))
;

Rudel



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023