Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: LOOPING SQL
"Dang" <mdang_at_bigpond.com.au> wrote in message news:<c0el3f$9n6$1_at_mws-stat-syd.cdn.telstra.com.au>...
> I am running Oracle 8i and trying to run a Loop of SQL based on one number.
> Problem is this number can vary.
A typical way done by one of the guru's of the Oracle world (visit asktom.oracle.com :-) is :
select sysdate, loop from
( select rownum loop
from all_objects
where rownum <= 5 )
Of course it just works up to a certain point (which differs from system to system - try select count(*) from all_objects to discover the max for your case).
/KiBeHa Received on Thu Feb 12 2004 - 03:56:06 CST
![]() |
![]() |