Hello,
I have a cursor which is fetching records from some tables. Below is the sample code. In my code, i have to reuse the cursor multiples and while doing that, I also might have to use few fields in the cursor and do a distinct as those columns have duplicates.
My question is, after the LOOP, while fetching the records, can we remove duplicates?
Thanks
Kumar
DECLARE
c_id customers.id%type;
c_name customerS.No.ame%type;
c_addr customers.address%type;
CURSOR c_customers is
SELECT id, name, address FROM customers;
BEGIN
OPEN c_customers;
LOOP
FETCH c_customers into c_id, c_name, c_addr;
EXIT WHEN c_customers%notfound;
dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_addr);
END LOOP;
CLOSE c_customers;
END;