USE [DD_ECM]
GO

/****** Object:  View [dbo].[VWCUST_RPTERGEBNISBERICHT_POS]    Script Date: 21.03.2024 17:05:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE VIEW [dbo].[VWCUST_RPTERGEBNISBERICHT_POS] as
SELECT

--4712 as DocID,
--'Fachliche Freigabe' as Prozessschritt,
--'CHAPPE' as Durch,
--'Ja' Status_Change,
--convert(Datetime,'2019-12-17 12:32:27',120) Wann
--,'' Kommentar
	dwDocID as DocID,
	(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(szValue,'SWB - ER 1.0 - ',''),'SWB - ER ',''),'3.0 - ',''),'4.0 - ',''),'5.0 - ',''),'~') WHERE SequentialOrder = 5) as Prozessschritt,
	(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(szValue,'PMProfile loaded: [',''),']','') ,'~') where SequentialOrder = 1) as Durch,
	(SELECT Data FROM FNDD_SPLIT_STRING(REPLACE(REPLACE(szValue,'PMProfile loaded: [',''),']','') ,'~') where SequentialOrder = 2) Status_Change,
	(SELECT Data FROM FNDD_SPLIT_STRING(szValue,'~') where SequentialOrder = 4) Wann,
	'' Kommentar
FROM 
	windream60.dbo.Vector 
where 
	--dwDocID = 785040 and 
	dwAttrID = 10040

GO


