Operation Details
Description: Counts plan template planItems created for the planItem.
Sterotype: ns
SQL
SELECT
  COUNT(*)
INTO
  :numPlanItems 
FROM
  PlanTemplatePlanItem,
  PlanTemplateSubGoal,
  PlanTemplate 
WHERE PlanTemplatePlanItem.planItemID = :planItemID 
  AND PlanTemplatePlanItem.planTemplateSubGoalID = PlanTemplateSubGoal.planTemplateSubGoalID 
  AND PlanTemplateSubGoal.planTemplateID = PlanTemplate.planTemplateID 
  AND PlanTemplate.recordStatus = :recordStatus