SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2001
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mySQL to Oracle migration

    Trying to port an existing mySQL DB on to an Oracle platform.

    I would like to replace the mysql function 'mysql_data_seek' which moves the internal row pointer.


    Basically, is there any way of moving the cursor within a result set after an Oracle query?

    e.g. I can execute a query : 'SELCT * FROM TABLE WHERE ID > 40', which could return 100 results.
    But, instead of displaying results starting from row 1 to 100, we want to start displaying from row 30 onwards (i.e. drop the 1st 30 rows)

    Although I can achieve this using a sub select (nested query) this workaround is not ideal as it will mean changing the code manually each time this occurs.
    Instead we're looking for a generic solution - thus the internal cursor would be perfect.

    Any ideas out there?

  2. #2
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you can use ROWNUM to limit queries like this - something along the lines of

    "SELECT * FROM TABLE WHERE ID > 40 AND ROWNUM > 30"

    It's a while since I've used Oracle so you'll be best off refering to your documentation, but ROWNUM (and possibly ROWID) will be worth looking up.

    Hope that helps .
    Nick Wilson [ - email - ]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •