Index: trunk/ippTools/src/difftool.c
===================================================================
--- trunk/ippTools/src/difftool.c	(revision 23616)
+++ trunk/ippTools/src/difftool.c	(revision 23630)
@@ -1384,5 +1384,5 @@
         psS64 exp_id = psMetadataLookupS64(NULL, row, "input_exp_id");
         psS64 input_id = psMetadataLookupS64(NULL, row, "input_warp_id");
-        psS64 template_id = psMetadataLookupS64(NULL, row, "template_warp_id");
+        const char *template = psMetadataLookupStr(NULL, row, "template_warp_id");
         const char *tess_id = psMetadataLookupStr(NULL, row, "tess_id");
         if (!exp_id || !input_id || !template_id || !tess_id) {
@@ -1413,8 +1413,7 @@
 
         // Convert identifiers to string, for insertion into query
-        psString diff = NULL, input = NULL, template = NULL; // String versions of identifiers
+        psString diff = NULL, input = NULL; // String versions of identifiers
         psStringAppend(&diff, "%" PRId64, run->diff_id);
         psStringAppend(&input, "%" PRId64, input_id);
-        psStringAppend(&template, "%" PRId64, template_id);
 
         if (!p_psDBRunQueryF(config->dbh, insert, diff, input, template, input, template)) {
