Query Records and Query Resources
document into a QueryRecord in memory. The query definition function can then modify the QueryRecord before the application sends the query to the data server. This section defines the format of a 'qrsc' resource
query definition functions.
Query Resources
Each query document should contain a single 'qrsc' resource. Here is the
structure of the 'qrsc' resource, in Rez format.
type 'qrsc' {
Integer; // version
Integer; // ID of 'qdef' resource
Integer; // ID of 'STR#' resource that contains
ddevName, host, user, password,
connection string
Integer; // current query
// array of IDs of 'wstr' resources that contain queries
Integer = $$CountOf(QueryArray); // array size
wide array QueryArray{
Integer; // ID of 'wstr' resource
};
// array of resource types and IDs for other resources
in the query document
Integer = $$CountOf(ResArray); // array size
wide array ResArray{
literal LongInt; [TOKEN:12079] resource type
Integer; // resource ID
};
};
The first field in the 'qrsc' resource is the version number of the 'qrsc'
number is 0.
The second field is the resource ID of the 'qdef' resource containing the query
this 'qrsc' resource. Use an ID of 0 if there is no query definition function for
this resource to the data server without modifications.
The third field is the ID of an 'STR#' resource that contains five Pascal
strings corresponding to some of the parameters used by the DBInit function. If the query definition function is going to prompt the user for the values of
these parameters before entering them in the QueryRecord, they should be zero-length strings in the 'STR#' resource.
The sixth field in the 'qrsc' resource is an array of ID numbers of the 'wstr'
resources in the query document. The fifth field is the size of the array of
'wstr' IDs, and the fourth field is an index value indicating which element in
the array of 'wstr' IDs represents the current query. (The array elements are
numbered starting with 1.) The current query is the one actually sent to the
data server. If the query document contains more than one 'wstr' resource, the
query definition function can prompt the user to select the query to use and
modify the current query field in the QueryRecord appropriately. The eighth field in the 'qrsc' resource is an array listing the resource types
and IDs of all the resources in the query document other than the standard
resources included in all query documents. The s eventh field is the size of this
array. The resources listed in this final array are those used by the query
definition function. This list should include resources embedded in other
resources, such as a 'PICT' resource that is included in a 'DITL' resource.