In Perl:
foreach my $word (qw(this that whatever)) { dosomething($word); }
In PL/SQL:
<> DECLARE TYPE wordlist_t IS VARRAY(somenumber) OF VARCHAR2(#); wordlist wordlist_t := wordlist_t('this', 'that', 'whatever'); BEGIN FOR i IN wordlist.FIRST .. wordlist.LAST LOOP dosomething(wordlist(i)); END LOOP; END foreach;
Re:Or even...
jdavidb on 2003-09-18T04:36:23
Hmm, yeah, but usually I use the other form because I'm thinking of traversing the list. However, maybe that would read more naturally.
BTW, did I fail to get the joke? What's funny?
This fails if your array has zero size.