Below is my code. My problem is that it shows what I am searching for, but then it also shows all the records in the table. How can I fix this?


PROCEDURE GET_SEARCH_REQDATE (temp_reqdate in DATE) IS
CURSOR cr_sir(c_sir_date_req DATE) IS
SELECT SIR_TRANS_NO, SIR_TYPE,SIR_STATUS, SIR_COMPANY, SIR_REQUEST_DATE, SIR_REPORTED_BY,
SIR_DESCRIPTION
FROM SIR
WHERE SIR_REQUEST_DATE = c_sir_date_req;
--ORDER BY SIR_TRANS_NO;
cl_sir cr_sir%ROWTYPE;
BEGIN
OPEN cr_sir(temp_reqdate);
LOOP
FETCH cr_sir into cl_sir;
IF cr_sir%FOUND THEN
GO_BLOCK('SIR_SEARCH');
IR_SEARCH.SIR_TRANS_NO := cl_sir.SIR_TRANS_NO;
IR_SEARCH.SIR_TYPE := cl_sir.SIR_TYPE;
IR_SEARCH.SIR_STATUS := cl_sir.SIR_STATUS;
IR_SEARCH.SIR_COMPANY := cl_sir.SIR_COMPANY;
IR_SEARCH.SIR_REQUEST_DATE := cl_sir.SIR_REQUEST_DATE;
IR_SEARCH.SIR_REPORTED_BY := cl_sir.SIR_REPORTED_BY;
IR_SEARCH.SIR_DESCRIPTION := cl_sir.SIR_DESCRIPTION;
next_record;
END IF;
EXIT WHEN cr_sir%NOTFOUND;
END LOOP;
CLOSE cr_sir;
END;