Chris:

For instance, we have checks file. A number of our clients have over a million records in the file. It's indexed on vendor no. and check date. The index would look like:

00CAPGE15857  (7 digit vendor and 5 digit date)

This is a left justified so it's easy to sort and select. I can select any item in the file for any vendor and even limit it to any date...

SELECT VENDCHECKS WITH INDEX_1 = "00CAPGE]"
SELECT VENDCHECKS WITH INDEX_1 > "00CAPGE15786"

Within a second or less you'll get your data since an index is being selected. If you want to "traverse" the index, you'll need to do it within BASIC. In D3 they had the KEY() function, In UniData they have the SETINDEX, READFWD, and READBCK, commands (with a few other derivatives). But these allow you to set an index to start with (let's say in wanted to start accessing checks with vend# "CAPGE" and with checkdate of 21 Mar 2011). From here you can read forward or backward for {n} number of records. When you have the number you want you need to return to the calling program with this data including the top and bottom values. You'll display what you want then if you go to the next page you can READFWD from the bottom of the page. To go backward you'll READBCK from the top of the page.

For UniVerse, you'll have to do a bit of a dance, although, compared to D3 you have to do a bit of a dance in UniData. But I know UniData works well and assume it's also true with UniVerse, although UV doesn't store in a B-Tree, so the first item read may have a large number of items in the list.

HTH,

Bill

------------------------------------------------------------------------
----- Original Message -----
*From:* cjausti...@hotmail.com
*To:* u2-users@listserver.u2ug.org
*Date:* 7/20/2011 11:20 AM
*Subject:* Re: [U2] SELECT question, paginated select.
Bill,

I was curious if you had a quick example? I'm just curious how you guys are 
suggesting to do this

Chris

Date: Wed, 20 Jul 2011 11:13:04 -0700
From: wphask...@advantos.net
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] SELECT question, paginated select.

Chris:

I'm betting the solution also needs indexing, because you want to pick
up where the last list left off and you don't want to wait for a select
to return to save the list.  So, SAMPLE isn't really a solution but
indexing is.  We do this all the time, but we have to use indexing.  In
fact, we parse through a file with millions of records to get a page
full of stuff and the pop-up list is instantaneous.

Secondly, I'm not sure a dropdown list is the appropriate choice for a
thousand items.

HTH,

Bill

------------------------------------------------------------------------
----- Original Message -----
*From:* cjausti...@hotmail.com
*To:* u2-users@listserver.u2ug.org
*Date:* 7/20/2011 10:14 AM
*Subject:* [U2] SELECT question, paginated select.
I'm working on a screen in our webapp where we're using a dojo widjet to create 
a drop down with client names. The problem
is that we have 1,000's of clients and when we do a SELECT on this many clients 
it takes a while. I know we can index the field but
I was wondering if you can do smart selecting in UniVerse.

For example if I wanted to use this query:

SELECT CLIENT WITH @ID = "A]" SAMPLE 10   (returns 10 clients starting with the 
letter A).

I want to paginate my drop down so the first query has the above data. The 
problem I'm facing is that I don't know how to
get the NEXT 10 clients? Is there  a way to do this?

For example if I wanted to return the next 10 CLIENTS, without including any of 
the first 10.

Chris

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
                                        
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to