Operation Details
Description: Returns latest key if an action for this user exists already.
Sterotype: ns
SQL
SELECT
  MAX(userRecentActionID)
INTO
  :userRecentActionID 
FROM
  UserRecentAction INNER JOIN
  (SELECT
     MAX (actionDateTime) actionDateTime
   FROM
     UserRecentAction 
   WHERE userName = :userName 
     AND referenceNo = :referenceNo
     AND type = :type 
     AND actionType = :actionType) MaxDateUserRecentAction ON UserRecentAction.actionDateTime = MaxDateUserRecentAction.actionDateTime
WHERE userName = :userName  
  AND referenceNo = :referenceNo 
  AND type = :type  
  AND actionType = :actionType