Changeset 9164


Ignore:
Timestamp:
Nov 14, 2008, 12:10:05 PM (12 years ago)
Author:
dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9163 r9164  
    2323   * datacenter/scripts/sourcefile:
    2424     - added variable for sql.rc
     25     - simplified code of two for-loops
    2526
    2627
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r9163 r9164  
    261261   getstepinfo
    262262   # get query
    263    query=" select "
    264    for (( i=0 ; i < ${#prims[@]} ; i++ ))
     263   query=" select "${prims[0]}
     264   for (( i=1 ; i < ${#prims[@]} ; i++ ))
    265265   do
    266       if [ $i -lt `expr ${#prims[@]} - 1` ]
    267       then
    268          query=$query" ${prims[$i]}, "
    269       else
    270          query=$query" ${prims[$i]} "
    271       fi
     266      query=$query", ${prims[$i]}"
    272267   done
    273268   query=$query" from $table where "
     
    365360   query=$query", fFailedTime=$failedtime, fProgramId=$programid, fReturnCode=$returncode "
    366361   query=$query" where "
    367 #   query=$query" where $primary='$primvar'"
    368362   if [ "$s" = "" ]
    369363   then
    370364      s=0
    371365   fi
    372    for (( i=0 ; i < ${#prims[@]} ; i++ ))
     366   query=$query" ${prims[0]}='${primaries[$s*${#prims[@]}]}'"
     367   for (( i=1 ; i < ${#prims[@]} ; i++ ))
    373368   do
    374       if [ $i -lt `expr ${#prims[@]} - 1` ]
    375       then
    376          query=$query" ${prims[$i]}='${primaries[$s*${#prims[@]}+$i]}' and "
    377       else
    378          query=$query" ${prims[$i]}='${primaries[$s*${#prims[@]}+$i]}' "
    379       fi
    380    done
     369      query=$query" and ${prims[$i]}='${primaries[$s*${#prims[@]}+$i]}' "
     370   fi
     371   done   
    381372   echo " QUERY: "$query
    382373   if ! mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
Note: See TracChangeset for help on using the changeset viewer.