Index: trunk/ippTools/src/magictool.c
===================================================================
--- trunk/ippTools/src/magictool.c	(revision 18670)
+++ trunk/ippTools/src/magictool.c	(revision 18671)
@@ -256,4 +256,8 @@
             return false;
         }
+
+        psS64 magic_id = psDBLastInsertID(config->dbh); // Assigned identifier
+        run->magic_id = magic_id;
+
         if (!magicRunPrintObject(stdout, run, !simple)) {
             psError(PS_ERR_UNKNOWN, false, "failed to print object");
@@ -267,6 +271,4 @@
         }
         psFree(run);
-
-        psS64 magic_id = psDBLastInsertID(config->dbh); // Assigned identifier
 
         // Create a suitable insertion query for this run
