Page by page iterator, how to limit the size of returned results

Hi all,
I am designing a search result page using a page by page iterator pattern. Let's say my SQL query returns 100 results. I want to show the first 20 on the result page and provide links to the rest. I am thinking to write a SQL query that tells the total number of the results and only return the first 20 results with all the attributes I need so that I can limit the network usage. I also need to know where to proceed to the next 20 and so on. The query is a simple join of two tables. What would be the query look like?
thanks,
JS

One way is to periodically (say every week) create a new file to store the actions and then, when the space taken up by all the files is too large, delete the oldest one.
You can also have your application periodically (say the first time you write to the file on any calendar day) check the size of the file and, when it gets too big, copy all of the actions in the file after a given time (presumably there is an associated timestamp with each action) to a new file. Then delete the old file.

Similar Messages

  • How to limit the number of search results returned by oracle text

    Hello All,
    I am running an oracle text search which returned the following error to my java program.
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    #### ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    java.sql.SQLException: ORA-29902: Fehler bei der Ausführung von Routine ODCIIndexStart()
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
    When i looked up the net, one suggestion that was given is to narrow the wildcard query, which i cannot in my search page. Hence I am left with the only alternative of limiting the number of results returned by oracle text search query.
    Please let me know how to limit the number of search results returned by oracle text so that this error can be avoided.
    Thanks in advance
    krk

    Hi,
    If not set explicitly, the default value for WILDCARD_MAXTERMS is 5000. This is set as a wordlist preference. This means that if your wildcard query matches more than 5000 terms the message is returned. Exceeding that would give the user a lot to sift through.
    My suggestion: trap the error and return a meaningful message to the user indicating that the search needs to be refined. Although it is possible to increase the number of terms before hitting maxterms (increase wildcard_maxterms preference value for your wordlist), 5000 records is generally too much for a user to deal with anyway. The search is not a good one since it is not restricting rows adequately. If it happens frequently, get the query log and see the terms that are being searched that generate this message. It may be necessary to add one or more words to a stoplist if they are too generic.
    Example: The word mortgage might be a great search term for a local business directory. It might be a terrible search term for a national directory of mortgage lenders though (since 99% of them have the term in their name). In the case of the national directory, that term would be a candidate for inclusion in the stoplist.
    Also remember that full terms do not need a wildcard. Search for "car %" is not necessary and will give you the error you mentioned. A search for "car" will yield the results you need even if it is only part of a bigger sentence because everything is based on the token. You may already know all of this, but without an example query I figured I'd mention it to be sure.
    As for limiting the results - the best way to do that is to allow the user to limit the results through their query. This will ensure accurate and more meaningful results for them.
    -Ron

  • How to limit the size of bounced messages

    Hi,
    how can i limit the size of bounced messages?
    In most cases, we have users which accounts are over quota, the mail bounces and is returned.
    How can i limit the size of the returned message to a maximum size of 1MB?
    We're using
    iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)
    libimta.so 5.2 HotFix 2.02 (built 13:42:55, Oct 21 2004)
    thx,
    ghfg

    Ah. found it. It is indeed in 5.2
    http://docs.sun.com/source/816-6009-10/mta.htm#24585
    look down the page, and find:
    CONTENT_RETURN_BLOCK_LIMIT
    this when put in the option.dat file will limit your response to the
    CONTENT_RETURN_BLOCK_LIMIT=
    number of 1k blocks.

  • How to limit the size of the connection method parameter

    I connected an FMS server like var nc = new NetConnection ();
                                                      nc.connect ("rtmfp :/ / localhost: 61018/zy/1", a);
    But how to restrict the size of the parameter a, assuming that this a set to a 10GB object, or a very large byte, I found that the server received. This allows the hacker attacks, Is there any way to limit the size of this a, I hope that does not exceed 100KB.

    RTMFP encodes low-level messages in a manner compatible with RTMP messages. RTMP messages are length-field limited to 16MB (24 bits), and there is an artificial software limit somewhat less than that (approximately 10MB if i recall correctly).
    it should not be possible to send a connect message to an RTMFP or RTMP server exceeding about 10MB.
    ByteArray is limited to 4GB, and can't be serialized to AMF beyond 512MB (29 bits).
    also keep in mind that for an RTMFP or RTMP server to receive such a large message, that many bytes must be sent to it from somewhere (you).

  • How to limit the size of a log file.

    Hi,
    I am developing an application that creates a log file with all actions that take place. My problem is that this log file grows a lot because the application acts as a server that is up 24 hours a day. For that reason, I wanted to limit the size of the log file by deleting de older lines, how can implement is?
    Thanks.

    One way is to periodically (say every week) create a new file to store the actions and then, when the space taken up by all the files is too large, delete the oldest one.
    You can also have your application periodically (say the first time you write to the file on any calendar day) check the size of the file and, when it gets too big, copy all of the actions in the file after a given time (presumably there is an associated timestamp with each action) to a new file. Then delete the old file.

  • How to limit the size of large core file

    These days in my project I am facing big trouble of large core files .
    I want to limit the size of the core file .
    Please help for same .
    Regards ,
    Abhi

    Hi Abhishek,
    You can explain more.
    OS?
    DB?
    SAP Version?
    /usr/sap/SID/DVEBMGS00/work/
    SAP folder is full and creating issue.
    Regards,
    V Srinivasan

  • How to limit the size of the displayed drop down ?

    Hello,
    basically the subj.
    I'm generating the drop down item from SQL based LOV.
    one of the records is looooong.
    Is there a way to limit the length of the drop down so it doesn't occupy 1/2 of the page?
    // i tried substr in LOV - it didn't produce expected result.
    Thank you.
    Andrew

    Chris,
    it's interesting - I have a text area to the right of the "select list" item. When i use your code that area moves furher to the right.
    I observe - the actual size of drop down doesn't change. only the size of the td can be increased...
    I'm using FF
    Here is the html code . I chopped off the rest of the values in options:
    <td align="left" rowspan="1" colspan="1" style="display: block; width: 100px;">
    <input type="hidden" value="3657620048154732" name="p_arg_names"/>
    <select id="P1_SELECT_BA" onchange="get_APP(this,'P1_SELECT_APP'); get_SRV(this,'P1_SELECT_SERVER')" size="1" name="p_t01">
    <option value="NULL">- No BA Selected -</option>
    <option value="Accounting">Accounting</option>
    <option value="Audit">Audit</option>
    <option value="BSD">BSD</option>
    //chopped off here

  • How to limit the size of the main window width according to the line items?

    Hi,
           In my requirement,I created one page with main window....Suppose say main window can accomodate 40 line items.
          I am getting 5 pages data.And in my last page ( ie 5'th page ) I will have only 20 line items.But for the remaing 20 line items,
         it showing empty area .I created widow with borders and one vertical line between the columns.....I created two columns.
         Please I dont want any horizontal lines between the line items but I created one vertical line between the columns..
           Any right help would be appreciated.
    Thanks,
    Chinnu
    Moderator message - Welcome to SCN.
    But duplicate posting is not allowed. If you have information you want to add to your post, you can edit it or post a follow up - Thread locked
    Edited by: Rob Burbank on Feb 19, 2010 12:17 PM

    One way is to periodically (say every week) create a new file to store the actions and then, when the space taken up by all the files is too large, delete the oldest one.
    You can also have your application periodically (say the first time you write to the file on any calendar day) check the size of the file and, when it gets too big, copy all of the actions in the file after a given time (presumably there is an associated timestamp with each action) to a new file. Then delete the old file.

  • How to limit the size in a cell belonging to a JTable

    We are handeling a JTable control and we've just realized we aren't able to capture the focuslost event in this control. Hence, We want to know how we can advise the user when he has written more character than are allowed.

    here jr. Look at this...
    //Prior to J2SE 1.4, limiting the capacity of a text component involved overriding
    //the insertString() method of the component's model. Here's an example:
        JTextComponent textComp = new JTextField();
        textComp.setDocument(new FixedSizePlainDocument(10));
        class FixedSizePlainDocument extends PlainDocument {
            int maxSize;
            public FixedSizePlainDocument(int limit) {
                maxSize = limit;
            public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
                if ((getLength() + str.length()) <= maxSize) {
                    super.insertString(offs, str, a);
                } else {
                    throw new BadLocationException("Insertion exceeds max size of document", offs);
    //J2SE 1.4 allows the ability to filter all editing operations on a text component.
    //Here's an example that uses the new filtering capability to limit the capacity of the text component:
        JTextComponent textComponent = new JTextField();
        AbstractDocument doc = (AbstractDocument)textComponent.getDocument();
        doc.setDocumentFilter(new FixedSizeFilter(10));
        class FixedSizeFilter extends DocumentFilter {
            int maxSize;
            // limit is the maximum number of characters allowed.
            public FixedSizeFilter(int limit) {
                maxSize = limit;
            // This method is called when characters are inserted into the document
            public void insertString(DocumentFilter.FilterBypass fb, int offset, String str,
                    AttributeSet attr) throws BadLocationException {
                replace(fb, offset, 0, str, attr);
            // This method is called when characters in the document are replace with other characters
            public void replace(DocumentFilter.FilterBypass fb, int offset, int length,
                    String str, AttributeSet attrs) throws BadLocationException {
                int newLength = fb.getDocument().getLength()-length+str.length();
                if (newLength <= maxSize) {
                    fb.replace(offset, length, str, attrs);
                } else {
                    throw new BadLocationException("New characters exceeds max size of document", offset);
        }

  • How to estimate the size of query results

    i have 3 tables
    table_h : 10,000 records and 50columns
    table_l : 13,000 records and 75 columns
    table_ld : 25,000 records and 120 columns
    i wrote a query to fetch data based on the 3 tables, and fetching 25,00 records.
    ie ( 5 coulms from table_h, 12 coulmns from table_l and 120 columns from table_ld)
    how i have to get the size of this query results.

    What "size" are we talking about here? There are many different ways to interpret that-- it could be the size of the memory buffer that would be allocated on the client. It could be the size that would be required to store the result in a table in the database. It could be something else. But the answer may differ substantially.
    Regardless, it's probably going to be something like (number of rows) * (sum of sizes of each column). But the size required for each column is a bit variable
    - Client applications, in general, are going to allocate a memory buffer based on the maximum size of the column (LOB and LONG columns excepted). So if you declare a VARCHAR2(4000) but only store 1 byte in that column, most client applications are going to allocate 4k for that column for each row. It might be even worse than that-- if the client application happens to treat character data as Unicode, it probably uses the UTF-16 encoding in memory, which means allocating 2 bytes for every byte in the database (assuming the database character set supports single-byte characters primarily).
    - The Oracle database, on the other hand, is not going to allocate more disk than is actually required to encode variable width data. So the 1 byte column only requires 1 byte of storage (plus a length). That's great for storage efficiency, but that makes computing the actual size a bit more complicated because you now need to know the actual size of data stored in each row (or at least the statistical distribution) rather than the table definition.
    Justin

  • How to limit the size of main window height according to the line items?

    Hi,
    In my requirement,I created one page with main window in smartforms....Suppose say main window can accomodate 40 line items.
    I am getting 5 pages data.And in my last page ( ie 5'th page ) I will have only 20 line items.But for the remaing 20 line items,
    it showing empty area .I dont want this empty area .I want that window size to be restricted dynamically to that 20 line items.I created widow with borders and one vertical line between the columns.....I created two columns.
    Please I dont want any horizontal lines between the line items but I created one vertical line between the columns..
    This is in Smartforms
    Any right help would be appreciated.
    Thanks,
    Chinnu

    Hi Abhijit,
                    This problem is solved but I have the below another new problem.Can you pls help me in this regard.
                My requirement is to calculate the subtotal of a particular page and to print that subtotal
                at the end of each page.And this subtotal has to be carry forwarded as the first item of the next page(say page2).
                And again  at the end of this page(page2) I have to print the subtotal and needs to carry forward this subtotal again on to
                the first item of the page3..
               My problem is I am doing it in a table.I am calculating the subtotal and displaying the subtotal at the footer of the table..
               In the footer again I am redefining table work area values with the text 'Subtotal' and subtotal Amount so that thinking
               that it would print as first line item on the next new page....
              But the problem is I am getting subtotal as 2'nd line item on each new page instead of first line item of each page.........
              Can anyone resolve this issue.........
              I dont want this subtotal to be printed on the last page since I am getting Total of all these subtotals.....
              Below is my required structure
    Page 1.
                    Desc                               Amount
                    x                                      100
                    y                                      200
                   Subtotal                            300
    Page2.(Required page2)
                 Desc                               Amount                                
                    a                                      100
                    b                                      200
                   Subtotal                            600
    Page2.(But getting as below,which I dont require )
                    Desc                               Amount
                     a                                     100
                   Subtotal                            300
                     b                                      200
                   Subtotal                            600
    Page3.(Required page3)( I dont require Subtotal here on the last page)
                 Desc                               Amount                                
                    a                                      100
                    b                                      200
                   Total                                 900
    Any suggestions pls
    This is in Smartform
    Thanks,
    Chinnu

  • How to limit the number of TCP connections beeing used concurrently while a page is beeing loaded?

    We manufacture industrial small-footprint control modules with embedded web server. The resources of these modules are very limited, especially in RAM. We have problem, that FF opens 15 parallel TCP connections while loading a web page (main html page first, then all icons simultaneously). We can not handle such behavior because of lack of RAM memory needed for TCP buffers.
    Question is how to limit the number of concurrent TCP connections the browser will use? We need to do it somehow directly from the page, we can not push our customers to change the general settings of their browsers (they would not understand such things anyway).
    Do anyone have any suggestion?

    Sorry, one other thought. Many web designers now combine all icons into a single image and use CSS to clip the image so that only the desired portion is displayed. This minimizes the number of required connections and increases the probability that the image can be retrieved from cache.
    More info:
    * [http://www.w3schools.com/css/css_image_sprites.asp CSS Image Sprites - W3Schools]
    * [http://www.alistapart.com/articles/sprites/ A List Apart: Articles: CSS Sprites: Image Slicing’s Kiss of Death]
    * [http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/ The Mystery Of CSS Sprites: Techniques, Tools And Tutorials | Smashing Coding]
    No idea whether this is practical for your application.

  • How to limit the number of pages a PDF can print?

    Hi,
    Does anyone know how to lime the number of pages a PDF can print? For example, if a PDF has 100 pages, it only allow the user to print no more than 100 pages.
    Any software can achieve this ?

    But once I purchased a ebook, which required be opened with Adobe digital edition, the ebook only allow to print 57 pages out of 300+ pages total. 
    Are there any way to convert a PDF to a ebook and encrypted by the printing limits?

  • Is there a way to limit the size of the page preview cache?

    Overall I think that the page preview function of Safari is really great. But I noticed today that Safari was becoming slow to close down, and I cleared the page previews with the "Reset Safari" function, and over 1 GB of cache was cleared up. I had no idea that that much disk space could be taken up by the page previews.
    Is there a way to limit the size of the Safari Page Preview cache to, say, 500MB?

    Sorry, you can't limit the size of that item; you can either delete it, or disable it completely (which will also disable Top Sites and Cover Flow for Safari).

  • How to adjust the size of the document body in Pages

    Hello all,
    I would like to find out how to change the size of the document body within Pages.
    I encountered this problem when selecting Business Resume from the templates section and after removing the left text box I could not move the main text body to the left, although document margins where set to 0.
    As you can see in the photo the section that says Profile can not be moved to left more than it already is.
    I would appreciate your help
    Thank you

    Several of the Pages 5.5.2 templates are buggy, you have found one of them.
    Create a template from scratch using the Blank tempalte.
    Peter

Maybe you are looking for

  • LOV not being applied to a column

    Problem: The first query runs quite fast as it is soft parsed, but the LOV values are not applied to the resulting values in the column CHECK_MARK. The second query is hard parsed (and slow due to that) but has its LOV value properly realized. The LO

  • Turn off compatibility mode for itunes

    How to turn off compatibility mode for itunes

  • MDB / threads allocation : doubt

              Hello Tom,           you wrote that :           "Remember that an MDB will use up to half+1 of the thread pool."           Sorry, but I've not understood.           Do you mean that, if I have one MDB, 12 available threads (considering 3 th

  • Problème d'import de vidéo dans Presenter 10

    Bonjour, J'utilise Presenter 10 avec Powerpoint 2007, Windows 7 Pro pack service 1, AME CS6 et Quicktime 7. Lorsque j'importe une vidéo, AME se lance mais il ne se passe rien et j'obtiens le message d'erreur "l'encodage du fichier a échoué". Par cont

  • Java Corba Help

    Hi, I'm using Java 1.5 to try out some Corba stuff with the idlj compiler, and am getting errors while testing. Can anyone show me what the problem is? The error is when i run the client code and the error is denoted where i put the comment //CRASH H