Index: trunk/ippTools/src/flatcorr.c
===================================================================
--- trunk/ippTools/src/flatcorr.c	(revision 25782)
+++ trunk/ippTools/src/flatcorr.c	(revision 25784)
@@ -39,4 +39,5 @@
 static bool addchipMode(pxConfig *config);
 static bool addcameraMode(pxConfig *config);
+static bool advancecameraMode(pxConfig *config);
 static bool dropchipMode(pxConfig *config);
 static bool dropcameraMode(pxConfig *config);
@@ -73,4 +74,5 @@
         MODECASE(FLATCORR_MODE_ADDCHIP,        addchipMode);
         MODECASE(FLATCORR_MODE_ADDCAMERA,      addcameraMode);
+        MODECASE(FLATCORR_MODE_ADVANCECAMERA,  advancecameraMode);
         MODECASE(FLATCORR_MODE_DROPCHIP,       dropchipMode);
         MODECASE(FLATCORR_MODE_DROPCAMERA,     dropcameraMode);
@@ -297,8 +299,8 @@
     // start a transaction so we don't end up with an exp without any associted
     // imfiles
-    if (!psDBTransaction(config->dbh)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
+    // if (!psDBTransaction(config->dbh)) {
+    //     psError(PS_ERR_UNKNOWN, false, "database error");
+    //     return false;
+    // }
 
     // create a new flatcorrRun
@@ -333,4 +335,9 @@
     row->corr_id = corr_id;
 
+    // if (!psDBCommit(config->dbh)) {
+    //     psError(PS_ERR_UNKNOWN, false, "database error");
+    //     return false;
+    // }
+
     flatcorrRunPrintObject (stdout, row, !simple);
     return true;
@@ -378,7 +385,26 @@
 }
 
+static bool addcameraMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    // required
+    PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false);
+    PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false);
+    PXOPT_LOOKUP_S64(cam_id, config->args, "-cam_id", true, false);
+
+    // add a flatcorrCamLink (initial state has include = TRUE)
+    // XXX should add checks that the chip_id and corr_id are in ChipLink
+    if (!flatcorrCamLinkInsert(config->dbh, corr_id, chip_id, cam_id, 1)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
+        return false;
+    }
+
+    return true;
+}
+
 // select the flatcorr chip runs that have completed and for which there is no camera entry
 // queue a new camera run for them
