Re: oracle (oci8) intro

From: Date: Tue, 21 Aug 2001 19:03:11 +0000
Subject: Re: oracle (oci8) intro
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-11627@lists.php.net to get a copy of this message
Hello, Anthony Carlos wrote: > > Here's what I'm using to do paged queries in Oracle: > > $min = minimum of range of records > $max = maximum of range of records > $field_list = the fields from the table separated by commas > $table = the table from where you're selecting > $where_clause and $order_by should be self-explanatory > > SELECT linenum, $field_list > FROM (SELECT rownum AS linenum, $field_list > FROM (SELECT $field_list > FROM $table > WHERE $where_clause > ORDER BY $order_by)) > WHERE linenum BETWEEN $min AND $max; I afraid that this doesn't work well with arbitrary queries. I tried this before and I recall there are problems with computed columns (COUNT(), SUM(), etc...). If I am not mistaken there is also the problem that Oracle truncates column names that are qualified with the table names. The right way to do that is using server side cursors, but I could not figure how to return to the client side, a server side cursor that I could use skip rows and get only those that I want. Regards, Manuel Lemos

« previous php.db (#11627) next »