bb.donnay-software.com

Donnay Software Web Forums
It is currently Fri Aug 23, 2019 7:10 pm

All times are UTC - 7 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ISAM vs SQL CURSOR
PostPosted: Wed May 08, 2019 12:09 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 3958
Location: Boise, Idaho USA
Most of the beta testing, up to now, has been with Richard Covington's app.

His browses always start out as an SQL cursor (less common) rather than ISAM (most common).

When your DCBROWSE uses the SUBCLASS 'DC_XbpBrowseFiltered()' clause and your columns use the SUBCLASS 'DC_XbpColumnFiltered()' clause and you use the SQLSORT clause on the column, then you will get different behavior if your workarea is a SQL cursor rather than just an ISAM workarea.

When left-clicking on the SORT button in the header of a column, you expect the browse to sort by that column.

If the work area is a SQL CURSOR then that is done by modifying the SQL statement and adding the ORDER BY clause to the end of the statement and re-executing the statement in the current work area.

If the work area is a standard ISAM, then it is expected that it will work as it always has in the past and your SORT clause will determine the sort method, most commonly OrdSetFocus().

Everything changes, however, when a user right-clicks a heading and chooses a filter for a column. This action replaces the current workarea with a SQL CURSOR in order to use the SQL WHERE clause to filter the data set. Whenever any column is filtered, there are no more indexes available because the work area is now a SQL CURSOR. This means that clicking on a column that has a SORT by an index tag will fail and the column will not be sorted. The workaround for this scenario is the following:

Here is an example of Bobby Drakos code where I made it work both ways:

Code:
 
 DCBROWSECOL HEADER "Driver's Last Name" ;
      DATA {|| DRV->last } ;
      PARENT oBrowse WIDTH 13 ;
      TOOLTIP "Last Name Of The Driver;Right Click To Set Last Name Order" ;
      DATATOOLTIP {||.T.} TIPBLOCK {|| _toolTipAddr() } ;
      SORT _colSort('DRVLAST', GetList) ;
      SUBCLASS 'DC_XbpColumnFiltered()' ;
      SQLFIELD 'LAST'


  The static function _ColSort() was changed as follows:

  WAS:

  STATIC FUNCTION _colSort(cTag, GetList)

  RETURN  {||DRV->(OrdSetFocus(cTag)), ;
                 DC_GetRefresh(GetList,'SAYSEEK' ), ;
                 PostAppEvent( xbeP_Keyboard, xbeK_CTRL_S, nil, )}

  IS:

  STATIC FUNCTION _colSort(cTag, GetList)

  RETURN  {|o,n|DRV->(OrdSetFocus(cTag)), ;
                IIF(DRV->(OrdSetFocus())==cTag,nil,o:orderBy(n)), ;
                DC_GetRefresh(GetList,'SAYSEEK' ), ;
                 PostAppEvent( xbeP_Keyboard, xbeK_CTRL_S, nil, )}

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group