Total ROWS selected in a LOOP ORACLE PL/SQL -


i want iterate 0 n-1 in oracle loop, this:

for x in cleevector loop  

but wonder if possible use conditional like:

    if x = totalrows - 1         exit;     end if: 

there recomendation, or solution ? thank helping me out this.

so want process last value returned cursor. since cursor doesn't know how many rows return can't "break if second-to-last row". can save value processed, process on next iteration, in

declare   strlast_id  varchar2(1000) := null;    cursor cleevector     select regexp_substr(p_checkboxes,'[^,]+', 1, level) id       dual       connect regexp_substr(p_checkboxes, '[^,]+', 1, level) not null; begin   x in cleevector loop     if strlast_id not null       -- code process strlast_id     end if;      strlast_id := x.id;   end loop; end; 

comment extensively explain what's going on follow after able figure out intent was.

share , enjoy.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -