convert to oracle sql
here is a db2 query
please convert into sql
INSERT INTO AUDIT.AUDIT_FILE_SEQ_MISSING_TEMP (SRC_NAME,SRC_DT,SRC_SEQ,MISSING_CODE)
with r (SRC_NAME,TT_FILE_NO, incr,end) as ( select MSC_ID_CHU, 0,JUMP_INTERVAL,RECYCLE_VALUE from AUDIT.AUDIT_JUMP_MASTER
union all select r.SRC_NAME, r.TT_FILE_NO + r.incr, r.incr, r.end from r
where r.TT_FILE_NO+r.incr+1 <= r.end ),SEQ
(SRC_NAME,TT_FILE_NO,EVENT_START_DATE) as ( SELECT A.SRC_NAME, SL.TT_FILE_NO, A.SRC_DT FROM
AUDIT.AUDIT_FILE_SEQ_CONTROL_DETAIL A INNER JOIN r SL ON A.SRC_NAME = SL.SRC_NAME
WHERE SL.TT_FILE_NO BETWEEN A.SRC_START_SEQ AND A.SRC_END_SEQ AND A.SRC_DT = '2010-04-08')
SELECT SRC_NAME,EVENT_START_DATE,TT_FILE_NO, 0 FROM SEQ
WHERE EVENT_START_DATE = '2010-04-08' EXCEPT
SELECT SRC_NAME,SRC_DT,SRC_SEQ,0 FROM AUDIT.AUDIT_FILE_SEQ_MASTER WHERE SRC_DT = '2010-04-08' ;
how about do it yourself?
Here is a clue...
DB2 EXCEPT == Oracle MINUS
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Click Here to Expand Forum to Full Width