Re: FWD/BACK/GOTO ? / ESQL
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Clustering, Grid & MACH11
In article <CJt1un.94p@unix.portal.com> pkellner@shell.portal.com writes:
[stuff deleted]
>1. The Questions: I am converting a non-SQL ap to informix and
>have always thought that a critical "basic" function of a database
>is to allow a dialog type box that has the three buttons:
>Forward, Backwards and Goto. Of course this should work on a
>huge database. If I declare a scrolling cursor it is obvious
>how to do the forward and back but I'm confused on how to implement
>goto. That is if I do a select *, then fetches, I can't dive
>into the middle of a database, then take a step backward.
If the data is fairly static or updated in batch you could try
the following (the syntax is not meant to be right):
1 create a clustered index to define the physical
sequence of records (say by surname, firstname) after
the data has been updated.
2 After a GOTO function such as
select rowid, * into s_rowid, t.*
from tab where .... matching condition
3 Backwards/Forwards is implemented as:
select rowid, * into s_rowid, t.*
from tab where @rowid = s_rowid - 1 (or + 1)
This of course only allows you to have one definition of forwards and
backwards for a physical schema but should be pretty fast.
If your data is volatile and forward/back must always give the right
results then I would also, reluctantly, suggest the Informix solution.
I think I've answered question 2 already
--
Charlie
-------------------------------------------------------------------------------
Charlie Hussey Edina Software Limited Email: charlie@edina.demon.co.uk
4 James Street Fax: +44 (0) 31 669 9092
Edinburgh EH15 2DS
Scotland, UK
-------------------------------------------------------------------------------