Getting only a few records at a time.

Using a Select * from. Is there an option where I get only so many records. This is for a console application. I wanted some thing where it will display only 3 records at a time. And then I have the option of viewing the next 3 and then the next 3 records
and so on.
Any one have any ideas.
Merry Christmas EVERY ONE and thanks to all the members on msdn forums for helping me with my code.
Joe Moody
http://www.starfiresoft.com
Pro-Forums
Delta Force Barracks
On the Frontlines

Thanks. It doesn't matter as long as I can get it to work. The idea is to display 3 records at a time. Then the user should be able to go backward or forward in the list. Let me show you what I have. This will give you some idea on how I have it displaying
the info.
SqlCeCommand cm = new SqlCeCommand("SELECT * FROM users", cn);
//cm.Parameters.AddWithValue("@tooid", num);
//cm.Parameters.AddWithValue("@fromid", Id);
SqlCeDataReader rd = cm.ExecuteReader();
try
while (rd.Read())
Door.CursorRight(10);
Door.WriteLn("|0C___________________________________________________");
Door.CursorRight(10);
Door.WriteLn("|0FId |04: |03" + rd["Id"].ToString() + " |0FName |04: |03" + rd["username"].ToString());
Door.CursorRight(10);
Door.WriteLn("|0FStatus |04: |03" + rd["status"] + " |0FDate Jointed |04: |03" + rd["joindate"]);
Door.CursorRight(10);
Door.WriteLn("|0C___________________________________________________");
catch (Exception e)
throw new Exception(e.Message);
cn.Close();
This is inside of a do loop. and at the bottom I have it waiting for user input. or the user can quit and return to the main menu.
Door.WriteLn();
Door.Write("|07Page |0F<|04||0F> |0FQ|09)|0BQuit |07Choice |04: |0C");
cc = Char.ToUpper(Door.ReadKey());
Above is my prompt. This waits for user input. and I use a switch to tell the software what to do. Any way if you want to know what Door.writeLn() is, Think of it like this "Console.Writeline()". This is just a library I use for the kind of programming I
do.Any help would be great. Thanks and have a safe Xmas.
Joe.
http://www.df-barracks.com Delta Force Barracks
http://www.starfiresoft.com Starfire Software

