Operation Details
Description: Returns the earliest time constraint related to one of the products belonged to a concrete appeal case.
Sterotype: ns
SQL
SELECT
  MIN(ProductTimeConstraint.numberOfDays)
INTO
  :numberOfDays 
FROM
  AppealRelationship,
  ProductDelivery,
  ProductTimeConstraint 
WHERE AppealRelationship.AppealCaseID = :caseID 
  AND AppealRelationship.caseID IN 
  ( 
  SELECT
    ProductDelivery.caseID 
  FROM
    ProductDelivery,
    ProductTimeConstraint 
  WHERE ProductDelivery.productID = ProductTimeConstraint.productID 
    AND ProductTimeConstraint.constraintType = :constraintType 
    AND ProductTimeConstraint.recordStatus = :recordStatus 
  ) 
  AND AppealRelationship.recordStatus = :recordStatus