SQL查询在TOAD中工作正常,但在放入java代码时则不行

时间:2011-02-15 12:05:18

标签: java sql

以下sql查询在TOAD编辑器中运行并显示结果时执行正常,但不会失败或 放在java代码中时显示结果。

CREATE TABLE CDRRD.C31820_ADHOCM AS 
    SELECT A.REC_ID A_REC_ID, A.NORM_DUR A_DUR, A.NORM_STDT A_STDT, A.TOTAL_TYPE A_TT, B.REC_ID B_REC_ID, B.NORM_DUR B_DUR,  B.NORM_STDT B_STDT, 
           B.TOTAL_TYPE B_TT, 2180 SCENARIO_ID,3324 PAIR_ID,1 RECURSIVE_STAGE_ID FROM 
           (SELECT D.* FROM CDRRD.C31820_3445 D WHERE EXISTS (
                      SELECT E.* AS FROM CDRRD.C31820L E WHERE E.A_TT = 473 AND E.RECURSIVE_STAGE_ID = 1 AND E.A_REC_ID = D.REC_ID)) A , 
           (SELECT F.* FROM CDRRD.C31820_3440 F WHERE EXISTS (
                      SELECT G.* AS FROM CDRRD.C31820R G WHERE G.B_TT = 300 AND G.RECURSIVE_STAGE_ID = 1 AND G.B_REC_ID = F.REC_ID)) B 
    WHERE EXISTS (SELECT * FROM CDRRD.C31820_ADHOC C WHERE  A.NORM_A = C.NORM_B AND C.NORM_A = B.NORM_A AND B.PAY_TYPE = C.PAY_TYPE AND A.PAY_TYPE = C.PAY_TYPE ) 
     AND TO_NUMBER ((a.norm_stdt - b.norm_stdt) * 86400) BETWEEN -90 AND 90 AND (b.norm_dur - a.norm_dur) BETWEEN -1 AND 2

2 个答案:

答案 0 :(得分:3)

这是一个创建声明,您期望得到什么结果?

答案 1 :(得分:1)

执行命令后,您应该检查提交事务。

查看java代码会有所帮助。