Hi guys
I wonder if is it possible set the table pointer into an specific record provided by a SQL ADS query
My problem is the following:
I have a SQL query with too many results. Then, I think in giving the users the abiliity of searching through this result set and positioning over the
selected record.
With no SQL queries, this job was simple, only changing the index with ordsetfocus and executing a dbseek. But with an alias which is a result of a query i don´t know the way for do it...
Executing sql queries, are generated some default indexes ??
Thank In advance
SQL queries. Positioning over a specific record
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Thanks Reinaldo for your interest...
Yes, I´m using this results as an alias..
But... how can I execute any search in that alias (cursor)...ie: the alias has 3 fields: name, tel, id, and I want to permit the users search over any of these fields...If the user chooses id and searches "1059", the cursor must go to that record, a lo DBSEEK.
Can you understand my problem...
Yes, I´m using this results as an alias..
But... how can I execute any search in that alias (cursor)...ie: the alias has 3 fields: name, tel, id, and I want to permit the users search over any of these fields...If the user chooses id and searches "1059", the cursor must go to that record, a lo DBSEEK.
Can you understand my problem...
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
I think I understand.
You can create an index, or even a temp index and then:
(cCursor)->( dbseek( ) ).... As you would on a real table.
With ADS server creating an index should happen very fast.
That should work.
Another option is to load the data into an array (dbeval()) and then allow the user to sort the data by clicking on the column's header (aSort()). Then allow them to increment search using aScan().
The SQL statement could be ORDER BY... so a quick search is possible using a binary search on sorted data.
Hope this helps.
Reinaldo.
You can create an index, or even a temp index and then:
(cCursor)->( dbseek( ) ).... As you would on a real table.
With ADS server creating an index should happen very fast.
That should work.
Another option is to load the data into an array (dbeval()) and then allow the user to sort the data by clicking on the column's header (aSort()). Then allow them to increment search using aScan().
The SQL statement could be ORDER BY... so a quick search is possible using a binary search on sorted data.
Hope this helps.
Reinaldo.