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

Home -> Community -> Usenet -> c.d.o.server -> Re: returning certain rows from a SELECT

Re: returning certain rows from a SELECT

From: Kenneth C Stahl <BluesSax_at_Unforgettable.com>
Date: Fri, 09 Jul 1999 08:04:11 -0400
Message-ID: <3785E53B.B653DF0F@Unforgettable.com>


Something tells me that you have not made the jump to thinking in terms of a relational database. Conceptually there is no logical notion of rows 26-50 of a select statement. That is basically a flat-file or perhaps an IMS database concept. What you need to do is design a sql statement that will give you the rows that you need using sql conventions. If that appears impossible then perhaps you need to look at the normalization of your data and redesign your tables to put the data into at least a third normal form under most circumstances and perhaps forth normal form under circumstances where there is limited selectability at the third normal form level. Once that is done then you should be able to perform extracts with relatively simple SELECT statements.

Ken

Neil Kandalgaonkar wrote:

> Hello, I'm new to Oracle, maybe my approach here is completely wrong,
> but here's my problem:
> I am using Oracle8 through Perl's DBI. I would like to obtain specific
> row-ranges from my SELECT statements, i.e., give me rows 26-50 of 'SELECT
> * FROM foo'.
> I can get this to work nicely in SQLPLUS using a cursor, loop, and
> %ROWCOUNT, but these results are all printed to the screen, inserted into
> a temporary table, or something similar.
> How can I make a function (?) or something similar (?) that will return
> rows that DBI will understand?
> I imagine something like
> "SELECT * FROM complicated_query(26,50)"
> or even
> "SELECT * FROM slice_query('SELECT foo,bar FROM quux',26,50);
> and while I could construct the query with the dbms_sql package,
> I'm not sure how to make the procedure or function return the rows.
> or is there a way to get Perl/DBI to understand dbms_output lines?
>
Received on Fri Jul 09 1999 - 07:04:11 CDT

Original text of this message

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