Batch read Oracle data __oracle

Source: Internet
Author: User

        Problem Description:   A large number of external terminals access the internal UNIX server via the socket, Requires data from the server's Oracle database to be displayed in the terminal processing. The maximum number of sockets required for the socket is 5,000 characters, then for the mass of data required to obtain data and multiple transmission, how to achieve it.

Solution: First consider using rownum, but in Oracle (version 10g), rownum cannot use ">", and after a simple test, found that "order by XXX" combined with rownum query, There is no guarantee that the data in the query is consistent and that the order has changed (why. I think it might be the case that I made the select first and then the order by sort. The truth will be verified later. )。 So consider nested select to solve the problem that rownum cannot use ">". Considering that ROWID is the only sign that identifies the record, use order by rowID Bar, after simple test, the problem seems to be solved. SELECT *
From (
SELECT rownum SN, T. *
From table_name t
ORDER BY ROWID
)
WHERE SN > 5
and SN <= 10

Wait for further testing ...

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.