41: BEGIN
42:
43: select count(*)
44: into P_COUNT
45: from po_lookup_codes
46: where lookup_type = 'FREIGHT TERMS'
47: and description = P_DESCRIPTION
48: and sysdate < nvl(inactive_date, sysdate + 1);
49:
49:
50: if (P_COUNT = 1) then
51: select lookup_code
52: into P_LOOKUP_CODE
53: from po_lookup_codes
54: where lookup_type = 'FREIGHT TERMS'
55: and description = P_DESCRIPTION
56: and sysdate < nvl(inactive_date, sysdate + 1);
57: end if;