程序里是这样的
for (int i = 0; i < channels.size(); i++) {
channel = channels.get(i);
fileName = localPath + "PrdInfo" + sysArg.getInitDate() + "_"
+ channel;
String sql = " select * from tbproduct a , tbtainfo b where ((a.status = ? and a.issue_fail_date = ? ) "
+ "or (a.status = ? and a.end_date = ?) or (a.status not in(?, ?))) and "
+ "a.channels like '%" + channel + "%'" +
" and a.ta_code = b.ta_code " ;
try {
rs = session.getResultSet(sql, IDict.K_CPZT.CPZT_ISS_FAIL,
sysArg.getPrevDate(), IDict.K_CPZT.CPZT_END,
sysArg.getPrevDate(), IDict.K_CPZT.CPZT_ISS_FAIL,
IDict.K_CPZT.CPZT_END);
输出sql语句是 select * from tbproduct a , tbtainfo b where ((a.status = ? and a.issue_fail_date = ? ) or (a.status = ? and a.end_date = ?) or (a.status not in(?, ?))) and a.channels like '%0%' and a.ta_code = b.ta_code
select * from tbproduct a , tbtainfo b where ((a.status = ? and a.issue_fail_date = ? ) or (a.status = ? and a.end_date = ?) or (a.status not in(?, ?))) and a.channels like '%1%' and a.ta_code = b.ta_code
。。。。
%%处,循环六次,在toad里面怎么写实现相同的功能
用循环么?
------解决方案--------------------------------------------------------
用or来加
a.channels like '%0%' or a.channels like '%1%'............