Work with this set of "starter" changes, remove the into clause as well :
TYPE ResultSet is REF CURSOR;
create or replace PROCEDURE PARTS (iclassname IN varchar, idevice_name IN varchar2, idevice_variant IN varchar2, partsfinal out Resultset)
AS
part varchar2(32):=NULL;
description varchar(32):=NULL;
inputvars varchar2(1024):=NULL;
classname1 varchar2(32):=NULL;
begin
IF iclassname is null THEN
classname1 := 'NOT_REQD';
ELSE
classname1 := iclassname;
END IF;
OPEN partsFinal FOR SELECT substr(partnumber1,3) part, partdescription1
FROM
lookup_atm_class_event_element
WHERE
substr(classname,4) = classname1
and device_name = idevice_name
and device_variant = idevice_variant;
RETURN;
exception
when others then
open partsfinal for select 'ERR', 'Error' from dual;
end;
You will want to tweak the error return part to reflect what you need to have on the code calling this procedure to deal with errors.