#
#	ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquerymfile_tstpopulate.txt
#	DESCRIPTION:	DQUERY definition for CCDB DQUERY "tstpopulate"
#					a DQUERY executing queries with placeholders to populate()
#	HISTORY:
#		Date		Author		Description
#		20220103	WSC			created
#
@group				TEST
@querytitle 		Test von Platzhaltern in queries und SQL
@querydescription	erzeugt ein SQL mit Platzhaltern
# @input_encoding		iso-8859-15
@querytype			function
@function			seqtrans.seqtrans
@title				Ausgabe tstpopulate
@init.qexpression
	this.options.maxrecsteps = 1000000;

~query.tsteps

#
#
#
# sql		delete from SVCLMVBRFASVTTAG where TRAEGER='31'

#
#	<<TSTEPNUM:1>>:
#
pre_qexpression
	this.local.traeger = "31";
	this.local.dokdat = "2022-01-03";
	this.local.datnum = "20220103";
	this.local.count = 4711;
sql_mysql		insert into SVCLMVBRFASVTTAG(TRAEGER,DOKUMENT_DAT,MELDUNGS_DATUM,ANZAHL_MELDUNGEN) values(::traeger::,::dokdat::,::datnum::,::count::)
					on duplicate key update ANZAHL_MELDUNGEN=ANZAHL_MELDUNGEN+::count::
named_params	traeger,datnum,dokdat,count
result_varname sql0res
post_qexpression
	this.result = this.sql0res;

#
#	<<TSTEPNUM:2>>:
#
sql		select * from SVCLMVBRFASVTTAG where TRAEGER='31'
result_varname	sql1res
post_qexpression
	this.result = this.sql1res;