sql="select * from ZY.RES_SIM a where 1 = 1 and rownum <= 100 and res_date < to_date('20081127121624','YYYYMMDDHH24MISS') "
&"and (region_code = 771 or oregion_code = 771) and (receiver=0 or receiver is null) and brand in (0,5) and res_code = "
&"200001 and hlr_code = 7711 and main_flag = 1 and sts = 2 and res_sts in (1,4,5) and exists(select 1 from "
&"ZY.RES_MSISDN_IMSI_MAP b where b.start_msisdn <= '13607714582' and b.end_msisdn >= '13607714582' and "
&"b.start_imsi <= a.imsi and b.end_imsi >= a.imsi)";
report_msg(sql);#--sql显示正确
rr=db_execute_query("query1",sql,recordNumber);
pause(rr);#--rr= -10162,为sql语法错误的提示信息
该问题问过同事,说是wr下的语法规则比plsql下的语法严格,但是查来查去,自己没看出什么不规则的地方了,麻烦各位火眼金睛帮忙看看。作者: zhaoaihua305 时间: 2007-12-24 16:22
当然也可能是其他问题,欢迎指教作者: lantianwei 时间: 2007-12-24 16:44
1.SQL语句本身可以执行吗?
2.把SQL语句写的简单点,看是否可以执行通过?
如果上面两个都不可以,可能是你DSN的设置或其他什么地方有问题作者: zhaoaihua305 时间: 2007-12-24 17:01
1.sql可以单独执行通过
2.其他sql语句测试通过,比如说sql="select * from ZY.RES_SIM where rownum<10";
(同时也证明其他配置应该没问题吧)