Skip to content

Commit

Permalink
0002940: Sql Server - An implicit conversion on column
Browse files Browse the repository at this point in the history
[sym_outgoing_batch].[status] to data type "nchar" may be causing index
su
  • Loading branch information
chenson42 committed Dec 9, 2016
1 parent 5410832 commit d9ec0bf
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -403,24 +403,34 @@ public OutgoingBatches getOutgoingBatches(String nodeId, String channelThread, b

String sql = null;
Object[] params = null;
int[] types = null;

if (channelThread != null) {
sql = getSql("selectOutgoingBatchPrefixSql", "selectOutgoingBatchChannelSql");
params = new Object[] { nodeId, channelThread, OutgoingBatch.Status.RQ.name(), OutgoingBatch.Status.NE.name(),
OutgoingBatch.Status.QY.name(), OutgoingBatch.Status.SE.name(),
OutgoingBatch.Status.LD.name(), OutgoingBatch.Status.ER.name(),
OutgoingBatch.Status.IG.name(), OutgoingBatch.Status.RS.name()};
types = new int[] {
Types.VARCHAR, Types.VARCHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR
};
}
else {
sql = getSql("selectOutgoingBatchPrefixSql", "selectOutgoingBatchSql");
params = new Object[] { nodeId, OutgoingBatch.Status.RQ.name(), OutgoingBatch.Status.NE.name(),
OutgoingBatch.Status.QY.name(), OutgoingBatch.Status.SE.name(),
OutgoingBatch.Status.LD.name(), OutgoingBatch.Status.ER.name(),
OutgoingBatch.Status.IG.name(), OutgoingBatch.Status.RS.name()};
types = new int[] {
Types.VARCHAR, Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR,
Types.CHAR, Types.CHAR, Types.CHAR, Types.CHAR
};

}

List<OutgoingBatch> list = (List<OutgoingBatch>) sqlTemplate.query(
sql, maxNumberOfBatchesToSelect, new OutgoingBatchMapper(includeDisabledChannels), params, null);
sql, maxNumberOfBatchesToSelect, new OutgoingBatchMapper(includeDisabledChannels), params, types);

OutgoingBatches batches = new OutgoingBatches(list);

Expand Down

0 comments on commit d9ec0bf

Please sign in to comment.