clRouteID+" is null";
clRouteID+"='null'";
  protected String getLegNoRouteSQL(int runID){    String protoTable=getTableName(DGPSPConstants.ASSET_PROTOTYPE_TABLE,runID);    String instanceTable=getTableName(DGPSPConstants.ASSET_INSTANCE_TABLE,runID);    String aiTable=getTableName(DGPSPConstants.ASSET_ITINERARY_TABLE,runID);    String clTable=getTableName(DGPSPConstants.CONVEYED_LEG_TABLE,runID);    String sTable=getTableName(DGPSPConstants.LOCATIONS_TABLE,runID);    String eTable=getTableName(DGPSPConstants.LOCATIONS_TABLE,runID);    String ciTable=getTableName(DGPSPConstants.CONV_INSTANCE_TABLE,runID);    String cpTable=getTableName(DGPSPConstants.CONV_PROTOTYPE_TABLE,runID);    //For return:    String convType="cp."+DGPSPConstants.COL_CONVEYANCE_TYPE;    String sGeo="s."+DGPSPConstants.COL_GEOLOC;    String sPretty="s."+DGPSPConstants.COL_PRETTYNAME;    String sLat="s."+DGPSPConstants.COL_LAT;    String sLon="s."+DGPSPConstants.COL_LON;    String sLocID="s."+DGPSPConstants.COL_LOCID;    String eGeo="e."+DGPSPConstants.COL_GEOLOC;    String ePretty="e."+DGPSPConstants.COL_PRETTYNAME;    String eLat="e."+DGPSPConstants.COL_LAT;    String eLon="e."+DGPSPConstants.COL_LON;    String eLocID="e."+DGPSPConstants.COL_LOCID;    String clStart="cl."+DGPSPConstants.COL_STARTTIME;    String clEnd="cl."+DGPSPConstants.COL_ENDTIME;    String instanceNomen="pr."+DGPSPConstants.COL_ALP_NOMENCLATURE;    String instanceName="inst."+DGPSPConstants.COL_NAME;    String carrierNomen="cp."+DGPSPConstants.COL_ALP_NOMENCLATURE;    String carrierName="ci."+DGPSPConstants.COL_BUMPERNO;        //Also for where:    String aiLegID="ai."+DGPSPConstants.COL_LEGID;    String clLegID="cl."+DGPSPConstants.COL_LEGID;    String clSLocID="cl."+DGPSPConstants.COL_STARTLOC;    String clELocID="cl."+DGPSPConstants.COL_ENDLOC;    String clConvID="cl."+DGPSPConstants.COL_CONVEYANCEID;    String ciConvID="ci."+DGPSPConstants.COL_CONVEYANCEID;    String ciProtoID="ci."+DGPSPConstants.COL_PROTOTYPEID;    String cpProtoID="cp."+DGPSPConstants.COL_PROTOTYPEID;    String aiAssetID="ai."+DGPSPConstants.COL_ASSETID;    String clLegType="cl."+DGPSPConstants.COL_LEGTYPE;    String clRouteID="cl."+DGPSPConstants.COL_ROUTEID;    String instanceID="inst."+DGPSPConstants.COL_ASSETID;    String instanceProtoID="inst."+DGPSPConstants.COL_PROTOTYPEID;    String protoID="pr."+DGPSPConstants.COL_PROTOTYPEID;    String sql=      "select "+      convType+", "+      sLocID+", "+sGeo+", "+sPretty+", "+sLat+", "+sLon+", "+      eLocID+", "+eGeo+", "+ePretty+", "+eLat+", "+eLon+", "+      clStart+", "+clEnd+", "+      instanceNomen+", "+instanceName+", "+      carrierNomen+", "+carrierName+      "\nfrom "+      aiTable+" ai"+", "+      clTable+" cl"+", "+      sTable+" s"+", "+      eTable+" e"+", "+      ciTable+" ci"+", "+      cpTable+" cp"+", "+      protoTable+" pr"+", "+      instanceTable+" inst"+      "\nwhere "+      aiLegID+"="+clLegID+"\nand "+      clSLocID+"="+sLocID+"\nand "+      clELocID+"="+eLocID+"\nand "+      clConvID+"="+ciConvID+"\nand "+      ciProtoID+"="+cpProtoID+"\nand "+      "("+clLegType+"="+DGPSPConstants.LEG_TYPE_TRANSPORTING+//" or "+      //      clLegType+"="+DGPSPConstants.LEG_TYPE_POSITIONING+" or "+      //      clLegType+"="+DGPSPConstants.LEG_TYPE_RETURNING+      ")"+"\nand "+      aiAssetID+"='"+assetid+"'\nand "+      aiAssetID+"="+instanceID+"\nand "+      instanceProtoID+"="+protoID+"\nand "+      clRouteID+" is null";    if (debug)      TPFDDLoggerFactory.createLogger().logMessage(Logger.NORMAL, Logger.GENERIC, "AssetInstanceRequest - sql\n" + sql);	    return sql;  }