Index: /trunk/tools/diff_inputs.pl
===================================================================
--- /trunk/tools/diff_inputs.pl	(revision 21032)
+++ /trunk/tools/diff_inputs.pl	(revision 21033)
@@ -26,5 +26,5 @@
 
 my ($db_host, $db_name, $db_user, $db_pw); # Database details
-my ($diff_id);                  # Diff of interest
+my ($diff_id, $skycell_id);     # Diff and skycell of interest
 my ($input);                    # Input list
 
@@ -35,4 +35,5 @@
            'dbpass=s' => \$db_pw, # Database p/w
            'diff_id=s' => \$diff_id, # Diff identifier
+           'skycell_id=s' => \$skycell_id, # Skycell identifier
            'input=s'  => \$input, # Input list to generate
            ) or die "Unable to parse arguments.\n";
@@ -57,15 +58,17 @@
     "     NULL AS stack_path_base" .
     " FROM diffRun" .
-    " JOIN diffInputSkyfile USING(diff_id, skycell_id)" .
+    " JOIN diffInputSkyfile USING(diff_id)" .
     " JOIN warpSkyfile USING(warp_id, skycell_id)" .
-    " WHERE diff_id = $diff_id" .
-    " UNION" .
+    " WHERE diff_id = $diff_id";
+$sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
+$sql.= " UNION" .
     " SELECT" .
     "     NULL AS warp_path_base," .
     "     stackSumSkyfile.path_base AS stack_path_base" .
     " FROM diffRun" .
-    " JOIN diffInputSkyfile USING(diff_id, skycell_id)" .
+    " JOIN diffInputSkyfile USING(diff_id)" .
     " JOIN stackSumSkyfile USING(stack_id)" .
     " WHERE diff_id = $diff_id";
+$sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
 
 
Index: /trunk/tools/diff_outputs.pl
===================================================================
--- /trunk/tools/diff_outputs.pl	(revision 21032)
+++ /trunk/tools/diff_outputs.pl	(revision 21033)
@@ -21,5 +21,5 @@
 
 my ($db_host, $db_name, $db_user, $db_pw); # Database details
-my ($diff_id);                  # Diff of interest
+my ($diff_id, $skycell_id);     # Diff and skycell of interest
 my ($input);                    # Input list
 my ($products);                 # Products of interest
@@ -31,4 +31,5 @@
            'dbpass=s' => \$db_pw, # Database p/w
            'diff_id=s' => \$diff_id, # Diff identifier
+           'skycell_id=s' => \$skycell_id, # Skycell identifier
            'products=s' => \$products, # Products of interest
            ) or die "Unable to parse arguments.\n";
@@ -50,4 +51,5 @@
 # Query to run
 my $sql = "SELECT path_base FROM diffSkyfile WHERE diff_id = $diff_id";
+$sql .= " AND skycell_id = $skycell_id" if defined $skycell_id;
 
 # List of diffs
