Database SQL Operation: EvidenceDescriptor.searchMostRecentBusinessObjectChangesByStatus
Description: | Retrieves most recent business object change list for the status code
specified. In most cases it will return just a single record. In some instances<br />
(for example when there are a few records in succession, and their changes are applied at the same time) it may return a<br />
few records. |
Sterotype: | nsmulti |
SELECT
EVIDENCECHANGEHISTORY.EVIDENCEDESCRIPTORID,
EVIDENCECHANGEHISTORY.CHANGEUSER,
EVIDENCECHANGEHISTORY.CHANGEDATETIME,
EVIDENCEDESCRIPTOR.STATUSCODE,
EVIDENCEDESCRIPTOR.PENDINGREMOVALIND
INTO
:evidenceDescriptorID,
:changeUser,
:changeDateTime,
:statusCode,
:pendingRemovalInd
FROM
EVIDENCECHANGEHISTORY,
EVIDENCEDESCRIPTOR
WHERE
EVIDENCECHANGEHISTORY.CHANGEDATETIME =
(SELECT
MAX(CHANGEDATETIME)
FROM
EVIDENCECHANGEHISTORY
WHERE
EVIDENCECHANGEHISTORY.EVIDENCEDESCRIPTORID IN
(SELECT
EVIDENCEDESCRIPTORID
FROM
EVIDENCEDESCRIPTOR
WHERE
SUCCESSIONID = :successionID AND
STATUSCODE = :statusCode)) AND
EVIDENCECHANGEHISTORY.EVIDENCEDESCRIPTORID = EVIDENCEDESCRIPTOR.EVIDENCEDESCRIPTORID AND
EVIDENCEDESCRIPTOR.SUCCESSIONID = :successionID AND
EVIDENCEDESCRIPTOR.STATUSCODE = :statusCode
|