Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cursor for loop in PlSql

917023Apr 18 2012 — edited Apr 18 2012
while 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?
This post has been answered by 908002 on Apr 18 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2012
Added on Apr 18 2012
5 comments
185 views