You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
How do we come to know that we have reached the end of record in a cursor for loop.
For example, i have this PL/SQL block:
DECLARE
CURSOR c1 IS
SELECT sal FROM emp;
SALARY_TOTAL NUMBER:=0;
BEGIN
FOR emp_rec IN c1 LOOP
salary_total := salary_total + emp_rec.sal;
---dbms_output.put_line(salary_total);
END LOOP;
END;
And i want to output the total salary when the FOR LOOP reaches the end of the record,how am i going to determine that we have reached the end of the record.
u didnt mention whether u r getting any error msg or result is not displayed. ur code looks fine, if output is not returned then check ur server output by...