Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: LOOPING SQL

Re: LOOPING SQL

From: kibeha <kibeha_at_post6.tele.dk>
Date: 12 Feb 2004 01:56:06 -0800
Message-ID: <444b180d.0402120156.210848b7@posting.google.com>


"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US