IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 5, 2007, 3:16:08 PM (19 years ago)
Author:
jhoblitt
Message:

rename exp_id -> exp_name
rename exp_tag -> exp_id
add add rawExp.exp_tag for use as an external name only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pztool.c

    r12093 r14023  
    140140            " FROM pzPendingExp"
    141141            " JOIN summitExp"
    142             "   USING(exp_id, camera, telescope)"
     142            "   USING(exp_name, camera, telescope)"
    143143        );
    144144
     
    197197            "SELECT"
    198198            "   summitImfile.*,"
    199             "   pzPendingImfile.exp_tag"
     199            "   pzPendingImfile.exp_id"
    200200            " FROM pzPendingImfile"
    201201            " JOIN summitImfile"
    202             "   USING(exp_id, camera, telescope, class, class_id)"
     202            "   USING(exp_name, camera, telescope, class, class_id)"
    203203        );
    204204
     
    255255
    256256    bool status = false;
    257     psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
    258     if (!status) {
    259         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
    260         return false;
    261     }
    262     if (!exp_id) {
    263         psError(PS_ERR_UNKNOWN, true, "-exp_id is required");
     257    psString exp_name = psMetadataLookupStr(&status, config->args, "-exp_name");
     258    if (!status) {
     259        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_name");
     260        return false;
     261    }
     262    if (!exp_name) {
     263        psError(PS_ERR_UNKNOWN, true, "-exp_name is required");
    264264        return false;
    265265    }
     
    315315    }
    316316
    317     // need to know exp_id, camera, telescope, class, class_id (to find the
     317    // need to know exp_name, camera, telescope, class, class_id (to find the
    318318    // pzPendingImfile entry and the URI for the newImfile entry.
    319319
     
    329329            "INSERT INTO newImfile"
    330330            "   SElECT"
    331             "       pzPendingImfile.exp_tag,"
     331            "       pzPendingImfile.exp_id,"
    332332            "       pzPendingImfile.class,"
    333333            "       pzPendingImfile.class_id,"
     
    336336            "   FROM pzPendingImfile"
    337337            "   WHERE"
    338             "       pzPendingImfile.exp_id = '%s'"
     338            "       pzPendingImfile.exp_name = '%s'"
    339339            "       AND pzPendingImfile.camera = '%s'"
    340340            "       AND pzPendingImfile.telescope = '%s'"
     
    342342            "       AND pzPendingImfile.class_id = '%s'";
    343343
    344         if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
     344        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
    345345            // rollback
    346346            if (!psDBRollback(config->dbh)) {
     
    372372            "   FROM pzPendingImfile"
    373373            "   WHERE"
    374             "       pzPendingImfile.exp_id = '%s'"
     374            "       pzPendingImfile.exp_name = '%s'"
    375375            "       AND pzPendingImfile.camera = '%s'"
    376376            "       AND pzPendingImfile.telescope = '%s'"
     
    378378            "       AND pzPendingImfile.class_id = '%s'";
    379379
    380         if (!p_psDBRunQuery(config->dbh, query, uri, exp_id, camera, telescope, class, class_id)) {
     380        if (!p_psDBRunQuery(config->dbh, query, uri, exp_name, camera, telescope, class, class_id)) {
    381381            // rollback
    382382            if (!psDBRollback(config->dbh)) {
     
    404404            "DELETE FROM pzPendingImfile"
    405405            "   WHERE"
    406             "       pzPendingImfile.exp_id = '%s'"
     406            "       pzPendingImfile.exp_name = '%s'"
    407407            "       AND pzPendingImfile.camera = '%s'"
    408408            "       AND pzPendingImfile.telescope = '%s'"
     
    410410            "       AND pzPendingImfile.class_id = '%s'";
    411411
    412         if (!p_psDBRunQuery(config->dbh, query, exp_id, camera, telescope, class, class_id)) {
     412        if (!p_psDBRunQuery(config->dbh, query, exp_name, camera, telescope, class, class_id)) {
    413413            // rollback
    414414            if (!psDBRollback(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.