#
#			ITSV GmbH
#	CCDB - Command and Control Database
#
#	FILE:			dquerymfile_tableinfo.txt
#	DESCRIPTION:	DQUERY definition for DQUERY tableinfo
#					display information about a table in CCDB and provide links to activities
#
@querytitle			Informationen über Tabelle der CCDB
@group				DBADMIN
@querydescription	zeigt Informationen über eine Tabelle in einer Datenbank and
@attributenames		tabname:ccdbtablename
@querytype			function
@function			seqtrans.seqtrans

~query.tsteps

#
# <<TSTEPNUM:0>>: record count
#
sql					select count(*) from @@tabname@@
result_varname		cntres
post_qexpression
	this.cntres.title = "Anzahl Datensätze in Tabelle "+this.query.tabname;
	this.ppush({type: 'result', result: this.cntres });

#
# <<TSTEPNUM:1>>: description
#
sql					describe @@tabname@@
result_varname		descres
actext				<h3>Weitere Aktionen</h3>
					<ul>
					<li><a href="/dquery?dataname=SAVESELECTBIGFILE&tabname={{tabname}}">Tabelle {{tabname}} in managed file exportieren</a>
					</ul>
post_qexpression
	this.descres.title = "Struktur der Tabelle "+this.query.tabname;
	this.descres.bottomtext =	this.tstep.actext;
	this.ppush({type:'result',result:this.descres});
