Index: trunk/ippTools/src/pztool.c
===================================================================
--- trunk/ippTools/src/pztool.c	(revision 16170)
+++ trunk/ippTools/src/pztool.c	(revision 16334)
@@ -344,4 +344,7 @@
     PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
 
+    // default values
+    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+
     // need to know exp_name, camera, telescope, class, class_id (to find the
     // pzPendingImfile entry and the URI for the newImfile entry.
@@ -360,4 +363,5 @@
             "       pzPendingImfile.*,"
             "       '%s'" // uri of downloaded file
+            "       '%d'" // fault code
             "   FROM pzPendingImfile"
             "   WHERE"
@@ -368,5 +372,5 @@
             "       AND pzPendingImfile.class_id = '%s'";
 
-        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
+        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id, code)) {
             // rollback
             if (!psDBRollback(config->dbh)) {
