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!

a loop over a select

676960Mar 18 2009 — edited Mar 24 2009
hello,
i make a loop over a select , i give as input to the select a string with a list of number separated by "," (i call it projectIdList )
but in the loop, it iterates only over the first element
for example, if i give a string 1,2,3,4,5
just the iteration of 1 happen

here is the for head

for i in (select substr(the_string, decode(level, 1, 1, instr(the_string,',',1,level-1)+1), decode( instr(the_string,',',1,level), 0, length(the_string), instr(the_string,',',1,level) - decode( level, 1, 0, instr(the_string,',',1,level-1))-1) ) ProjectID from (select projectIdList the_string from dual ) connect by level < length(replace(translate(the_string,'01234567890','00000000000'),'0')) + 2) loop



any one has an ideai ?

Regards
Sallemel
This post has been answered by BluShadow on Mar 24 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2009
Added on Mar 18 2009
16 comments
7,652 views