The CHT Blogger

Thanks for your interest in The Clarion Handy Tools, an awesome collection of productivity enhancements for Clarion developers. These tools consist of an ever-expanding set of Clarion Templates and OOP Classes that extend or complement the normal functionality of the Clarion Application Development System from SoftVelocity.

Wednesday, July 2, 2008

About Optimize For SQL Option

Just a reminder that those of you with SQL apps, should be taking a look at the JULY 1, 2008 what's new page: What's New July 2008 to read about the new option switch called "Optimize For SQL" found on the "Use SQL" dialog of ExplorerBrowse and HandyMarkerBrowse (soon als implemented on LocatorOverrideControl).

For a while now, I'd been noticing that under certain conditions C6 SQL apps produced more than one SELECT statement per browse query or per browse order change. In theory to change browse order to descending from ascending, one would issue the identical select statement with a DESC following the fields in the ORDER BY clause.

What I was seeing, in reality, was this:
• When the browse queue was empty, the browse produced generally one or two select statements per new query, one select statement to issue the select that filled the browse and one select to reget the currently selected record into the record buffer (to honour the new selection event).

• When the browse queue had records already in it, the browse produced generally 3 or 4 select statements per new query. One select statement to fill the browse forwards from the currently selected record; One select statement to fill the browse backward from the currently selected record; One select statement to fetch the currently selected record into the record buffer. And sometimes a fourth select was issued if the fill-forward or fill-backward phases, bumped into the end of file or beginning of file condition. This wonky behaviour is supposed to be controlled by setting the RetainRow driver flag off in the ABC classes. Even SV's documentation recommends that retain row be turned off for SQL, yet the current crop of C6's behave as if retain row is on even when it's off. That behaviour is hard coded into the ABC BrowseClass INIT method.

In earlier iterations of Clarion, I'd spent quite a lot of time getting Clarion ABC browses to "cut the chatter" to the point that a single select per browse query or per browse order change was issued. I don't know when C6 ABC classes and templates changed to wrestle away the well controlled ABC-browse situation we'd had till that point, but they did, somewhere along the way.

The "Optimize For SQL" switch on our browse templates, lets you optimize your browse so that only a single select is issued for any new browse condition such as a query change or an order change. I suggest you compare this yourself on your own SQL apps, using HNDSQLTRACE.APP to trace various browses with and without the "Optimize For SQL" switch turned on.

Cheers...
Gus Creces
The Clarion Handy Tools Page
Visit Website

About HNDSQLTRACE.APP 2.01

Earlier today I uploaded HNDSQLTRACE Version 2.01. This has the following new features:

• The ability to have a File Based Trace (will trace any C6 Clarion SQL App).

• The ability to have Direct-From-App Trace (requires other CHT template applied to traget procedure). There's a menu item to set to one or the other of the above two settings.

• The buttons have been removed from the tool bar and have been replaced with menus. Three of the key menu items have now been given System Hot Keys. F9 (Clear) F10 (Read Next) F11 (Minimize/UnMinimize). The advantage of these system hot keys is that the trace app does not have to have focus for you to apply these commands to it.

• There's an entry control now on the tool bar that when doing a file trace, any table name entered in here is filtered out of the trace, so that if you have SQL stuff appearing in the trace, say from something like INIFile, you can have the trace extract them by entering INIFile in the field provided.

At the moment, the Direct-From-APP trace is transmitted only when you apply HandyQueryTracingButton_EXPB (for ExplorerBrowse) or HandyQueryTracingButton_HNDMB (for HandyMarkerBrowse) on your browse. You can see how I've applied these, and test the Direct-From-App tracing feature on demo apps HNDSQL7.APP and HNDSQL8.APP.

In the next iteration, perhaps as early as the beginning of next week, I'm going to add a dialog on our browse templates that let's you opt to have the browse intercept trace on/off commands directly from HNDSQLTRACE. A hot key in the trace app will send a command to the Browse Procedure to have it turn on it's tracing communications and to start talking to HNDSQL trace.

Cheers...

Gus Creces
The Clarion Handy Tools Page
Visit Website

Tuesday, July 1, 2008

CHT Changes Posted To WEBUPDATER July 1, 2008

We've posted another update on the road to Build 12C1.00 at the end of July, 2008.

This adds another new locator: HandyMarkerBrowseLocatorControlEx which has the same features for HandyMarkerBrowse that we introduced last time for ExplorerBrowse. There are also two new demo applications that apply these locators. They are HNDSQL7.APP - illustrating ExplorerBrowseLocatorControlEX - and HNDSQL8.APP - illustrating HandyMarkerBrowseLocatorControlEX.

The new demo applications implement an optional new feature available on the "Use SQL" tab of the two templates, ExplorerBrowse and HandyMarkerBrowse. This feature optimizes the SQL select statement and cuts down the chatter. Use HNDSQLTRACE.APP on the two demo apps and you'll see the difference when you run the trace first with the "Optimize For SQL?" switch on and then recompile and trace with the switch off. Let us know what you think, this totally eliminates the secondary selects that Clarion browses normally perform as they try and backfill to the currently selected record.

