How do I limit the number of rows retrieved at a time using RefCursor?

I have a PL/SQL package in use, that returns a REF CURSOR. This is currently being used in a Forms 6i application. Now I want to develop an ASP.NET web application that displays exactly the same information as my Forms 6i module. In fact those two applications will be used concurrently for a while.
I looked at the sample code provided on otn.oracle.com and decided to use the OracleDataAdapter.Fill()-method to fill a dataset and bind that dataset to a pageable GridView. Now I wonder, whether this method retrieves ALL records of the query at once and how I can limit the number of rows fetched? The Select statement retrieves up to 10000 rows at a time. Most of the time, a user is only interested in the first 20-30 rows. Forms 6i fetches more rows as the user scrolls down, how can I implement the same behavior in ODP.NET?
- Markus

Excuse me, but the reply does not quite answer my question. Maybe I did not explain my concerns clear enough:
I understand the use of the two properties (RowSize and FetchSize) to reduce the amount of round trips needed to transfer the data - not the number of rows fetched in total. This would still lead to a situation where all rows are transferred, when I am using the OracleDataAdapter.Fill()-Method. Is this correct or did I misunderstand the function of this method?
I quote the otherwise really helpful article you send me:
Of course, there is a cost if the fetch size is arbitrarily large. More client-side memory and processor cycles will be needed to store and manage a larger amount of data. The goal is to find a high-performing balance between the number of round trips and the amount of data retrieved per trip.
My RowSize is for sure a bit larger than the one in the given example. The query will probably be used by up to 100 users at a time, so I would like to limit the resource-costs not only on the network by the number of round trips, but also on the web-server which is storing all these records in it's memory per user-request.

Similar Messages

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select
    statement. I have a query where I return the number of stores
    that are located in a given area.. I only want to return the
    first twenty-five stores. In some instances there may be over
    200 stores in a given location.
    I know is SQL 7 that I can set the pagesize to be 25....
    Anything similiar in Oracle 8i?
    null

    Debbie (guest) wrote:
    : Chad Nale (guest) wrote:
    : : How can I limit the number of rows returned by a select
    : : statement. I have a query where I return the number of
    : stores
    : : that are located in a given area.. I only want to return the
    : : first twenty-five stores. In some instances there may be
    : over
    : : 200 stores in a given location.
    : : I know is SQL 7 that I can set the pagesize to be 25....
    : : Anything similiar in Oracle 8i?
    : If you are in Sql*Plus, you could add the statement
    : WHERE rownum <= 25
    : Used together with an appropriate ORDER BY you
    : could get the first 25 stores.
    Watch out. ROWNUM is run before ORDER BY so this would only
    order the 25 selected
    null

  • How do you limit the number of rows return from query?

    How do you limit the number of rows return from query? Do all databases support this kind of feature?

    i think the standard is limit
    to get the top 30
    select * from mytable LIMIT 30;returns the first 30 rows
    also if you want a range
    select * from mytable LIMIT 10,30;returns 30 rows starting from 10
    this last one is useful for displaying ranges... something similar happens in these forums when viewing topics and messages

  • How can I limit the number of rows in Oracle?

    Hi All,
    I am using very complex query where I join 6 table to fetch data from database.
    I have requirement like fetching a first 10000 row and then fetching another records after 10000 and so on.
    I just want to know how to fetch a limited number of rows using sql query. Moreover, I also want to know how to calculate the total number of row (alternative of count method because I don't want to query the database twice because its affect the performance).
    Thanks in advance.
    Regards,
    Sunny

    sunny@oimnewbie wrote:
    Hi All,
    I am using very complex query where I join 6 table to fetch data from database.
    I have requirement like fetching a first 10000 row and then fetching another records after 10000 and so on.
    I just want to know how to fetch a limited number of rows using sql query. Moreover, I also want to know how to calculate the total number of row (alternative of count method because I don't want to query the database twice because its affect the performance).
    Thanks in advance.
    Regards,
    SunnyThis smells like a very fishy requirement based on a fundamental misunderstanding of how Oracle works. Could you explain why you want to arbitrarily limit the result set to 1000 rows? What will happen between that and getting the "next" 1000? What triggers getting the "next" 1000? and how do you define "next", since there is no ordering in a heap table.
    I suspect we can make that requirement go away be presenting a better approach to the real issue.

  • How to limit the number of rows in a smart form , sap script.

    Can anyone tell me how to limit the number of rows in the output of a sap script/smart form. I have tried "protect/endprotect" in sap script but have no idea of how to do in smart form. In sap script the only way it has happened is by reducing the size of the main window.

    Hi,
    In Smartform also, why dont you try reducing the size of the window if you want to limit the rows in it. Also if you are printing Line Items in a LOOP, you can write
    LOOP AT T_ITAB FROM 1 TO N in the LOOP Node if you know how many records exactly you want to display in 1 Page processing.
    regards,
    Mahesh

  • How to limit the number of rows in a report

    I have several reports with a number of parameters - date ranges etc.
    Depending on the parameter values selected by the user the reports can return thousands of rows.
    I would like to limit the number of rows returned to, say, 500. If more than 500 rows are returned by the query then display an error message requesting that the user enter more specific parameters.
    Ideally for performance reasons it would be good to catch the error before the datafile is generated, but I don't know if this is possible. Alternatively a check in the template might do the job - using COUNT on the group?.

    Hi Hugh,
    In your query, you got to add rowum < 500 or some sort of DB specific limit to the row being returned,
    this will help to stop the report to get more than 500 records and the report template wont have any restriction.
    or
    you can do that in template too, but i would not recommend.
    In these both cases or in any case, you cannot give any meaningful error if it exceeds N rows,there is no option like this till now.

  • Need to know how to limit the number of rows returned on Oracle

    MS SQL Server has a command called 'set row count'.
    We are trying to find similar one on Oracle.
    What we are trying to do is that instead of using rownum in the query statement, we would like to find way to limit the number of rows returned. I understand that we can use JDBC resultSet object, but that's not what we want.
    I know Oracle has one called arraysize, but this would not limit the number of rows returned either.
    Pease help.
    Thanks

    I understand that we can use JDBC resultSet object, but that's not what we want.I'm not sure which feature of ResultSet you use and which not.
    But if this question has anything to do with JDBC (that's the forum where you put it), I'd recommend to use Statement.setMaxRows(). This will limit the count of rows which your statement will fetch into it's ResultSet.

  • How can I limit the number of ros in TextArea?

    As I turn on the line wrap and having used setRows method,
    I cannot limit the number of rows of the textarea into 2.
    How can I limit it?
    Thanks.

    camickr wrote:
    I give up. You don't know specify requirements and I'm not going to prompt you every 5 minutes for more information.
    due to setText method So this implies that the text comes from somewhere, maybe a database, but the user does not type the text directly into the text area.
    If you define the text area with 2 rows, then the third row will not be visible, so I don't see the problem. Just don't add the text area to a scroll pane and the user will never know the third row is there.[http://i188.photobucket.com/albums/z55/nwoedf/temp/error.png ]
    it demonstrates the problem with excess line
    The third row is still visible even I have used setRow(2).

  • How can I limit the number of emails retained on my ipad air?

    How can I limit the number of emails that are retained on my iPad Air?  Because of legal requirements of a long-term project, I cannot permanently delete emails relating to that project from my ISP's mail server.  My gmail account contains over 17,000 emails and, upon setting up my new iPad, and updating to ios 7.1.1, I now have all 17,000+ emails taking up space.  I would like to limit the emails by count as I was able to do on my old iPad running ios 5.1.1 OR to retain them based on date range.  I have not found any instructions on the support discussions or general iPad blogs that allow me to do that.  Any way around this problem?
    I also miss the 5.1.1 mail search feature that allowed me to narrow the search by from/to/subject/all.  Does anyone know if that feature is available using some little-known ios 7.1.1 feature?
    Thanks for your help.

    jlfcba wrote:
    IOS 7.1.1 doesn't show a "days to sync" parameter anywhere in SETTINGS/Mail,Contacts,Calendars/ACCOUNTS/GMAIL Account/ GMAIL Acccount Info.  There is nothing in iTunes relating to such an option either.  So, it seems I'm back to square one.
    If you have a decent mail provider like Microsoft Hotmail or Outlook.com mail it does.
    If you have Gmail it does not.  Quite right. Gmail is rubbish.

  • HT2729 I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    I have limited space on my new ipad. How can I limit the number of songs from my itunes on my imac from going to my ipad when I connect the two?

    you can do this by keeping the external hard drive connected and doing the following
    -hold shift key down on computer while opening iTunes and a prompt will appear to choose a library
    -select choose library, iTunes should bring up your explorer windows where you can search for the external HD
    -after you find the external HD find the iTunes folder you just copied to it
    -after opening the iTunes folder look for the file that says iTunes library.itl or if you can't see that extenstion just look for a document looking thing in the iTunes folder that shows up as a database file
    -double click the database file and boom iTunes should load your library without having to copy it to the computer
    PS: do make sure that if you are going to do it this way, make sure that the external HD is connected at all times, because if you don't then you will get exclamation marks next to your iTunes songs
    double PS: if you are unsure how to find out if the iTunes library file is a database file just right click it and choose properties and under the type it should say database file
    hope this helps:)

  • Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    Hi, how can I limit the number of emails I can see on my iPhone 5. Every time in delete one and older email gets added from my live.co.uk account (where I want to keep my 2500 emails) I just don't want many on my phone. Thanks

    You can't. Why on earth would you attempt to manage 2500 emails with setting up a folder structure or some means of doing so? Simply keeping them in an single inbox is not realistic, no matter what email client you use.

  • How do I limit the number of emails that show in my active mailbox?  There was a way in Settings on ios 6, but i can't find it in ios 7.

    How do I limit the number of emails that show in my active mailbox?  There was a way in Settings on ios 6, but i can't find it in ios 7.

    You need to delete your current hotmail account set up on your iphone.
    Once this has done click 'Add Account' and select the new 'outlook.com' tab.
    Set up your hotmail account again from scratch and this will then allow you to select how many weeks/months of emails you sync to your phone.
    Im not sure if anyone else had a similar problem to me prior to iOS 7, but if i deleted an email from my hotmail account on my iphone - it wouldnt sync with my actual hotmail account. So when i logged in online all the emails I had deleted on my phone would still be showing as unread.
    But by setting the account up as above, they now sync perfectly.
    Well for me anyway

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How do you return the number of Rows in a ResultSet??

    How do you return the number of Rows in a ResultSet? It's easy enough to do in the SQL query using COUNT(*) but surely JDBC provides a method to return the number of rows.
    The ResultSetMetaData interface provides a method for counting the number of columns but nothing for the rows.
    Thanks

    No good way before JDBC2.0. u can use JDBC2.0 CachedRowSet.size() to retrieve the number of rows got by a ResultSet.

Maybe you are looking for

  • HP 1610 All-in-one drivers not seen by Printer Setup Utility

    Just got this new for christmas. I downloaded the latest software and installed it. It was "successful". Everything with the software and the printer seems to be OK. When I go to add the printer to Printer Setup Utility I see the printer icon with a

  • IDoc adapter inbound channel: Error Connection err

    Hi, We are trying to push an IDoc from R3, it's status is green in WE02. However, the IDoc is not reaching PI. In tcode SM58 in R3 we are getting an error "IDoc adapter inbound channel: Error Connection err". I have gone through the SAP note 940313 b

  • RME card - compatible?

    Hi folks, I've been avoiding both Leopard and Intel Macs in an attempt to keep all plugins and apps compatible and running. I'm thinking of moving to Leopard (on a G5 PPC for now), using Logic 8.0.2. I have an RME Hammerfall 9636 audio card. Will it

  • My two finger scroll is not working

    My two finger scroll does not work on Firef

  • Screen rotation doesnt work after upgrading to lolipop

    After upgrading my phone to lolipop the auto rotation doesnt work even in the safe mode