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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL statement to return a block of rows

RE: SQL statement to return a block of rows

From: Bill Tantzen <tantz001_at_tc.umn.edu>
Date: Fri, 20 Aug 2004 15:06:24 -0500
Message-ID: <021201c486f1$2b8281b0$9be75ea0@OMWL201BAV>


Hi Dennis!

Here is a snip of pl/sql code that has worked for me. If I am understanding you question correctly, this may be what you need.

            SELECT ordval, token, offset
            FROM (
                SELECT rownum AS ordval, token, offset
                FROM finding_aid_token
                WHERE query_id = 5424
                ORDER BY offset
            ) 
            WHERE ordval < 20;

I hope all is good with you and your family! It always pleases me to see your name pop up in my inbox -- which it does a number of times everyday it seems!

Take care,
Bill

Bill Tantzen
University of Minnesota Libraries
tantz001_at_tc.umn.edu
612-626-9949 (office) 612-250-6125 (cell)



I guess the man's a genius, but what
a dirty mind he has, hasn't he? -- Nora Joyce

--> -----Original Message-----
--> From: oracle-l-bounce_at_freelists.org
--> [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of DENNIS WILLIAMS
--> Sent: Friday, August 20, 2004 2:26 PM
--> To: 'oracle-l_at_freelists.org'
--> Subject: RE: SQL statement to return a block of rows
-->
-->
--> Fantastic! Thanks very much!
-->
--> Dennis Williams
--> DBA
--> Lifetouch, Inc.
-->
--> "We all want progress, but if you're on the wrong road,
--> progress means doing an about-turn and walking back to the
--> right road; in that case, the man who turns back soonest is
--> the most progressive."
--> -- C.S. Lewis
-->
-->
--> -----Original Message-----
--> From: oracle-l-bounce_at_freelists.org
--> [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Jacques Kilchoer
--> Sent: Friday, August 20, 2004 2:17 PM
--> To: oracle-l_at_freelists.org
--> Subject: RE: SQL statement to return a block of rows
-->
-->
--> Link that avoids wrapping:
--> http://tinyurl.com/4t9xe
--> -----Original Message-----
--> From: Jacques Kilchoer
-->
--> Tom Kyte has this article:
--> http://asktom.oracle.com/pls/ask/f?p=4950:8:::NO::F4950_P8_D
--> ISPLAYID,F49
--> 50_P8_CRITERIA:127412348064,
--> getting rows N through M of a result set
-->
-->
--> -----Original Message-----
--> DENNIS WILLIAMS
-->
--> List - In a SQL statement with an ORDER clause, can I
--> provide a starting and end point (or offset) based on rows
--> returned? Oracle9i
-->
--> We are converting a small application from SQL Server to
--> Oracle (good!). In SQL Server they do everything with
--> stored procedures, but in Oracle we plan to just use SQL
--> statements. In SQL Server one stored procedure retrieves a
--> screenfull of rows and returns them, so the cursor is
--> managed on the database side. I said that for Oracle we
--> would probably want to do this similarly with just SQL
--> statements. This works except for the screenful business. I
--> said we could wrap the query in a PL/SQL shell and use a
--> cursor, but the team is thinking there must be a way. If
--> someone has a PL/SQL template, please send it to me. One of
--> them uses MySql and says this feature is available there.
-->
-->
-->
--> ----------------------------------------------------------------
--> Please see the official ORACLE-L FAQ: http://www.orafaq.com
--> ----------------------------------------------------------------
--> To unsubscribe send email to:
--> oracle-l-request_at_freelists.org put 'unsubscribe' in the
--> subject line.
--> --
--> Archives are at http://www.freelists.org/archives/oracle-l/
--> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
--> -----------------------------------------------------------------
--> ----------------------------------------------------------------
--> Please see the official ORACLE-L FAQ: http://www.orafaq.com
--> ----------------------------------------------------------------
--> To unsubscribe send email to:
--> oracle-l-request_at_freelists.org put 'unsubscribe' in the
--> subject line.
--> --
--> Archives are at http://www.freelists.org/archives/oracle-l/
--> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
--> -----------------------------------------------------------------
-->



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Aug 20 2004 - 14:58:11 CDT

Original text of this message

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