Comentários (6)

1 arzvi comentou às Link permanente

Great article about the new features. Thank you for contributing for the db2 community, as always. I have one request, can you please brighten up the code in your posts? its very light and hard on eyes, especially when viewed in lower lights as I work for long hours in front of the computer.

2 SergeRielau comentou às Link permanente


Thanks, and I agree on the colors. These are the default colors unfortunately. I will discuss with the webmaster what I can do about them.

3 bdh002 comentou às Link permanente

I'm certainly very glad to see the feature in db2.

Thanks to all contributors!
Bernard D.

4 SergeRielau comentou às Link permanente


Glad we could finally fulfill your request.

5 RuiCosta comentou às Link permanente

I loved reading this article, certainly took me a step forward but I have an even more complex situation.
I have a grid, in an ASP.NET web application, to be filled with 20 rows from a table with more then 9 000 000 records.
I can't make a full read to the table (9 000 000 records) and paginate in the .NET side, it's too heavy and this application is used in a slow network.
But the problem is bigger when we consider that the user can choose the order of the results. By pressing mouse button on any grid column he defines the order to the results and obviously the paging must be built based on the order.
I already have a solution, a stored procedure containing dynamic SQL receiving the order, first record to fetch and number of records to fetch as parameters but it's pretty ugly.
I'm using ROW_NUMBER() OVER( ORDER BY ...) to order the results and create the numbered rows and then I use the WHERE clause with the row number to determine the first record to fetch and FETCH FIRST 'n' ROWS where 'n' is the parameter with the number of rows I want.
I'm talking about a DB2 database, on iSeries, built with CA 2E Advantage (also known as Synon), not built with DB2. So I don't have indexes or views.
Do you know any example like this? I would like to improve my solution to make it more simple and faster.
It is very fast, considering the other options but could it be better?

6 SergeRielau comentou às Link permanente


I think what you have been doing is a pretty good choice. Nothing better comes to mind (at 6:30am at least).
Thanks for reading our BLOG