- my $updated = $dbi->do(
- "UPDATE $table SET freesidestatus = 'done' WHERE $pkey = ?",
- undef,
- $row->{$pkey}
- );
+ my $st_sql;
+ if ( $args{status_table} ) {
+
+ $st_sql =
+ 'INSERT INTO '. $args{status_table}. " ( $pkey, freesidestatus ) ".
+ " VALUES ( ?, 'done' )";
+
+ } else {
+
+ $st_sql = "UPDATE $table SET freesidestatus = 'done' WHERE $pkey = ?";
+
+ }
+
+ my $updated = $dbi->do($st_sql, undef, $pkey_value );