anchor.diff:  			var/datum/DBQuery/query_memodellist = SSdbcore.NewQuery("SELECT ckey FROM [format_table_name("mentor_memo")]")
   			if(!query_memodellist.Execute())
   				var/err = query_memodellist.ErrorMsg()
  +				qdel(query_memodellist)
   				log_game("SQL ERROR obtaining ckey from memo table. Error : \[[err]\]\n")
   				return
   			var/list/memolist = list()
   			while(query_memodellist.NextRow())
   				var/ckey = query_memodellist.item[1]
   				memolist += "[ckey]"
  +			qdel(query_memodellist)
   			if(!memolist.len)
   				to_chat(src, "No memos found in database.")
   				return
  
positive.code: 			var/datum/DBQuery/query_memodel = SSdbcore.NewQuery("DELETE FROM [format_table_name("memo")] WHERE ckey = '[target_sql_ckey]'")
  			if(!query_memodel.Execute())
  				var/err = query_memodel.ErrorMsg()
  				log_game("SQL ERROR removing memo. Error : \[[err]\]\n")
  				return
  			if(target_sql_ckey == sql_ckey)
  
negative.code: 				var/datum/DBQuery/update_query = SSdbcore.NewQuery("UPDATE [format_table_name("mentor_memo")] SET memotext = '[new_memo]', last_editor = '[sql_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE ckey = '[target_sql_ckey]'")
  				if(!update_query.Execute())
  					var/err = update_query.ErrorMsg()
  					qdel(update_query)
  					log_game("SQL ERROR editing memo. Error : \[[err]\]\n")
  					return
  				if(target_sql_ckey == sql_ckey)
  