Similar Messages

  • BAPI execution in webdynpro returns only a few records

    Hi,
            I'm executing a BAPI in my webdynpro application and it is returning only a few records from backend table. When i execute the BAPI in R/3 with the same input i'm getting all the records. In webdynpro i'm getting only 22 records for different set of inputs while in R/3 i'm getting all records(37,41 etc). Any help in this regard will be valuable.
    Regards,
    Shabeer

    Hi,
         I am invalidating the output node after execution of BAPI. The BAPI is executing properly and it is returning records also.But the problem is with the number of records returned by BAPI. As i've mentioned earlier it is always returning 22 records, eventhough the actual output contains more than 22 records(I checked this in R/3). I was told that the BAPI is calling a transaction(i don't know whether it is the problem since i am not familiar with ABAP and R/3 that much).Is it possible that webdynpro is fetching records even before the BAPI execution is complete in R/3 and hence returning partial output(I'm not sure about this thing) ?
    Any help in this regard will be valuable.
    Thanks and regards,
    Shabeer

  • XML import only creates one record at a time

    Hi All,
    I have an XML import map that automatically imports data into main product table. It's working fine when the XML file has only one main record. When it has more than one record, the import manager and import server can only import the last record in the file and skip the rest.
    I already checked the record matching tab. It correctly shows that all records will be created and 0 will be skipped. Even the log file indicates all records are created after I execute the map. Yet, when I try to look for them in the data manager, I can only find the last one. If I execute the map with the exact same file again, it will create one more record again and skip the rest.
    Someone else posted the same question a while back: Import map issue one record at a time. But it was never answered. Does anyone else have this issue? Is this a MDM bug?
    Thanks,
    Kenny

    Hi Kenny,
    Please refer to the note below:
    Note 1575981
    Regards,
    Neethu Joy

  • Show only a few results at a time on Tree

    Hey,
    I've got my tree and set it to only show 15 results at a time, but I want a button to go to the next 15.
    I have a feeling that it's a really simple action but I can't figure it out.
    How do I do it?
    Thanks

    Actually I have one tiny issue now.
    When I expand a node in the tree and click nextSet, that node stays expanded (but it isn't the same value, so it shouldn't be).
    From looking at the documentation it seems that I need to use a TreeState class and an action to open or close the nodes.
    My problem though is that I already have the nextSet and previousSet actions tied to the buttons, so is there a way I can have two actions so it collapses all nodes AND goes to the next set?
    Thanks again for all your help.

  • Can only copy few files at a time from DVD

    I received two DVDs from our wedding photographer and when trying to copy a DVD with about 400 images to my Mac it always fails somewhere in the process, with the drive making a disconcerting scratching noise just before it stops. Once it fails the only option is to force quit Finder and then force restart. Tried copying all the files at once from the second DVD and same result.
    I have been able to copy small batches files, a few at a time, and am up to about 100 of the 400 on disk one but it has taken hours. Sometimes it fails on a batch of 10, sometimes not, and I can always eventually copy the files in the failed batch do I don't think the files are corrupt on the DVD, nor do there appear to be any scratches. Each time it fails my only recourse is to force restart and try the batch again. At this rate it could take 20 hours to copy images from both DVDs.
    Any idea how to fix this? Here is info on my drive:
    MATSHITA DVD-R UJ-867:
    Firmware Revision: HA13
    Interconnect: ATAPI
    Burn Support: Yes (Apple Shipping Drive)
    Cache: 2048 KB
    Reads DVD: Yes
    CD-Write: -R, -RW
    DVD-Write: -R, -R DL, -RW, +R, +R DL, +RW
    Write Strategies: CD-TAO, CD-SAO, DVD-DAO
    Media: To show the available burn speeds, insert a disc and choose View > Refresh

    Thank you for the replies. After using both my laptop and another laptop to copy the files we finally got them all copied. Both laptops exhibited similar behavior on both DVDs so it probably is the type of DVDr (. The scratching was not the laser motor seeking to read the disk, rather it was relative to the spinning speed of the dvd, as if it were warped or had a piece sticking off of it, and it scratched more the faster the DVD spun, but the DVD looked to be fine. I have since tried other DVDs and they work fine so still not sure what the problem was but the files are on my HD now so that problem is solved.
    -Lewis

  • Getting only the newest records in a Grandchild table

    Hi
    I have created a new table in the Siebel schema on an Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    This table is called CX_ASSET_XM and is a Grandchild table of S_ASSET
    CX_ASSET_XM has a parent table S_ASSET_X
    So the structure is like so
    S_ASSET  x 1 record
    S_ASSET_X x 2 child records
    CX_ASSET_XM x 1 grand child records
    Therefore the cardinality is one Grandparent can have 2 Grandchild records
    This CX_ASSET_XM table will hold information about TCP/IP calls of a Grandchild asset. These calls are not synchronized. therefore one Grandchild asset may make a call today but the other one has not made a call since yesterday.
    In my query I find all the grand children records that have been created today (sysdate) and then traverse up the relationship to find the Grandparent, then I traverse back down to find the other twin in the Grandchildren tuple.
    The problem with my query is that it returns every single TCP/IP call a pair has made but I only want the most recent callback of each grandchild to analyse
    SELECT (cb.SSID), cb.created_by, cb.callback_date, cb.callback_num, asset.desc_text, asset.prom_integ_id, asset.integration_id
    --Traversing Up to find the Grandparent record of the
    FROM SIEBEL.CX_ASSET_XM cb
        JOIN SIEBEL.S_ASSET_X assetx
          ON cb.SSID = assetx.attrib_37
        JOIN SIEBEL.S_ASSET asset
          ON assetx.par_row_id = asset.row_id
    WHERE asset.prom_integ_id IN
    --Traversing Down to find the other twin in the pair
    (   SELECT asset.prom_integ_id
        FROM SIEBEL.CX_ASSET_XM cb
        JOIN SIEBEL.S_ASSET_X assetx
          ON cb.ssid = assetx.attrib_37
        JOIN SIEBEL.S_ASSET asset
          ON assetx.par_row_id = asset.row_id
    ORDER BY cb.callback_date DESC;
    e.g. if there are 80 grandchildren which have made two TCP/IP calls that would make a total of 160 records, which is what the query above returns.
    However I want 80 records to be returned
    e
    Grandchildren
    Callback Date
    1111AAAA (Pair 1)
    10-OCT-13
    1111AAAB (Pair 1)
    09-OCT-13
    2222AAAA (Pair 2)
    10-OCT-13
    2222AAAB (Pair 2)
    07-OCT-13
    As you can see from the table, atleast one of the pair will have a Callback_Date = Sysdate (Today) which is how I will need to find them in the table before traversing up.
    How do I achieve these results. I have tried GROUP BY, DISTINCT, ROWNUM = 1

    Hi,
    968432 wrote:
    Sorry for my ignorance but how do I incorporate the ROW_NUM function into my query, or will it be a new query from scratch.
    When you say partition, does that mean the partition would be between my traversal up the tables to the grand parent and then back down again?
    You can use ROW_NUMBER with something very much like your existing query; there's no need to start from scratch; you just won't repeat the joins in the WHERE clause.  You'll just be joining the tables once.  If it really helps you to think of traversing either up or down, then go ahead, but you mind find it simpler just to think of joining.  Every row of the join will include some expression(s) that uniquely identifies the grandparent; that's what you'll PARTITION BY.
    It would be a lot easier to explain and to understand if we had some sample data and desired results.  Either post CREATE TABLE and INSERT statements for a little sample data, or phrase the question in terms of tables that anybody with Oracle probably has, such as those in the hr schema.  (People in hr.employees are related to deparatments in hr_departments, and departments are related to places in hr.locations, so location is the grandparent of employee.  If you knew how to find the most recently hired employee from each location in the hr schema, then you'd know how to solve your problem in your schema.  For example, if you wanted these results:
    CITY                 DEPARTMENT_ID EMPLOYEE_ID LAST_NAME  HIRE_DATE
    London                          40         203 Mavris     07-Jun-2002
    Munich                          70         204 Baer       07-Jun-2002
    Oxford                          80         167 Banda      21-Apr-2008
    Seattle                        100         113 Popp       07-Dec-2007
    South San Francisco             50         128 Markle     08-Mar-2008
    Southlake                       60         104 Ernst      21-May-2007
    Toronto                         20         202 Fay        17-Aug-2005
    you could get them like this:
    WITH  got_r_num  AS
        SELECT  l.city
        ,       d.department_id
        ,       e.employee_id, e.last_name, e.hire_date
        ,       ROW_NUMBER () OVER ( PARTITION BY  l.city
                                     ORDER BY      e.hire_date  DESC
                                   )   AS r_num
        FROM    hr.employees    e
        JOIN    hr.departments  d  ON   d.department_id  = e.department_id
        JOIN    hr.locations    l  ON   l.location_id    = d.location_id
    SELECT  city
    ,       department_id
    ,       employee_id, last_name, hire_date
    FROM    got_r_num
    WHERE   r_num = 1

  • How to get only the latest record in a folder

    Hi all,
    We have an OA SIT that is not a "standard" SIT in that it does not have the traditional Begin and End date. It only has an Effective date. Is there some way I can filter this table to only give me the latest record in the series? I know how to do this in SQL, but don't see how it would be possible in the EUL.
    We're trying to avoid creating database views, but at this point, I'm thinking it may be the easiest way to address this. Any other suggestions?
    Thanks in advance,
    Jewell

    Jewell.
    Of course I'm not going to mention that I have no idea what a 'standard' SIT is compared to your basic 'non-standard' SIT ... and I have to watch my spelling of such ... but however ...
    As you're most likely aware, in SQL you would get all the 'standard' SIT records first by going through the table. Then you'd go back through them all and find the most recent one.
    Because of this 2 table pass, I agree that just putting the SQL code in a custom folder (as you're not using views) would make the most sense.
    Russ

  • Showing only a few records in a region

    Hi Guys,
    I am creating a shopping page using OA F/w.
    In this page i have created a search screen and there is a shopping cart at the upper right corner.
    Now my requirement is to show shopping cart like this
    Shopping Cart
    Number of items: x
    item1 qty1
    item2 qty2
    item3 qty3
    item4 qty4
    item5 qty5
    more...
    what i have achieved so far is
    i have created a content container.
    I have got the items and quantities (using child attribute feature in a stach layout region)
    now my requirement is
    1. to show number of items
    2. to show only 5 records (not using table region)
    3. to show more link which will take to complete shopping cart.
    can u please help me out with this
    Thanks
    Husain

    instead of creating so many VOs, try something like this
    1. From CO call a method in AM, something like public Vector getAllItems()
    2. In that method in the AM, have a VO bring the items in the cart (VO.executeQuery())
    3. Loop your VO and form a Vector of the items and return this vector to the CO.
    4. In CO, when the method has returned , you have a Vector of all items.
    5. size() method will give you the number of items
    6. loop the vector, and paste the data in a bean in your content container
    7. if loop becomed > 5 (means 6th row - i.e 5 items are already painted), then break; the loop and paint a more.. link instead of the item from the vector.
    8. Clicking on the more link takes you to another page, navigate there and retain the AM while you go, so your VO also is present, you dont need to query again.
    Thanks
    Tapash

  • I tried to import favourites from ie9 but only a few appeared.tried several times but the same result

    it only imports a few fovourites not all

    This earlier post may help.
    https://discussions.apple.com/message/10859194#10859194
    For me,  (long winded way) I drag the playlist from the bottom tree to the iPod branch.
    Then select iPod.
    Click the music tab on the right window.
    click sync tick music
    go down to the playlist section and tick the playlist.
    Apply.
    Good Luck.

  • Lock only a few records in a VIEW_MAINTENANCE_CALL.

    Hello,
    I want to update one View using the FM: VIEW_MAINTENANCE_CALL, restricting the value of one field.
    Using the the FM with the restricting field it’s easy, no problem. The problem is controlling the lock of those records, I just want to lock those records, not lock all records table view to the other users.
    Any help to this issue...
    Regards,
    Duarte
    Duarte

    Hi,
    You can not lock single record.
    Regards,
    Satish

  • Master - some records : Detail - for only a few i(not all)records in master

    Hi
    I have a requirement like master and detail. However I do not wish to see the details of everything that is there in the master but only a few records (based on some criteria). Example:
    Id Desc Col3 Col4
    1 1 desc 1col3 1col4
    2 2 desc 2col3 2col4
    3 3 desc 3col3 3col4
    id col5 col6 col7
    3 abc def ghi
    4 4 desc 4col3 4col4
    How can I have such a layout in which detail shows details of only selected records present in the master?
    Any help appreciated big time.
    Thx!

    1. create two queries. master and detail and link on the fields of interest.
    2. on the layout, have repeating frames. one for the master and inside the master frame, a repeating frame for the detail.
    hope this is what you are looking for..

  • How to get only active records from MDM.

    Hi all,
      How can i get only the active records from MDM table.Now i am getting all the records in MDM table in my Master Report Iview.Only some of the records r active.can i get just the active records.If yes,how can i do that.
    regards
    kukku

    closing

  • How to only update existing records when loading master data ?

    Hello experts, I need your lights one more time.
    Here is my need :
    I have created an infoobject (IO) which is a very simple version of 0material, let's call it Znewmat --> Znewmat has material type and trademark as attributes, those two fields are available in 2 different datasources :
    - 0MATERIAL_ATTR for material type (field MTART)
    - 0MAT_SALES_ATTR for trademark (field MVGR2)
    When loading my new IO from 0MATERIAL_ATTR I use a filter (at DTP level) to get only a few material types (I get something like 1000 records),
    here is my issue : when I load from 0MAT_SALES_ATTR the field "material type" is not available to keep the same filter as for 0MATERIAL_ATTR and existing records are updated with the trademark, but I also get 5000 records I don't need, and my master data is "polluated" with useless lines.
    *and my question : is there a way while performing the second loading to ONLY UPDATE EXISTING RECORDS AND NOT ADD ANY
    NEW RECORDS ? (i didn't find anything in main options of my DTP)*
    (I'd like to avoid the solution to update the 0MAT_SALES_ATTR datasource to add the missing field)
    Thanks in advance for any help, points will be distributed.
    Guillaume P.
    Still no idea ?

    in the start routine of transformation from 0MAT_SALES_ATTR to znewmat do the following:
    select materials from /BIC/PZNEWMAT into i_mat
    for all entries in source_package where material eq source_package-material.
    loop at source_package.
    p_ind = sy-tabix.
    read table i_mat with key material = source_package-material.
    if sy-subrc ne 0.
    delete i_mat index p_ind.
    endif.
    this way you'll only update records that have previously been loaded by 0MATERIAL_ATTR DS
    loading sequence:
    first load ZNEWMAT from 0MATERIAL_ATTR. then activate ZNEWMAT. then load 0MAT_SALES_ATTR to ZNEWMAT.
    M.

  • Fetching 10 records at a time

    Product.Category dimension has 4 child nodes Accessories,Bikes,Clothing n Components.My problem is when I have thousands of first level nodes my application takes a lot of time to load. Is there a way to fetch only say 100 records at a time? So then when
    i click a next button i get the next 100
    Eg:On the 1st click of a button I fetch 2 members
    WITH MEMBER [Measures].[ChildrenCount] AS
    [Product].[Category].CurrentMember.Children.Count
    SELECT [Measures].[ChildrenCount] ON 1
    ,TopCount([Product].[Category].Members, 2) on 0
    FROM [Adventure Works]
    This fetches only Accessories. Is there a way the fetch the next two records Bikes n Clothing on  click.
    Then Components on the next click. So on an so forth.

    Hi Tsunade,
    According to your description, there are thousands of members on your cube. It will take long time to retrieve all the member at a time, in order to improve the performance, you are looking for a function to fetch 10 records at a time, right? Based on my
    research, there is no such a functionally to work around this requirement currently.
    If you have any concern about this behavior, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback and hope it is resolved in the next release of service pack or product. Your feedback enables Microsoft to make software and services the best that they can be, Microsoft might consider to add this feature
    in the following release after official confirmation.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How can I get the last / newest record of a table?

    Hi,
    I am developing an ecard app that has a create greeting page, a preview page with edit and send buttons and an edit page.
    I got he insert working, and on the preview page I created a master record page (displays all records), and delete all unecessary designs. Doing it this way also gives me the 'edit' button, so people are able to edit their page.
    How do I get only the last record displayed though? At the moment it loops through all records and displays them in sets of 10. I found the variable that holds the totla count of records ('$totalRows_rs7417_content1'), but how do I (re-)write the script so it ONLY diplays the last record?
    I need to get the ID of this record as I am writing this into the PARAMs of the object and embed tags of my message .swf (this picks up the ID and based on that sucks the greetings text out of the database via another php script.
    Also, from this page, how can I send an email to the sender (ie creator of the message) as well as the recipient? Both email addresses are in the databse so should be part of the erecord returned.
    Thanks,
    Nik

    -----
    OK, So how do I recreate what I got in a non-ADDT list?
    well, when you´re just about to display one certain record, the term "list" is somewhat inappropriate anyway.
    What you´d simply need to do IMHO, is using DW´s native functions to create the basic "SELECT * FROM table_name ORDEr BY ID DESC" query, add "LIMIT 1" manually, and display the desired "dynamic text" placeholders in 1 table cell -- don´t think there were any need for all the fancy stuff
    (sorting, filtering etc) provided by ADDT´s list, as it´s just 1 record.
    It also occurred to me just now that finding the last record that has been added *may-* notbe enough if the site gets used a lot by our executives (I am thinking of a situation where 2 or three peolpe create greetings at the same time and press submit and then getting each others messges rather than their own).
    in this case you might want to additionally store the respective executive´s "kt_login_id" session variable -- because it´s this unique "identifier" which should be used to show the last inserted record of the person who actually inserted it, means adding a "WHERE submitter_id" equals the session variable kt_login_id - clause to the query.
    When creating a non-ADDT list that´s at some point based on detecting a user session, you´ll BTW need to insert at line 1
    I can't seemt o insert it on the page as it is looking for a insert, update or delete bahaviour on the page which of course I don't have
    please search these forums for several posts I made which explain my "use dummy table" approach that´s made for cases when you actually don´t have anything to insert/update/delete, but need "something" for ADDT´s send email behaviours.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

Maybe you are looking for