Operation Details
Description: Counts plan templates created for the plan item and sub goal.
Sterotype: ns
SQL
SELECT
  COUNT (*)
INTO
  :count 
FROM
  PlanTemplatePlanItem,
  PlanTemplateSubGoal,
  PlanTemplate 
WHERE PlanTemplatePlanItem.planItemID = :planItemID 
  AND PlanTemplatePlanItem.planTemplateSubGoalID = PlanTemplateSubGoal.planTemplateSubGoalID 
  AND PlanTemplateSubGoal.subGoalID = :subGoalID 
  AND PlanTemplateSubGoal.planTemplateID = PlanTemplate.planTemplateID 
  AND PlanTemplate.recordStatus = :recordStatus