# # tsteps definition for seqtrans of query delperson # is linked into CCDB instance WSCUB64C as managed file ID gentext_00000000999999034 # # this sequence of steps will be executed for each record in the input dataset # (for documentation see http://zpvwiki.sozvers.at/wiki/CCDB_Abfragen_der_Type_function#seqtrans.seqtrans) # # 0: initialize once (REM: this could have been done in [init.qexpression] but is more consistent here # qexpression if (!this.is_setup) { /* initialize only once (also if more than one record in input dataset) */ this.protocol = new Array(); this.protocol.push([this.fname, this.dataname,"PROCESSING_STARTED","",""]); this.result = new aux.Result('dbresult'); this.result.setResultAttribute("resultname","PROTOCOL"); this.result.addMetaDataName("Activity"); this.result.addMetaDataName("Param_1"); this.result.addMetaDataName("Param_2"); this.result.addMetaDataName("Param_3"); this.result.addMetaDataName("Param_4"); this.result.rows = this.protocol; this.datasets.push(this.result); this.result = null; this.is_setup = true; /* executed only once (although DQUERY/delperson normally has only one input record...) */ } this.uskurzz = this.cdata.USKURZZ; this.protocol.push(["WILL_DELETE_PERSON","USKURZZ="+this.uskurzz,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"",""]); # # backup group associations # sql select * from CCUSAS where USKURZZ='@@USKURZZ@@' post_qexpression this.last_sql_result.setResultAttribute("resultname","BACKUP_CCUSAS"); this.datasets.push(this.last_sql_result); this.protocol.push(["BACKED_UP_CCUSAS","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"RECORDS="+this.last_sql_result.getRowCount(),""]); # # delete group associations # sql delete from CCUSAS where USKURZZ='@@USKURZZ@@' post_qexpression this.protocol.push(["DELETED_CCUSAS","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"",""]); # # backup extended attributes # sql select * from CCATT where ATTPARTYPE='CCUS' and ATTPARKURZ='@@USKURZZ@@' post_qexpression this.last_sql_result.setResultAttribute("resultname","BACKUP_CCATT"); this.datasets.push(this.last_sql_result); this.protocol.push(["BACKED_UP_CCATT","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"RECORDS="+this.last_sql_result.getRowCount(),""]); # # delete extended attributes # sql delete from CCATT where ATTPARTYPE='CCUS' and ATTPARKURZ='@@USKURZZ@@' post_qexpression this.protocol.push(["DELETED_CCATT","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"",""]); # # backup CCUS base entry # sql select * from CCUS where USKURZZ='@@USKURZZ@@' post_qexpression this.last_sql_result.setResultAttribute("resultname","BACKUP_CCUS"); this.datasets.push(this.last_sql_result); this.protocol.push(["BACKED_UP_CCUS","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"RECORDS="+this.last_sql_result.getRowCount(),""]); # # delete CCUS base entry # sql delete from CCUS where USKURZZ='@@USKURZZ@@' post_qexpression this.protocol.push(["DELETED_CCUS","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"",""]); # # everything done successfully # label RECDONE qexpression this.protocol.push(["PERSON_DELETED","USKURZZ="+this.cdata.USKURZZ,"NAME="+this.cdata.USVORNAME+" "+this.cdata.USFAMILIENNAME,"",""]);