Limit of Rows in ResultSet

Exactly how many rows can you actually handle in a result set. I have a database in which some table have over 10000 entries and some tables have only 1200. How many rows can I read in at one time without causing a problem with the application? Right now I read in chucks of 20 at a time. It that a good idea or should I just read in all 10000 at one time?

It all depends:)
I use both ways:
If you are not showing the data to the user but processing data, continue as you are. There is no need to fill a lot of memory with data if you ara using only a few rows at a time.
When data is to be shown to the user, I try to fetch all the rows at one time.I show a dialog with the count of fetched rows and the user can interrupt the operation at any time.
I don't remember now, but on my tests I did fetch 10k rows with 1.4k row size (170 fields) and there was no problem showing it in a jtable (in a 128MB client).
I have a client with 64MB that also uses the app and he is able to fetch 3-4k rows with not to much problems
10k rows * 1.5k row size is 15M data.
10k rows * 170 fields * 8 bytes array entry pointer ~ 14M
10k rows * 170 fields * 16? bytes per object created ~ 27M
Total memory ~ 50M memory usage. that's not to much as this is a table with big rows:)

Similar Messages

  • How do I apply filters or limit the rows on my report using a Date field in SQL report builder 3.0?

    I have a status of completed and a date field in the dataset. The date field is either empty or contains a date. All 2015 dates are holding dates.
    So how can I limit the report to only pull completed status with an empty date or a holding date?
    I have not been able to set an OR option on a date field filter and if I add two filters on the date column one for empty one for > 12/31/2014 then it treats it as an "and" and pulls nothing from the list I have in sharepoint.
    any help will be appreciated.

    Hi MB,
    In Reporting Services, the relationship of  filters is “And”, and there is no option to change the relationship from “And” to “Or”. While we can use “or” operator within the expression to create one filter to integrated all filters to work around this
    issue.
    We can add a filter as follows in the dataset to limit the rows in your report:
    Expression: =Fields!date.Value is nothing or Fields!date.Value>"12/31/2014"    Type: Boolean
    Operator: =
    Value: true
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Netweaver Error in Logs - JRA - Could Not Insert Row To ResultSet

    Hi there
    we have an MII 12.1.5 instance (with Patch) installed on a Netweaver platform (SP 3).  We're using the JRA action blocks to call an RFC (we populate the request doc with multiple nodes first) and they're all executing completely without any problems at face value.  When I look at the Netweaver logs (MII filter on), I'm getting quite a few entries per transaction run which hold the following Error Messages:
    Message:
    Could Not Insert Row To ResultSet
    Category:
    /Applications/XMII/Xacute
    or
    com.sap.xmii.storage.connections.JRAUtil
    Location:
    com.sap.xmii.storage.connections.JRAUtil
    Application:
    sap.com/xappsxmiiear
    Has anyone seen these errors or know what could be causing them?
    Thanks,
    Lawrence

    Hi.
    This is a known issue and have been there in some versions, the JRA action block seems to be working (but causes this problem in the Netweaver log) and the JCO action block do not have this problem.
    I have just reported as an OSS to SAP.
    BR
    Poul.
    Edited by: Poul Klemmensen on Apr 12, 2010 4:57 PM

  • Can i count row from ResultSet ?

    I would like to count row from ResultSet for
    take it into my array object because i must know number of row before create array object.
    Example:
    ResultSet rset = stmt.executeQuery("select * from user ");
    /*i = amount of ResultSet*/
    User[] user = new User;
    int l=0;
    while (rset.next()){
    user[l] = new User();
    user.name = rset.getString(1);
    l++;

    Hi,
    As per my knowledge there is no method by which you can get the count of items in a resultset directly. You will have to loop through the reseltset and set a variable for count. In your specific case I would advise you to use a Vetor instead of an array so that you need not bother about the size.
    ResultSet rset = stmt.executeQuery("select * from user ");
    Vector user = new Vector();
    while (rset.next()){
    user.addElement(rset.getString(1));
    Now you will have a Vector that holds the user info. To retrieve the user info loop through the Vector.
    for (int i; i<user.size(); i++){
    userName = user.elementAt(i);
    Hope I was of some help.
    cheers!!!
    Nish

  • Limit Inserted rows

    Hello,
    i need/want a SQL in my ETL-Process (building a DWH) that find data sets in the fact table which have no reference to the dimension table. These incorrect data sets should be inserted in an error table.
    insert into ERROR_TABLE
    SELECT distinct(f.JA) FROM STAGE.FAKT f WHERE NOT Exists (SELECT d.JA FROM TD_YEARS d WHERE  d.JA = f.JA);To improve the performance of the ETL-Job i want to limit the rows that are inserted in the ERROR_TABLE!!!
    With ROWNUM i can only limit the rows in the select-statement - can´t i?
    I want something like that:
    insert *100 ROWS* into ERROR_TABLE
    SELECT distinct(f.JA) FROM STAGE.FAKT f WHERE NOT Exists (SELECT d.JA FROM TD_YEARS d WHERE  d.JA = f.JA);The fact-table has 100.000.000 rows!
    The target should be, that if the database find in the first 250 rows of the fact-table 100 incorrect rows the SQL should be stopped!
    Otherwise all 100.000.000 rows are read - although i only need 100 rows.
    Is this possible? I don´t think so - or?
    Best regards and a happy new year:)
    Heidi

    >
    I think in all your examples ALL rows in the fact table are read and after that the result is limited.
    Or am i wrong?
    >
    Yes and No.
    For simple queries all of the rows do not need to be read.
    You can test this easily yourself by getting an execution plan for a simple query on a large table.
    SELECT * FROM myLargeTable WHERE ROWNUM < 10;That is pretty similar to asking someone in a library to go back to the stacks and bring me the first 10 books you find. Clearly they won't have to look at every book.
    On the hand consider a query like one of those suggested (based on the query you provide)
    .i.e. select * from (
    SELECT distinct(f.JA) FROM STAGE.FAKT f WHERE NOT Exists (SELECT d.JA FROM TD_YEARS d WHERE d.JA = f.JA);
    where rownum<=100;You are asking Oracle for 100 of the DISTINCT rows. Oracle cannot know that a row is DISTINCT (that is, does not have a duplicate) unless it examines ALL of the rows. The very last row might be a duplicate.
    That is like asking that same someone in a library to go back to the stacks and bring you just 100 books by authors that have only written ONE book. They find the first book by author 'BERNARD' and now the problem is to know whether there are any other books in the entire library written by 'BERNARD'.
    There are only two ways to determine that: 1) examine every book or 2) use an index (card catalog).
    If there is an appropriate index available it can be used to identify DISTINCT authors and find 100 books. If not, then yes, every book (row) has to be examined.
    For your use case if there is no appropriate index available then Oracle has to read every row and then either sort the data in order or use a hash in order to identify distinct rows. Only then can it return the first 100 distinct rows.
    In spite of that using ROWNUM or the FIRST_ROWS hint is still the best way to limit the results.
    If you set the timing on

  • Help :add multiple rows from Resultset to ArrayList ?

    My query returns one column and multiple rows. In Java code , I am trying to get this data in array or arraylist through ResultSet
    ex:
    item_num
    p001
    p002
    p003
    when I print, it only gets the item in the first row.
    ArrayList myArrayList = new ArrayList();
    resultset = preparedstatement.executeQuery();
    if (resultset.next())
    myArrayList.add(new String(resultset.getString("item_num")));
    Print:
    for (int j = 0 ; j < myArrayList.size() ; j++ )
    System.out.println((String)myArrayList.get(j)); --this prints only the first item.
    can someone assist ?

    changing if to while fixed it.

  • Result Set - How to retrieve the number of rows in resultset

    harlo....everyone.
    i m new in this language and would like to ask that how can i store the result into an array or u all hav others ideal to do it......? Hopefully can get answer asap....thanksssss.
    Below is the source code that i did. Please comment it
    ResultSet rs = stmt.executeQuery("Select CCourse_Code from RegisteredCourse, Student where Student.NStud_ID ='123'and Student.CStud_Pwd='123' and Student.NStud_ID = RegisteredCourse.NStud_ID ");
    if(rs!=null){
    // can i get the the number of records in resultset, rs to define my array size
    String course[] = new String[2];
    while(rs.next()){
    for(int i =0; i<course.length; i++)
    course[i] = rs.getString("ccourse_code");
    return course;

    Or...
    ResultSet rs = stmt.executeQuery("Select count(CCourse_Code) from RegisteredCourse, Student where Student.NStud_ID ='123'and Student.CStud_Pwd='123' and Student.NStud_ID = RegisteredCourse.NStud_ID ");
    This should return a table with one row and one column. This will hold the number originally requested.
    However I would still go with the ArrayList suggestion given above.

  • How do i get the number of rows in Resultset?

    Hi,
    Is there a way to make the size of string array according to the number of records
    from the Resultset? The other problem is the values in saRow are all null.Why is it so? Thanks for helping me in advance
    String sql = "SELECT Name FROM UserType" ; << Return "Admin" "User" "CIO"
    ResultSet rs = db.ExecuteSQL(sql);
         while (rs.next()) {
         int i=0,rowCount;
         String[] saRow = new String[2]; << supposed to use rowCount
         saRow[i++] = rs.getString("Name");
         System.out.println(saRow);
    //System.out.println
    Database Query Success
    null << saRow value
    null
    null
    null
    null
    null

    Essentially, you can't. A ResultSet is not a set of rows in memory: it is a cponnection to a back end database. Potentially, you start getting results out of the result set while the database is still searching for more.
    I see this all the time on these forums: people doing work in java that is better done on the database. If you want to know the number of records in the database, ask the database: "select count(*) from UserType". Especially once you start needing to search big tables.
    However, in this case, where you are just loading up the types: why bother? You know that there wioll only be a few of them. Load the results into an ArrayList. Go to the JavaDocs that you downloaded with the JDK, go to the "guides" section, and see the guide on the collections API.

  • How can i limit my rows in a query?

    What SQL query could i use to limit rows for example from 5 to 5 rows?
    for example:
    Select EmpNo, Ename From Emp; (imagine it has 10,000 records) and i want to present them as 5 at the same time.
    what SQL query or instruction should i use? (since CURSORS are not an SQL standard) how else could i achieve that?
    thanks

    HOW TO: Get first n, last n, or rows m thru n, top-n analysis, ROWNUM pseudocoumn

  • Get number of rows in ResultSet object

    Can anybody guide me on how to get the total number of rows in a result set object without iterating through all rows? Thanks.

    Hi Soon,
    You mention that you want to get the row count without iterating through the "ResultSet". I don't know what database you are using, but I want to inform you that with my Oracle 8i (8.1.7.4) database, using JDK 1.3.1 and the matching JDBC (thin) driver, the implementation of the "last()" method (that others have recommended that you use), actually iterates through the whole "ResultSet".
    What I do is first execute a "SELECT COUNT(1)" query (using a literal "1") to get the number of rows -- this is much faster than executing the "last()" method.
    Then I execute my actual query.
    Hope this helps you.
    Good Luck,
    Avi.

  • Get the no of rows in resultset

    Hi
    Can any1 tell me how can i get the no of recods in a particular resulset.
    like ,is there anything like ResultSet.RowCounts() ???

    what if i need to know the no of rows in the resultset beforehand? Like in the following example---
         con = this.dataSource.getConnection();
         proc = con.prepareCall("{ ? = call                          P_STORED_PROCEDURE(?,?) }");
         proc.registerOutParameter(1, Types.OTHER);
         proc.setString(2, name);
         proc.setInt(3, Id);
         proc.execute();
         rs = proc.getResultSet();
         MyClass[] myClass = null;                              
         MyClass = new MyClass[SIZE]; // I need SIZE
         for(int i=0;i<SIZE;i++){
         while (rs.next()) {
         myClass .setName(rs.getString("Name"));
         myClass [i].setTester(rs.getString("Tester"));
         myClass [i].setID(rs.getInt("ID"));
         myClass [i].setProcessType(rs.getString("Process_Type"));

  • SQL Query does not have all rows in ResultSet

    I am using JDK 1.4.2 and an MS Access 2000 database where I attempt to retrieve data and I get in the ResultSet a maximum of around 280 rows, but there are more that seem to be ignored. In Access I can see them using the same query.
    The Statement.getMaxRows() returns 0 and I do not understand why I do not get the other ones. The query is issued using Statement.executeQuery(String), but using execute() does not make a difference, There is just one ResultSet returned.
    I would appreciate your help.

    I had this same problem once because in my Java code I was connecting to our alpha database and when I was running the query manually I was connecting to our production database.
    The only other thing I can think of that might cause this is if on the 281st row there is something wrong with the row and maybe the SQLException isn't being processed? Can't really say without seeing your code, but if you don't have a printStackTrace() or some indicator when a SQLExcpetion is thrown it could be breaking without your knowing. If those aren't the problems maybe you could post your code.

  • Can you limit returned rows in a loop?

    Say you have 45 line elements in an invoice, how would you only show 15 per page?
    I tried fixing a row height, but the loop just bust right though that. Is there a way to limit how many are returned?
    Thanks,
    Jeremy

    I have tried this and I receive the following error -
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\Desktop\Test.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(XSLT10gR1.java:586)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:383)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:201)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:161)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:1015)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:968)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:209)
         at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1561)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:951)
         at RTF2PDF.runRTFto(RTF2PDF.java:626)
         at RTF2PDF.runXDO(RTF2PDF.java:460)
         at RTF2PDF.main(RTF2PDF.java:251)
    Caused by: oracle.xdo.parser.v2.XPathException: Variable not defined: 'start'.
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1526)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:517)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:485)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:264)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:150)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:187)
         ... 16 more
    Do you have any idea what I have done wrong in order to receive this error?
    Thanks,
    KAP

  • XMLTable - 65535 limit on rows returned

    Hi,
    I've come across a problem with the Oracle XMLTable command as follows:
    - I have an XML doc (approx 30Mb) which contains 79k entries
    - I have this referenced in Oracle as a BFile
    - If I count the number of rows returned by the XMLTable command it does not equal 79k - instead the number is 79k - 65535
    Is there a limit on the number of rows XMLTable can handle (ie. < 2 ^ 16) or am I missing something?
    declare
    xbfile BFILE;
    res BOOLEAN;
    countrows number;
    begin
    xbfile := bfilename('XML_DIR', 'test.xml');
    res := DBMS_XDB.createResource('/public/test.xml', xbfile);
    select count(*) into countrows from XMLTable('for $i in doc("/public/test.xml") return $i/ROWSET/ROW'
    columns ID INTEGER);
    dbms_output.put_line('count=' || countrows);
    end;

    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    5 rows selected.
    SQL> set autotrace on
    SQL> select count(*)                                                                                       
      2  from xmltable( '$d/ROWSET/ROW'                                                                   
      3               passing xmltype( cursor( select rownum from dual connect by level <= 70000 ) ) as "d"
      4               columns rnum integer path 'ROWNUM'                                                  
      5               )                                                                                   
      6  /            
    COUNT(*)
        70000
    1 row selected.
    Execution Plan
    Plan hash value: 1051571446
    | Id  | Operation                            | Name                   | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                     |                        |     1 |    29   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE                      |                        |     1 |            |          |
    |   2 |   VIEW                               |                        |  8168 |    29   (0)| 00:00:01 |
    |   3 |    VIEW                              |                        |  8168 |    29   (0)| 00:00:01 |
    |   4 |     COLLECTION ITERATOR PICKLER FETCH| XMLSEQUENCEFROMXMLTYPE |       |            |          |
    Statistics
          70005  recursive calls
         148263  db block gets
          30391  consistent gets
              0  physical reads
              0  redo size
            411  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              1  rows processed

  • Limit on rows returned

    Is there a limit to the number of rows that Portal is able to return?

    I currently have a qbe report that we are trying to use as a query tool. We are now trying to test on the production database. The user is seeing that it seems to only be returning the first 10,000 records. I was wanting to find out if this is a limit or something that can be changed?

Maybe you are looking for

  • How to assign two complex type data in message payload

    Hi , In my xsd file two complex type data is there , but when i am trying to add these in message type request and response payload , i can add only one payload, is it any way to add 2 complex types in message types request and response payloads. Reg

  • How can I get Samsung Kies to work with Mavericks?

    I've wasted an evening fiddling with Kies. I have deleted it just in case there were any serious conflicts but I would like to put my iTunes uploads (not purchases) on my Samsung Galaxy. Any ideas?

  • Profit center change on contract

    Hello all, I wuld like to change contract master data : profit centers are incorrect. But if invoicing has been made, it is impossible to change this value, even if invoice cancellation has been performed. What may I do ?

  • Transactions created by user "WEBLOGIN"

    Hi Experts,    We have ISA b2b ecom application.   Very rarely,   Order created by some user ID  is replaced  as created by WEBLOGIN.   As per  my understanding  WEBLOGIN is the system user id no one will use the WEBLOGIN ID to create the orders.   H

  • App Store app in my iPhone crashes very often. Why? There is a solution for this?

    I have tried to find for a way to contact/ask apple directly about this issue with no avail, until I found this place. This is my first question here. I am a newby. Sometimes when I open my App Store app in my iPhone and I  am either browsing for app