create or replace procedure retrieve_duration (code in number, d_code out number, f_date out date, t_date out date) as begin select duration_code,from_date,to_date into d_code,f_date,t_date from duration where duration_code = code; exception when no_data_found then raise_application_error(-20101,'Record does not exist'); d_code := 0; end; /