VFPUtils Article By: M. Asherman |
Querier Development Tasks | |
---|---|
Taskid Date Done Priority |
Title Description |
---|---|
quma0008 (not done) |
capture and display Rushmore optimization info in diagnostic tracing As an extension of the additional Querier properties and tracing already introduced, also include a new property, QryP_Rushmore, containing the results of VFP's SYS(3054, 11) function. This is a little trickier than it should be, because of the non-standard way that VFP returns this information. (The Rushmore optimization info is directed into the current user output window, or VFP's main window.) Once we've captured the Rushmore optimization information in a Querier property, it's an easy matter to include it in Querier's diagnostic tracing message, where it can be recorded or displayed elsewhere. |
quma0007 (not done) |
demonstrate how to propagate BTCrit errors to querier When BTCrit encounters an unusual error, the resulting detailed error information needs to be propagated back to Querier, so that the Querier.QryM_Run method (formerly named QueryCommand) can fail cleanly. Also, it is desirable to have a way of initializing BTCrit's diagnostic options by picking these up from Querier. Both of these things can be accomplished by making use of target indirection in the invocation of BTCrit, which is done via the Querier metafile field, usrparmexp. It would seem desirable to have ehp_abortstopshere = .T. to prevent an Abort from BTCrit leading to an Abort of Querier. This work may require testing on the BT server, to be sure to obtain a recent enough copy of BTCrit and working sample configurations. The Querier test cases include some BTCrit examples, demobt05 and demobt06, which need to be updated and re-tested. Note that there are BTCrit sample configuration files to go with these examples (in the Querier directory), and these also need to be updated. Querier's use of BTCrit is an example of a "nested" error handling situation, i.e. where one ErrHandler-based object (Querier) invokes a second ErrHandler-based object (BTCrit). Compare with an even more complicated case of nesting that was dealt with in Saver's use of Commander. Also see:
|
quma0006 (not done) |
create help pages documenting Querier in detail The Querier facility should have detailed programmer-oriented documentation. Old notes dealt only superficially with how to run the demo, references to comments residing in source code, and a crude task list. What is needed is a proper set of help pages explaining in detail:
These help pages can then be assembled into a convenient HTML Help file (sharing the same pages), as done for XFormDBF. |
quma0005 (not done) |
query post-processing options for DENULL and suffix-stripping There are a couple of annoying features of VFP/SQL's JOIN behavior, which get in the way of straightforward, efficient use of XFormDBF against the results of a query. The simplest, cleanest way to dispense with these problems is to introduce some Querier extensions. Specifically, it would be useful to add a mechanism for removing undesired NULLs and/or the "_a" fieldname suffix automatically added by VFP in certain types of queries. The first issue is that some types of JOINs may introduce NULL values, even though none of the original tables contained or even allowed NULLs. Since the presence of NULLs can significantly complicate processing, we need an option to use blank (empty) values instead of NULLs. (This could just as well have been a built-in option of VFP SQL, but there is no indication that Microsoft plans to add such an option.) I created a self-contained standalone UDF, DENULL.PRG, which removes NULLs by altering the table structure, and this approach seems to be efficient for large tables. The proposed change would be to incorporate the core logic of DENULL.PRG into a new method of Querier, rather than requiring applications (e.g. Job Control or a wrapper function) to explicitly invoke the DENULL UDF interface. The chief advantages of moving DENULL logic into Querier would be improved error handling and simplification of application logic. The second issue is that VFP tacks an "_a" suffix onto duplicated field names in SELECT * ... JOIN ... queries, which means that the original field name may not appear at all in the result, simply because there is another field with the same name. For the first instance of such duplicated field names, we might as well use the original unaltered form of the field name, i.e. the "_a" suffix automatically supplied by VFP is unnecessary. Again, we could use a new Querier option to fix this problem by altering the output table structure to strip off the undesired "_a" suffixes from field names. Although these are really two distinct problems, the similarities suggest that one new Querier method could deal with both options at the same time. In addition to this method, a couple of new Querier metafile fields should be added, making the removal of NULLs and stripping of "_a" suffixes independent, per-query options. Nadya suggested these changes in her posting of 2/9/01 and further clarifications under that thread. |
quma0004 (10/07/01) |
additional Querier properties and diagnostic options Introduce some new Querier properties for capturing useful information about the the most recently executed query. These additional properties might include the expanded SELECT clauses, output destination, results of the user parameters dialog, and the query's duration. (There already exists a qryp_tally property, which contains the count of records selected.) We also need a convenient way to display and/or log these query properties and statistics. The natural choice would be to employ ErrHandler's tracing and logging features, including an API for support of a user-defined logging function. (Note that Querier is an ErrHandler subclass, so it already supports the diagnostic message dialog and related ehp_... properties.) A new Querier trace level would control the generation of diagnostic information after running each query. This topic was brought up by Nadya on 1/25/01, and it was also mentioned previously in old text-based notes going back to at least a year before that. Related details:
Note the very minor annoyance that use of Querier's diagnostic tracing causes the status bar message generated by the SQL query to disappear. It's possible that an adjustment of errhshow.prg could fix this, but leave that for another time. Another useful option would be to make available VFP's Rushmore optimization information, as displayed by sys(3054, 11). This is a little tricky to capture in a Querier property, because of the way that sys(3054) operates, but it could be done (somewhat awkwardly - e.g. by redirecting screen output to a file). In the meantime, a less versatile alternative is simply to enable displaying Rushmore optimization information in the main VFP window. |
quma0003 (11/04/00) |
rebuild and test Querier with latest ErrHandler changes Rebuild Querier to pick up the latest version of ErrHandler as of changes for support of nested ErrHandlers. Test all of the sample queries in querydf.dbf to confirm that there are no compatibility problems (none are expected). |
quma0002 (10/06/01) |
provide fuller error handling coverage for all Querier methods Querier was the first application to employ the ErrHandler facilities, which have since undergone further extensions and wider use in other applications. The current implementation of Querier only uses some of the available error handling facilities within its most important method, QueryCommand. This old logic (especially the Init method) should be reviewed/updated, and all other Querier methods should also support appropriate error handling, as done for Commander. Specific Querier changes include:
Another task that should accompany these changes is quma0004: additional Querier properties and diagnostic options. It will save time to combine these changes into one Querier update, and makes it possible for Nancy to phase out her manual Querier edits. Also this will allow me to give a good illustration of Querier-specific diagnostic tracing, with a custom Querier trace level for reporting additional details after executing the query. |
quma0001 (not done) |
convert old querier.txt documentation into a web page As done for other applications, e.g. similar task for XFormDBF, take the old text-based task list and documentation for Querier (querier.txt) and put it into more convenient HTML form. This will make it easier to migrate tidbits into the newer web organization. |