Cursor for loop in PlSql
917023Apr 18 2012 — edited Apr 18 2012while i was studying about cursor for loop i found this statement in the web
"A cursor FOR loop implicitly declares its loop index as a %ROWTYPE record"
for example an emp table contain following columns empno,ename,sal,hiredate,deptno
and let us consider an cursor for loop as
for rec in select empno,sal from emp loop
if cursor for loop declare loop index as a %rowtype our cursor statement should include all the columns and follow the data type compatabulity.
But here our cursor statement includes only few columns,if we use %rowtype we have to select all columns but here we are not doing this.
Can anyone please explain what is happening in cursor for loop?