#
#				ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquerymfile_kfocreaqsnotabview.txt
#	DESCRIPTION:	DQUERY definition of DQUERY kfocreaqsnotabview
#					this query creates all necessayry database structures for QSNOTAB data quality improvement
#
@querytitle			Strukturen in KFOQSDB für QSNOTAB anlegen
@querydescription	Lege all nötigen Strukturen für die Datqnqualitätsmaßnahme QSNOTAB an: V_QSNOTAB
@group				KFOQSDBCOM
@attributenames		cfgname:kfodbconfigname
@querytype			function
@function			seqtrans.seqtrans

~query.tsteps

#
# 0: create view V_QSNOTAB
#
pre_qexpression
	this.cfgname = this.query.cfgname;
sql					create or replace view V_QSNOTAB as
						select CONCAT(qse."ABRTraeger") as ABR_Ztraeger, CONCAT(qse."QSTraeger") as QS_Ztraeger, SUBSTR(qse."Ersteller",1,2) as ErstellerTraeger, qse.* 
						  from "QsEintrag" qse 
						 where "ABRTraeger"!="QSTraeger" and "StornoDatum" is null
cfgname				@@cfgname@@