-- Schema: C6MartPeriodico
-- Stored Procedure: DM_DATI_REPORT

-- =============================================  
-- Author:  <Author,,Name>  
-- Create date: <Create Date,,>  
-- Description: <Description,,>  
-- =============================================  
CREATE procedure [C6MartPeriodico].[DM_DATI_REPORT]  
AS  
BEGIN  
  
 SET NOCOUNT ON;  
  
 DECLARE @ID_ELAB INT  
 DECLARE @TIPO_ELAB VARCHAR(1)  
  
 SET @ID_ELAB = C6MartPeriodico.GETIDELAB()  
 SET @TIPO_ELAB = C6MartPeriodico.GETTIPOELAB()  
  
 TRUNCATE TABLE C6MartPeriodico.DATI_REPORT  
  
 INSERT INTO C6MartPeriodico.[DATI_REPORT]  
           ([RETE]  
           ,[COD_FISCALE]  
           ,[INDIRIZZO]  
           ,[LOCALITA]  
           ,[PROVINCIA]  
           ,[CAP]  
           ,[NAZIONE]  
           ,[FLAG_REPORT]  
           ,[REPORT_DIAGN]  
           ,[REPORT_MONIT]  
           ,[DATA_REPORT]  
           ,[REPORT_FREQ]  
           ,[ID_ELAB]  
           ,[TIPO_ELAB])  
 SELECT   
  NULL AS RETE,  
  NULL AS COD_FISCALE,  
  NULL AS INDIRIZZO,  
  NULL AS LOCALITA,  
  NULL AS PROVINCIA,  
  NULL AS CAP,  
  NULL AS NAZIONE,  
  NULL AS FLAG_REPORT,  
  NULL AS REPORT_DIAGN,  
  NULL AS REPORT_MONIT,  
  NULL AS DATA_REPORT,  
  NULL AS REPORT_PROP,  
  @ID_ELAB AS ID_ELAB,  
  @TIPO_ELAB AS TIPO_ELAB  
 FROM C6STAGINGPERIODICO.CATITEMREF  
 WHERE 1=0  
  
END  
  

