Ok. I am in the painstaking process of converting a bunch of reports with stored procs written in TSQL (MSSqlserver)
to PL/SQL.
I am having issues with one of my joins and getting it to work right in PL/SQL
IN TSQL its looks something like this:
SELECT
*
FROM ParticipantSegment PS
LEFT OUTER JOIN ParticipantSegment AS ToPS ON
ToPS.FromSegmentId = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND (TOPS.RouteReasonId NOT IN (14,12) OR TOPS.RouteReasonID IS NOT NULL)
Keep in mind that the AND conditions only apply to the JOIN, not the entire query, which is the problem I am having in Oracle *817 btw*. Please keep in mind that I do have other things in my where clause and the below condidtions are ones that I want to apply ONLY as they relate to the join condition.
I have tried:
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND ToPS.RouteReasonId NOT IN (14,12)
AND ToPS.RouteReasonId IS NOT NULL
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND (ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND ToPS.RouteReasonId NOT IN (14,12)
AND ToPS.RouteReasonId IS NOT NULL)
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND (ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1)
AND (ToPS.RouteReasonId NOT IN (14,12) AND ToPS.RouteReasonId IS NOT NULL)
to PL/SQL.
I am having issues with one of my joins and getting it to work right in PL/SQL
IN TSQL its looks something like this:
SELECT
*
FROM ParticipantSegment PS
LEFT OUTER JOIN ParticipantSegment AS ToPS ON
ToPS.FromSegmentId = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND (TOPS.RouteReasonId NOT IN (14,12) OR TOPS.RouteReasonID IS NOT NULL)
Keep in mind that the AND conditions only apply to the JOIN, not the entire query, which is the problem I am having in Oracle *817 btw*. Please keep in mind that I do have other things in my where clause and the below condidtions are ones that I want to apply ONLY as they relate to the join condition.
I have tried:
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND ToPS.RouteReasonId NOT IN (14,12)
AND ToPS.RouteReasonId IS NOT NULL
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND (ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1
AND ToPS.RouteReasonId NOT IN (14,12)
AND ToPS.RouteReasonId IS NOT NULL)
SELECT
*
FROM
PARTICIPANTSEGMENT PS
,PARTICIPANTSEGMENT ToPS
WHERE
AND (ToPS.FromSegmentID (+) = PS.ParticipantSegmentId
AND ToPS.EntityTypeId = 1)
AND (ToPS.RouteReasonId NOT IN (14,12) AND ToPS.RouteReasonId IS NOT NULL)