View previous topic :: View next topic
|
Author |
Message |
sjiraga
New User
Joined: 20 Apr 2009 Posts: 14 Location: Bangalore
|
|
|
|
In my current application we are using TSQ to store DB2 records and later that records are used for displaying on online screen and TSQ is used for paging purpose also.
Now Business analyst want do not want to display from the TSQ and they want to fetch directly from the DB2 talbe. But without that how to achieve paging logic. Please let me know any one without TSQ is there any method to achieve paging logic |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Your BA exhibits the characteristics of a PHB. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
actually, a controlled cursor is better than a tsq.
tsq requires extra resources,
and often the entire queue will not be used, so it is a waste to build the que in the first place,
also, delete logic at end of transaction, etc......
maintaining some kind of key, whether it be count or a value that can be used in a where clause,
means that only the data that is required for the screen displayed is retrieved.
and yes, it requires a little more that rookie knowledge to implement.
the BA maybe a PHB, but he knows what he is talking about. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
I tend to disagree. Using a TSQ the right way, i.e. not retrieving all data right at the start, but only when a page-forward operation is requested is far more efficient than constantly going off to DB2 to retrieve data that has already been fetched before.
As for the resources used by a TSQ, if it is used as above and properly deleted at the end of the transaction, the overhead will be pretty minimal.
The only time you might not be using a TSQ would be the case where the underlying DB2 table is extremely volatile, although in this case a simple "RESFRESH" command could easily be added to the application. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
DB2 to retrieve data that has already been fetched before. |
well, that will happen if you are a rookie. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
from the TAO of programming
Quote: |
A program should follow the `Law of Least Astonishment'. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least. |
accessing the database and paging thru temporary storage will follow the abovesaid rule
not so much paging thru database access
( think of backward paging if a <something> has been modified ) |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
with appropriate where clauses,
you can control your result set
so that it only returns what you need for the current screen.
then you do not have to deal with legecy tsq crap. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
GUY_C made a post today
ibmmainframes.com/viewtopic.php?p=266811#266811
that would provide basis as a solution
to satisfy even the most hairbrained attempt to 'prove'
that sometimes just gotta use a TSQ.
never had to do it with VSAM,
now DB2 is becoming sophisticated to the point,
you don't need TSQ's to save display data.
There are plenty of good reasons to use TSQ's,
screen paging in this day and age just ain't oneadem |
|
Back to top |
|
|
sjiraga
New User
Joined: 20 Apr 2009 Posts: 14 Location: Bangalore
|
|
|
|
Thanks afor everyone who shares their knowldge. Sorry I have not replied immediately my feedback. |
|
Back to top |
|
|
|