-static bool addcameraMode(pxConfig *config)
+static bool advancecameraMode(pxConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(config, false);
Index: trunk/ippTools/src/flatcorr.h
===================================================================
--- trunk/ippTools/src/flatcorr.h	(revision 25782)
+++ trunk/ippTools/src/flatcorr.h	(revision 25784)
@@ -29,4 +29,5 @@
     FLATCORR_MODE_ADDCHIP,
     FLATCORR_MODE_ADDCAMERA,
+    FLATCORR_MODE_ADVANCECAMERA,
     FLATCORR_MODE_DROPCHIP,
     FLATCORR_MODE_DROPCAMERA,
Index: trunk/ippTools/src/flatcorrConfig.c
===================================================================
--- trunk/ippTools/src/flatcorrConfig.c	(revision 25782)
+++ trunk/ippTools/src/flatcorrConfig.c	(revision 25784)
@@ -83,4 +83,10 @@
     psMetadataAddS64(addchipArgs, PS_LIST_TAIL, "-chip_id", 0,            "define Chip ID (required)", 0);
 
+    // -addcamera
+    psMetadata *addcameraArgs = psMetadataAlloc();
+    psMetadataAddS64(addcameraArgs, PS_LIST_TAIL, "-corr_id", 0,            "define Flat Correction ID (required)", 0);
+    psMetadataAddS64(addcameraArgs, PS_LIST_TAIL, "-chip_id", 0,            "define Chip ID (required)", 0);
+    psMetadataAddS64(addcameraArgs, PS_LIST_TAIL, "-cam_id", 0,             "define Camera ID (required)", 0);
+
     // -dropchip
     psMetadata *dropchipArgs = psMetadataAlloc();
@@ -88,9 +94,9 @@
     psMetadataAddS64(dropchipArgs, PS_LIST_TAIL, "-chip_id", 0,            "define Chip ID (required)", 0);
 
-    // -addcamera
-    psMetadata *addcameraArgs = psMetadataAlloc();
-    psMetadataAddU64 (addcameraArgs, PS_LIST_TAIL, "-limit",   0, "limit result set to N items", 0);
-    psMetadataAddBool(addcameraArgs, PS_LIST_TAIL, "-simple",  0, "use the simple output format", false);
-    psMetadataAddBool(addcameraArgs, PS_LIST_TAIL, "-pretend", 0, "use the simple output format", false);
+    // -advancecamera
+    psMetadata *advancecameraArgs = psMetadataAlloc();
+    psMetadataAddU64 (advancecameraArgs, PS_LIST_TAIL, "-limit",   0, "limit result set to N items", 0);
+    psMetadataAddBool(advancecameraArgs, PS_LIST_TAIL, "-simple",  0, "use the simple output format", false);
+    psMetadataAddBool(advancecameraArgs, PS_LIST_TAIL, "-pretend", 0, "use the simple output format", false);
 
     // -dropcamera
@@ -144,17 +150,18 @@
     psMetadata *modes = psMetadataAlloc();
 
-    PXOPT_ADD_MODE("-definebyquery",  "create a new, populated flat correction run",       FLATCORR_MODE_DEFINEBYQUERY,  definebyqueryArgs);
-    PXOPT_ADD_MODE("-definerun",      "create a new, empty flat correction run",           FLATCORR_MODE_DEFINERUN,      definerunArgs);
-    PXOPT_ADD_MODE("-addchip",        "add a chip to a flat correction run",               FLATCORR_MODE_ADDCHIP,        addchipArgs);
-    PXOPT_ADD_MODE("-addcamera",      "migrate completed chips to camera stage analysis",  FLATCORR_MODE_ADDCAMERA,      addcameraArgs);
-    PXOPT_ADD_MODE("-dropchip",       "drop a chip from a flat correction run",            FLATCORR_MODE_DROPCHIP,       dropchipArgs);
-    PXOPT_ADD_MODE("-dropcamera",     "drop an exposure (camera stage analysis)",          FLATCORR_MODE_DROPCAMERA,     dropcameraArgs);
-    PXOPT_ADD_MODE("-pendingprocess", "show flat correction runs needing to be processed", FLATCORR_MODE_PENDINGPROCESS, pendingprocessArgs);
-    PXOPT_ADD_MODE("-addprocess",     "report completed flat correction analysis",         FLATCORR_MODE_ADDPROCESS,     addprocessArgs);
-    PXOPT_ADD_MODE("-updaterun",      "change a flat calibration run's state",             FLATCORR_MODE_UPDATERUN,      updaterunArgs);
-    PXOPT_ADD_MODE("-inputexp",       "list exposures for a correction run",               FLATCORR_MODE_INPUTEXP,       inputexpArgs);
-    PXOPT_ADD_MODE("-inputimfile",    "list imfiles for a chip run",                       FLATCORR_MODE_INPUTIMFILE,    inputimfileArgs);
-    PXOPT_ADD_MODE("-exportrun",            "export run for import on other database", FLATCORR_MODE_EXPORTRUN, exportrunArgs);
-    PXOPT_ADD_MODE("-importrun",            "import run from metadata file",           FLATCORR_MODE_IMPORTRUN, importrunArgs);
+    PXOPT_ADD_MODE("-definebyquery",  "create a new, populated flat correction run",         FLATCORR_MODE_DEFINEBYQUERY,  definebyqueryArgs);
+    PXOPT_ADD_MODE("-definerun",      "create a new, empty flat correction run",             FLATCORR_MODE_DEFINERUN,      definerunArgs);
+    PXOPT_ADD_MODE("-addchip",        "add an existing chip run to a flat correction run",   FLATCORR_MODE_ADDCHIP,        addchipArgs);
+    PXOPT_ADD_MODE("-addcamera",      "add an existing camera run to a flat correction run", FLATCORR_MODE_ADDCAMERA,      addcameraArgs);
+    PXOPT_ADD_MODE("-advancecamera",  "migrate completed chips to camera stage analysis",    FLATCORR_MODE_ADVANCECAMERA,  advancecameraArgs);
+    PXOPT_ADD_MODE("-dropchip",       "drop a chip from a flat correction run",              FLATCORR_MODE_DROPCHIP,       dropchipArgs);
+    PXOPT_ADD_MODE("-dropcamera",     "drop an exposure (camera stage analysis)",            FLATCORR_MODE_DROPCAMERA,     dropcameraArgs);
+    PXOPT_ADD_MODE("-pendingprocess", "show flat correction runs needing to be processed",   FLATCORR_MODE_PENDINGPROCESS, pendingprocessArgs);
+    PXOPT_ADD_MODE("-addprocess",     "report completed flat correction analysis",           FLATCORR_MODE_ADDPROCESS,     addprocessArgs);
+    PXOPT_ADD_MODE("-updaterun",      "change a flat calibration run's state",               FLATCORR_MODE_UPDATERUN,      updaterunArgs);
+    PXOPT_ADD_MODE("-inputexp",       "list exposures for a correction run",                 FLATCORR_MODE_INPUTEXP,       inputexpArgs);
+    PXOPT_ADD_MODE("-inputimfile",    "list imfiles for a chip run",                         FLATCORR_MODE_INPUTIMFILE,    inputimfileArgs);
+    PXOPT_ADD_MODE("-exportrun",            "export run for import on other database",       FLATCORR_MODE_EXPORTRUN,      exportrunArgs);
+    PXOPT_ADD_MODE("-importrun",            "import run from metadata file",                 FLATCORR_MODE_IMPORTRUN,      importrunArgs);
 
     if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
