The BEE Database Operation is carried out by several commands, mainly the "database" command. For data retrieval, subsequent "var" commands (most commonly represented in "var" assignment) or "foreach" loop can be used to fetch the records in the retrieved record set. For details of the syntax and parameters of these commands, please see "BEE Command Reference".
There are two modes of operation with the "database" command: "query" and "action". In either mode, the system will eventually submit an SQL query to the database engine and obtain the result from it. The difference of the two modes is in how the SQL query is built.
In the "query" parameter is specified, the "query" mode is assumed and the "action" parameter will be ignored.
In "query" mode, the SQL query statement is specified by the user explicitly. The system simply take the query string, evaluate for embedded variables, and submit it to the database engine. For data retrieval, the system will retrieval the record set for later fetching. If "seek" is specified, the required record in the record set will be located for subsequent fetching.
If the "query" parameter is not specified but the "action" parameter is, the "action" mode is assumed.
In "action" mode (only if the "query" parameter is NOT specified), the SQL query statement is built from the "Argument Variables" in the database object (represented in this document as dbobj) and the matrix. (Please see the "matrix" parameter under the "database" command.)
If neither the "query" parameter nor the "action" parameter is specified, the "database" command does not do anything unless "seek" is specified, in which case, the "seek" operation is performed on the last retrieved record set.
|