Re: Simple Question!

From: pconnors on BIX <pconnors_at_BIX.com>
Date: 1995/04/26
Message-ID: <pconnors.798872340_at_BIX.com>#1/1


tmaxwell_at_crl.com (Anthony B. Cillo) writes:

>I am trying to find the oldest 1000 patients in our database. The
>problem is that I cannot get the system to stop after returning 1000
>rows. I have tried using rownum but that only works if you are not
>using order by.
 

>Any ideas?
 

>Thanks
 

>Tony

Write a loop in PL/SQL that returns 1 row at a time. Since PL/SQL doesn't have I/O, just write that row (or its unique ID) into a temporary table. You can build a counter into the PL/SQL that stops the procedure after 1000 rows.

Then take those 1000 rows out of the temporary table.

I log on from home, so my examples aren't here. Let me know if you need a sample; I'll upload one.

   -Pat Connors Received on Wed Apr 26 1995 - 00:00:00 CEST

Original text of this message