FUNCTION GET_OVN_F (P_ASSIGNMENT_ID NUMBER, P_DATE DATE) RETURN NUMBER IS
L_RETURN NUMBER;
BEGIN
SELECT OBJECT_VERSION_NUMBER
INTO L_RETURN
FROM PER_ALL_ASSIGNMENTS_F PAAF
WHERE ASSIGNMENT_ID = P_ASSIGNMENT_ID
AND P_DATE BETWEEN EFFECTIVE_START_DATE AND EFFECTIVE_END_DATE
AND PRIMARY_FLAG = 'Y'
;
RETURN L_RETURN;
EXCEPTION WHEN OTHERS THEN RETURN 0;
END;
Use as Below in any package:
ln_object_number := 0;
ln_object_number :=GET_OVN_F(:ASSIGNMENT_ID,:RES_DATE);
No comments:
Post a Comment