Operation Details
Description: Retrieves details about the latest hearing for the specified case.
Sterotype: ns
SQL
SELECT
  hearingID,
  referenceNumber,
  locationID,
  addressID
INTO
  :hearingID,
  :hearingReference,
  :locationID,
  :addressID 
FROM
  Hearing 
WHERE caseID = :caseID 
  AND scheduledDateTime = 
  ( 
  SELECT
    MAX(scheduledDateTime) 
  FROM
    Hearing 
  WHERE caseID = :caseID 
  )