Program Execution

Zim is capable of executing database commands in either of these three modes:

SQLMODESQL mode
SERVERMODEZim Integrated Server mode
ZIMMODEStandard Zim mode

The default mode of operation is SERVERMODE. For all database servers except Zim Integrated Server, SERVERMODE and SQLMODE behave identically. In SERVERMODE, a Zim client accessing tables on Zim Integrated Server sends Zim commands to the server instead of SQL commands which greatly improves performance. In SQLMODE, the ZIM client determines the optimal SQL syntax to send to the server by inspecting the values for “EntType” or “RelType” in the Object Dictionary for the tables specified in the command.

The mode in which Zim operates may be set by the command:

SET EXECUTEMODE [ SERVERMODE | SQLMODE | ZIMMODE ]

where SERVERMODE is the default setting. For example, if the command:

set executemode zimmode

were executed, then Zim would revert to executing standard Zim code. If the program had been compiled in SQLMODE, it would revert to interpreting the program source file but issue error and warning messages.

Zim generates SQL statements to access entity sets and relationships that are stored in relational databases. To execute these statements (i.e. your application), you must be connected to the relational database. In order to support “off-line” development Zim enables you to turn off SQL statement generation, in effect generating standard Zim code. Zim ignores “EntType” and “RelType” and considers everything to be under Zim’s control. This enables you to develop and maintain applications without connecting to the database. In fact, development can proceed independent of the particular database vendor.

Tracing SQL Commands

In order to access relational databases, Zim client-server generates SQL statements. You can see the statements generated by setting SQLTRACE on. Statements are generated when Zim statements containing references to SQL tables are parsed, compiled, or executed interpretively. Previewing the SQL statements generated provides an insight into the type or amount of work the database is going to be doing. This option is set using the command:

set sqltrace [on | off]

The default setting for SQLTRACE is OFF.

Connecting and Recompiling the Zim Application

The application is compiled using the “compilemode” option “sqlmode” and conversion to a Zim Client-Server application is complete.

If the application is to be developed for execution against a pre-existing SQL server database, then the Zim application should be compiled using the “compilemode” option “zimmode” to test the application for functionality and performance. Then the application can be compiled using the “compilemode” option “sqlmode”. If the application is being compiled in the default “sqlmode” with the sqlcompile setting “on”, then you must be connected to the SQL server.

en_CAEnglish