FILEFLEX API REFERENCE



NAME
DBRelationalQuery -- Set up the behavior of a relation

SYNTAX
DBRelationalQuery(query-expr,force-accel [, sort-order])

CATEGORY
Relations

DESCRIPTION
NEW IN FILEFLEX 3.0

This is a hugely powerful function that sets up the behavior of the relation. It takes three parameters.

The first is the query expression. This works like most FileFlex expressions, except that you can query across databases. To query a specific database, use it's file name, followed by -> followed by the field name. For example, to get a zip code from ADDRESS.DBF, you'd specify ADDRESS->ZIP.

The second parameter is the Force Acceleration directive and can be either "TRUE" or "FALSE". If "TRUE", FileFlex checks to see if the query can be accelerated, and if not, exits the function with a -840 error. If the second parameter is "FALSE", FileFlex doesn't check whether or not the query can be accelerated and just runs with it.

The third parameter is an optional sort order. If you expect your matched set to be large, leave out this option or it will slow down the program. The sort order specifies how the results of the query will be sorted and works like the specification for a tag, although, again, it's possible to sort according to multiple databases using the -> notation.

The first call to DBRelationalQuery may take some time to run as it buffers the matches into what appears to be a virtual, combined data file, then moves to the top of that match set. You can traverse the query results using DBSkip, DBTop, and DBBottom.

You must have completely defined your relational structure before calling this function. This technology is very hot. It uses a mechanism very similar to FoxPro's Rushmore technology to accelerate queries for very rapid results. Eventually, the docs will describe what forms of queries can be accelerated, but for now, the rules that apply to FoxPro are very similar to those used in FileFlex.

** EDIT NOTE: Describe the mechanism by which queries are accelerated.


EXAMPLE
put DBRelationalQuery("STAFF->SALARY > OUTSERV->SALARY","TRUE", "STAFF->LAST") into DBResult

SEE ALSO
DBSetParentRelation, DBCloseRelation, DBSelect, DBSelectRelation, DBAddExactRelation, DBAddManyRelation

INTERNAL FUNCTION NUMBER
94


Copyright © 1992-1998 by David Gewirtz, under license to Component Enterprises, Inc.
Contact: info@component-net.com

Casa de Bender