HNDSQLTRACE.APP has been changed. Compile and use HNDSQLTRACE.APP to test the two new apps by setting HNDSQLTRACE so that "Direct Trace On/Off" is checked.

This new feature lets you drop a HandyQueryTracingButton_EXPB or HandyQueryTracingButton_HNDMB directly on your browse, as we have in HNDSQL7.APP and HNDSQL8.APP, respectively. These button templates cause the procedure on which they're applied to communicate directly with HNDSQLTRACE.APP.

Cheers...
Gus M. Creces
The Clarion Handy Tools Page
gcreces@cwhandy.com

Sunday, June 29, 2008

CHT Changes Posted To WEBUPDATER June 27, 2008

We posted some changes to CHT WEBUPDATER June 27, 2008. This was not done as a version change for the time being, as the basic CHT classes and templates have not changed from the 12B1.01 which you've had since May 22, 2008.

At least until the end of July 2008, which is our target date for the release of build 12C1.00, there are going to be fairly frequent periodic updates without version number changes in order to introduce some new templates into the system so that an SQL project I'm working on can make use of them. You can feel comfortable downloading this un-reversioned update since it does not affect existing templates and classes that you've already been using. And it will give you a chance, if you're interested, in getting a preliminary look at some new templates,many of which are going to be targeted at SQL.

In this upload is a new template called ExplorerBrowseLocatorEx. This is an expanded version of ExplorerBrowseLocator (hence the "EX" suffix) that adds some features:

•  A "Go" button beside the locator to execute the locator. (Tab still works as before).

•  An automatic pass-through of the browse's "Data With Query Only" feature when the locator is set up as a filtering locator. This does work in the previous locator, but not if you've embedded your own filter into the browse. This new control lets you embed your own filter in the browse's ApplyFilter method, and still enforce "Data With Query Only" so that nothing displays unless the locator has been used.

•  There is a more sophisticated algorithm for "Drill-Down" in this locator, including a "bread-crumbs" string control that displays the current query, either as SQL or as CHT Query language. This works like "QBE", or "Query By Example" if you set the locator for "Drill-Down" since you can filter on multiple columns one after the other just by clicking on them and entering a new value in the locator. The new query is ANDed to the previous one until you click the Clear button.

Also coming for this new locator - when in filtering mode - is the ability to define on a column-by-column basis what the query keyword is for that column. So, a date or numeric column can use EQUAL while a text column can use CONTAINS.

There will be an equivalent locator for HandyMarkerBrowse early in July.

We're also working on a new SQL trace feature for CHT browses using HNDSQLTRACE.APP. This isn't available yet in the June 27th posting. The next HNDSQLTRACE.APP will have a filter feature that lets you trace a particular table or exclude a particular table. You'll also be able to direct output from our other SQL trace features, for example HandyQueryTracingButton_EXPB into HNDSQLTRACE.APP and a new option on that template lets you opt to see the entire SQL select including WHERE and ORDER BY.

More SQL-related features coming. I'll tell you about those as they are introduced and uploaded for you to try. We're about ready to release an "Experimental" switch on all CHT browse extension templates. This feature optimizes your CHT-extended ABC browse for SQL by overriding some of the ABC browse features that were really intended for ISAM tables and get in the way of SQL.

We're calling this "Experimental" because it's not default behavior, you have to turn this setting on to invoke the features set. We're going to let you try this feature on your browses for a while by way of an "experiment". Primarily it reduces the amount of SQL "chatter" that ABC browses - especially page loaded browses - tend to produce and slows them down. We'll be looking for your feedback on the impact of this on your SQL browses and, of course, we're prepared to take your questions and suggestions for improvements.

Cheers...
Gus M. Creces
The Clarion Handy Tools Page
http://www.cwhandy.ca

New SQL Trace Tool - HNDSQLTRACE.APP

We've got a new SQL trace tool for you to try. It's called HNDSQLTRACE.APP. This application is designed to help you with your SQL application development projects by assisting with easy SQL tracing.

Start tracing by configuring the specific driver(s) used by your SQL application followed by a click on the "Minimize" button. Once HNDSQLTRACE.APP starts, then start your SQL application.

Navigate in your SQL application to the specific area to be tested and bring HNDSQLTRACE.APP back up using the windows task bar icon menu provided.

When HNDSQLTRACE.APP re-appears all SQL statements executed to that point are displayed in reverse chronological order, with newest statements at the top. From this point forward, to trace specific actions, click the "Clear" button and interact briefly with your SQL application. Click the "Read Next" button to view the most recent SQL activity raised by your application. Repeat as necessary.

This is the first of a number of SQL-related features and improvements you'll see added to CHT in the upcoming months. There's a video explaining how to use it located on our Video Education page.

For a direct link to the video click here: CHT SQL Trace.

Cheers...

Gus Creces
The Clarion Handy Tools Page
http://www.cwhandy.ca