Database SQL Operation: PlannedGoal.readIDAndGoalContractTextByCaseAndLanguage
Description: | Reads the active planned goal id and goal contract text for a service plan id by language code and case id. |
Sterotype: | ns |
SELECT
PlannedGoal.plannedGoalID,
SE.contractText
INTO
:plannedGoalID,
:goalContractText
FROM
(GoalContractText INNER JOIN
(
SELECT
ContractText,
contractTextID
FROM
ContractText
WHERE ContractText.languageCode = :languageCode
) SE
ON GoalContractText.contractTextID = SE.contractTextID
)
RIGHT JOIN
PlannedGoal
ON GoalContractText.goalID = PlannedGoal.goalID
WHERE PlannedGoal.caseID = :caseID
|