I have small/sample code below.
DECLARE
CURSOR cusr IS select 'contract1', 111, sysdate from dual;
TYPE recType IS RECORD(
CONTRACT VARCHAR2(15),
VENDNUM NUMBER,
LETTING_DATE DATE);
vrec recType;
BEGIN
OPEN cusr;
LOOP
FETCH cusr INTO vrec;
EXIT WHEN cusr%NOTFOUND;
dbms_output.put_line(vrec.contract||' '||to_char(vrec.letting_date,'YYYYMMDD'));
END LOOP;
CLOSE cusr;
END;
Can I INSTEAD, use the following custom pre-defined TYPE instead of the coded/bolded TYPE above?
create type CONT_TYPE as object(CONTRACT VARCHAR2(15), VENDNUM NUMBER, LETTING_DATE DATE);
My end state will be converting above code to a pipelined table function,
but for now, I am simply trying to avoid typing the column definitions twice