View previous topic :: View next topic |
Author |
Message |
rameshb Beginner
Joined: 12 May 2006 Posts: 10 Topics: 6 Location: india
|
Posted: Wed Feb 18, 2009 1:58 pm Post subject: need help in forward & backward scroll cursor |
|
|
hi
i am using the following cursor for displaying the values in my online screen for the first time
SELECT A,B,C FROM XYZ
ORDER BY A,B
any one can help me how to write forward and backward scrolling cursor for this
thanks,
ram |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
rameshb Beginner
Joined: 12 May 2006 Posts: 10 Topics: 6 Location: india
|
Posted: Wed Feb 18, 2009 10:18 pm Post subject: |
|
|
hi kolusu,
i mean i need sql query
select from a,b,c from xyz
where (x = :tempx and y>:tempy) or (x>:tempx)
whether this query will work to fetch next set of records in forwaard cursor
thanks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Feb 19, 2009 11:44 am Post subject: |
|
|
rameshb,
Code: |
Select A
,B
,C
from table
where A >= :host-variable-a
and B >= :host-variable-b
ORDER BY A,B
|
Beginning of the program you would and open the cursor
Code: |
Move low-values TO host-variable-a
host-variable-b
|
in case of page down or forward and open the cursor
Code: |
Move last-screen-value of A TO host-variable-a
Move last-screen-value of B TO host-variable-b
|
in case of page up or backward and open the cursor
Code: |
Move first-screen-value of A TO host-variable-a
Move first-screen-value of B TO host-variable-b
|
Kolusu |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Feb 24, 2009 12:07 pm Post subject: |
|
|
Isn't this the right situation to use scrollable cursor? |
|
Back to top |
|
 |
srini_igsi Beginner

Joined: 12 May 2006 Posts: 41 Topics: 16 Location: Mumbai
|
Posted: Fri Mar 20, 2009 7:54 am Post subject: |
|
|
Hi Kolusu,
Is there a way to implement the similar logic with a DATE field in the where caluse but with duplicate values.
I believe we must have at lease one unique field on the screen/DB to control the paging otherwise we can't implement this logic using the SQL queries. The other way around is TSQ.
Please correct me if I'm wrong. _________________ Thanks,
-Srini |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Fri Mar 27, 2009 1:38 pm Post subject: |
|
|
Looks like with scrollable cursor you don't have the issue. |
|
Back to top |
|
 |
|
|