Operation Details
Description: Reads list of most recent released version of questionnaires
Sterotype: nsmulti
SQL
SELECT
  qvi.questionnaireVersionID,
  qvi.questionnaireID,
  qvi.name,
  qvi.type,
  qvi.questionnaireVersionNumber,
  qvi.versionStatus,
  qvi.fromDate,
  qvi.toDate
INTO
  :questionnaireVersionID,
  :questionnaireID,
  :name,
  :type,
  :version,
  :status,
  :fromDate,
  :toDate 
FROM
  QuestionnaireVersion qvi,
  QuestionnaireVersion qvi2 
WHERE qvi.questionnaireVersionID = qvi2.questionnaireVersionID 
  AND qvi.questionnaireVersionNumber = 
  ( 
  SELECT
    MAX(questionnaireVersionNumber) 
  FROM
    QuestionnaireVersion qvi3 
  WHERE qvi3.questionnaireID = qvi2.questionnaireID 
  ) 
ORDER BY qvi.name