# # action sequence for object action deletePersonAttribute # # 0: log start qexpression logger.debug("deletePersonAttribute: attribute: "+that.that.attribute) # 1: determine attribute names in database qexpression switch (that.that.attribute) { case "TELEFON": that.that.attarchtyp= "PERSINFO"; that.that.attname= "FON"; break; case "EMAIL": that.that.attarchtyp= "USEMAIL"; that.that.attname= "EMAIL"; break; case "MOBILE": that.that.attarchtyp= "PERSINFO"; that.that.attname= "MOBILE"; break; case "DEVOPSUSER": that.that.attarchtyp= "PERSINFO"; that.that.attname= "DEVOPSUSER"; break; default: that.that.errcoll.collect(null,"Illegal Person Attribute "+that.that.attribute); } that.that.deletesql = "delete from CCATT where ATTARCHTYP=::attarchtyp:: and ATTPARTYPE='CCUS' and ATTPARKURZ=::key:: and ATTNAME=::attname::"; # 2: check if attribute is present in database sql select * from CCATT where ATTARCHTYP=::attarchtyp:: and ATTPARTYPE='CCUS' and ATTPARKURZ=::key:: and ATTNAME=::attname:: named_params attarchtyp,key,attname result_varname cqpares # 3: determine if anything to delete if (that.that.cqpares.getRowCount()<1) goto fin # 4: perform the SQL optype dbselect sql_varname deletesql named_params attarchtyp,key,attname # finally, set chain query to re-display person info after having performed the action label fin qexpression that.that.query.chain_query = {dataname: "personinfo", uskurzz: that.that.key};