SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- [VWDEX_OUT]
-- =================================================================
-- Vereint die Datenabfragen aus der OUTPUT und OUTPUT Reference TB
-- 
-- Returns: SQL table
-- =================================================================
-- Copyright (c) 2025 by Digital Data GmbH
--
-- Digital Data GmbH � Ludwig-Rinn-Strasse 16 � D-35452 Heuchelheim
-- Tel.: 0641/202360 � E-Mail: info-flow@digitaldata.works
-- =================================================================
-- Creation Date / Author:    28.02.2025 / MK
-- Version Date / Editor:     28.02.2025 / MK
-- Version Number:            1.0.0.0
-- =================================================================
-- History:

CREATE OR ALTER VIEW [dbo].[VWDEX_OUT]
as
SELECT 
			   [O].[GUID],
			   [O].[PROFILE_ID],
			   [O].[BATCH_ID],
			   [O].[CONTENT],
			   [O].[EXPORT_FILE_NAME],
			   [O].[EXPORT_FILE_HASH_TYPE],
			   [O].[EXPORT_FILE_HASH_VALUE],
			   [O].[EXPORT_WHEN],
			   [O].[EXPORT_STATUS],
			   [O].[EXPORT_STATUS_MESSAGE],
			   [O].[COMMENT],
			   [O].[ADDED_WHO],
			   [O].[ADDED_WHEN],
			   [O].[CHANGED_WHO],
			   [O].[CHANGED_WHEN],
			   [OR].[EXPORT_NUMBER],
			   [OR].[REFERENCE1],
			   [OR].[REFERENCE2],
			   [OR].[REFERENCE3],
			   [OR].[REFERENCE4],
			   [OR].[REFERENCE5],
			   [OR].[EXTERNAL_REFERENCE1],
			   [OR].[EXTERNAL_REFERENCE2],
			   [OR].[EXTERNAL_REFERENCE3],
			   [OR].[EXTERNAL_REFERENCE4],
			   [OR].[EXTERNAL_REFERENCE5]

	FROM       [TBDEX_OUT]            AS [O]
	INNER JOIN [TBDEX_OUT_REFERENCES] AS [OR] ON [O].[GUID] = [OR].[OUT_ID];

GO


