Index: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 9087)
+++ trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 9088)
@@ -54,5 +54,4 @@
 query="SELECT fSequenceFirst, fTelescopeNumber from SequenceProcessStatus where fReturnCode=13 and fProgramId=14"
 primaries=( `sendquery` )
-echo ${primaries[@]}
 if [ ${#primaries[@]} -eq 0 ]
 then 
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9087)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9088)
@@ -281,5 +281,5 @@
    query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fProgramId) and isnull(fReturnCode) "
    query=$query" order by fPriority desc "
-   if [ "$@" != "" ]
+   if [ "$@ " != " " ]
    then 
       query=$query" limit 0, $@ "
@@ -367,7 +367,7 @@
       if [ $i -lt `expr ${#prims[@]} - 1` ]
       then 
-         query=$query" ${prims[$i]}=${primaries[$s+$s+$i]} and "
+         query=$query" ${prims[$i]}='${primaries[$s+$s+$i]}' and "
       else
-         query=$query" ${prims[$i]}=${primaries[$s+$s+$i]} "
+         query=$query" ${prims[$i]}='${primaries[$s+$s+$i]}' "
       fi
    done
