By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,626 Members | 2,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,626 IT Pros & Developers. It's quick & easy.

oracle function

P: n/a
Hi all

I use php with oracle database and i need function like mysql_data_seek
i need to set the result pointer to the row number I need.
can anyone help me?

Thank you

Chripa
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 2 Apr 2004 01:00:41 -0800, ch****@volny.cz (chripa) wrote:
I use php with oracle database and i need function like mysql_data_seek
i need to set the result pointer to the row number I need.
can anyone help me?


There isn't one. If you want to go backwards, save your rows in PHP array and
use that instead.

Oracle 9i's OCI supports "Scrollable Cursors" which would allow you to go back
and forth through result sets, rather than the normal and more efficient
forward-only streaming of rows as soon as they're available. But PHP hasn't
implemented support for them, unless it's been added very recently.

The Oracle manual also states:

"Note:

Do not use scrollable cursors unless you require the functionality, because
scrollable cursors use more server resources and can have greater response
times than non-scrollable cursors."

What is the problem that you are trying to solve that requires seeking back
through the result set?

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

P: n/a
Andy Hassall <an**@andyh.co.uk> wrote in message news:
What is the problem that you are trying to solve that requires seeking back
through the result set?


I need to display, for example, ten rows of the result and after
clicking on next display another ten.
I used to do that with mysql using the mysql_data_seek()
Chripa
Jul 17 '05 #3

P: n/a
In article <35**************************@posting.google.com >,
ch****@volny.cz (chripa) wrote:
I need to display, for example, ten rows of the result and after
clicking on next display another ten.
I used to do that with mysql using the mysql_data_seek()
Chripa


For what it's worth, after writing a few of these 'paging' functions
myself (using MySQL 'LIMIT' in the query), I decided to standardize on
the DB_Pager module from PEAR. It does all the tedious calculation
needed to build next/previous/first/last/intermediate links.

<http://pear.php.net/package/DB_Pager>

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #4

P: n/a
On 4 Apr 2004 01:53:00 -0800, ch****@volny.cz (chripa) wrote:
Andy Hassall <an**@andyh.co.uk> wrote in message news:
What is the problem that you are trying to solve that requires seeking back
through the result set?


I need to display, for example, ten rows of the result and after
clicking on next display another ten.
I used to do that with mysql using the mysql_data_seek()


It sounds like you're fetching the entire result set then only using some of
it - this isn't very efficient.

You should limit the result set to just those records you want. For Oracle,
you could look into using ROWNUM or the ROW_NUMBER() analytic function.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #5

P: n/a
Andy Hassall <an**@andyh.co.uk> wrote in message news:<d8********************************@4ax.com>. ..
On 4 Apr 2004 01:53:00 -0800, ch****@volny.cz (chripa) wrote:
Andy Hassall <an**@andyh.co.uk> wrote in message news:
What is the problem that you are trying to solve that requires seeking back
through the result set?


I need to display, for example, ten rows of the result and after
clicking on next display another ten.
I used to do that with mysql using the mysql_data_seek()


It sounds like you're fetching the entire result set then only using some of
it - this isn't very efficient.

You should limit the result set to just those records you want. For Oracle,
you could look into using ROWNUM or the ROW_NUMBER() analytic function.


If you decide not to use DB_Pager, perhaps the query under the
"and we said..." heading in
http://asktom.oracle.com/pls/ask/f?p...127412348064,Y
will be useful. Lower down there is also some interesting
discussion about how to be innaccurate to save time.
-- CJ
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.