I have a query coming off of ORACLE which works fine. For multiple reasons, I need to take this and modify so that it comes off of SQL (as a stored procedure).
I am having difficulty with the JOINS - cant seem to get them to behave the right way.
The ORACLE version =
SELECT "PACT"."EMPLOYEE_ID", "PACT"."ORDER_NBR", "PACT"."DEPT_ID", "PACT"."ACTIVITY_DATE", "PACT"."ACT_RSRC_USED", "PACT"."CONTROL_ID", "BIDCAT_CC"."CC"
FROM "MRPOWNER"."BIDCAT_CC" "BIDCAT_CC", "CSIOWNER"."SOPN_ELK" "SOPN", "CSIOWNER"."PACT_ELK" "PACT"
WHERE ("BIDCAT_CC"."BIDCAT"="SOPN"."PO_OPERATION_CLASS_CODE") AND (((("SOPN"."ALTERNATE_SEQ_NBR"="PACT"."ALT_SEQ_NBR" (+)) AND ("SOPN"."MAJOR_SEQ_NBR"="PACT"."MAJ_SEQ_NBR" (+))) AND ("SOPN"."MINOR_SEQ_NBR"="PACT"."MIN_SEQ_NBR" (+))) AND ("SOPN"."ORD_NBR"="PACT"."ORDER_NBR" (+))) AND "PACT"."DEPT_ID"='20' AND ("PACT"."ACTIVITY_DATE">={ts '2004-07-08 00:00:00'} AND "PACT"."ACTIVITY_DATE"<{ts '2004-07-09 00:00:00'})
ORDER BY "BIDCAT_CC"."CC", "PACT"."EMPLOYEE_ID"
Now, what I'm trying to do is make these JOINS come in the right way in SQL (TAB inner join SOPN, SOPN left join PACT (on 4 fields), PACT left join EMP)
Any help?
I am having difficulty with the JOINS - cant seem to get them to behave the right way.
The ORACLE version =
SELECT "PACT"."EMPLOYEE_ID", "PACT"."ORDER_NBR", "PACT"."DEPT_ID", "PACT"."ACTIVITY_DATE", "PACT"."ACT_RSRC_USED", "PACT"."CONTROL_ID", "BIDCAT_CC"."CC"
FROM "MRPOWNER"."BIDCAT_CC" "BIDCAT_CC", "CSIOWNER"."SOPN_ELK" "SOPN", "CSIOWNER"."PACT_ELK" "PACT"
WHERE ("BIDCAT_CC"."BIDCAT"="SOPN"."PO_OPERATION_CLASS_CODE") AND (((("SOPN"."ALTERNATE_SEQ_NBR"="PACT"."ALT_SEQ_NBR" (+)) AND ("SOPN"."MAJOR_SEQ_NBR"="PACT"."MAJ_SEQ_NBR" (+))) AND ("SOPN"."MINOR_SEQ_NBR"="PACT"."MIN_SEQ_NBR" (+))) AND ("SOPN"."ORD_NBR"="PACT"."ORDER_NBR" (+))) AND "PACT"."DEPT_ID"='20' AND ("PACT"."ACTIVITY_DATE">={ts '2004-07-08 00:00:00'} AND "PACT"."ACTIVITY_DATE"<{ts '2004-07-09 00:00:00'})
ORDER BY "BIDCAT_CC"."CC", "PACT"."EMPLOYEE_ID"
Now, what I'm trying to do is make these JOINS come in the right way in SQL (TAB inner join SOPN, SOPN left join PACT (on 4 fields), PACT left join EMP)
Any help?