The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT count(*)
FROM IGS_CO_ADDR_TYPE adt
WHERE adt.addr_type = p_addr_type;
SELECT ia.addr_type,
ia.start_dt,
ia.end_dt
FROM IGS_OR_INST_ADDR ia
WHERE ia.institution_cd = p_institution_cd AND
ia.addr_type <> p_addr_type AND
ia.status = 'A' AND
ia.correspondence_ind = 'Y';
SELECT count(*)
FROM IGS_OR_INST_ADDR ia
WHERE ia.institution_cd = p_institution_cd AND
ia.addr_type = p_addr_type AND
ia.status = 'A' AND
ia.start_dt <> p_start_dt AND
ia.end_dt IS NULL;
SELECT ia.start_dt,
ia.end_dt
FROM IGS_OR_INST_ADDR ia
WHERE ia.institution_cd = cp_institution_cd AND
ia.addr_type = cp_addr_type AND
ia.status = 'A' AND
ia.start_dt <> p_start_dt;
-- which is being created or updated, does not overlap
-- with an existing record of the same type for the institution.
-- Set the default message number
p_message_name := null;
-- Loop through the selected institution_addr records,
-- validating each record for date overlaps.
-- Do not validate against the record passed in.
-- Validation will fail if any of the following are true -
-- a. The current start date is between an existing date range.
-- b. The current end date is between an existing date range.
-- c. The current dates overlap an entire existing date range.
FOR v_ia_rec IN c_ia(
p_institution_cd,
p_addr_type) LOOP
-- check if p_start_dt between existing date range.
IF (p_start_dt >= v_ia_rec.start_dt) AND
(p_start_dt <= NVL(v_ia_rec.end_dt,IGS_GE_DATE.IGSDATE('9999/01/01'))) THEN
p_message_name:= 'IGS_EN_ADDRESS_DATES_OVERLAP';