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!

increment a value with in for loop statement

user13393409Oct 11 2010 — edited Oct 11 2010
HI,

I have a small issue with for loop statement, am using a select statement with in for loop and capturing the count of rows. am not able to increment the count with in the loop , its giving count for last value in loop only.

please see my code below:
FOR v_stage_LNK_CHG IN LNK_CHG
LOOP
SELECT COUNT() INTO v_count FROM(*
SELECT DISTINCT jobname FROM TB_JOBCOMP_B088
WHERE jobname=p_job_name AND linkname NOT LIKE '%Nil%'AND linkname=v_stage_LNK_CHG.linkname And ServerName = To_ServerName And projectname=To_Project);
v_count++
END LOOP;

this code is capturing only last linkname job count not all the links jobname count.

Any ideas???
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2010
Added on Oct 11 2010
1 comment
3,953 views