Database Script Functions
This section describes database functions that can be called from scripts. These functions provide the basic services that a script may need to manage data in the database currently used by the CADMATIC application that executes the scripts.
You should have a working knowledge of script programming and be familiar with the concepts used in this manual.
Script functions accessing a database deal with the following special objects:
- table handle
- image handle
- record handle
You cannot do any arithmetic with script variables that store the above mentioned objects. You can only pass them as arguments to script functions or test their equality with 0. A non-existing handle has a value 0. If you assign these script variables to other variables then remember that both of these variables point to the same object.
A table handle is returned when a table is opened. Most of the actions on tables address the table via a table handle. Some actions address tables via name.
An image handle specifies columns (fields), their order and value of fields when accessing records in an opened table. When a record is inserted or updated then an image contains new values for the fields in the record. When a record is retrieved then an image will receive the values of fields of that record.
A record handle identifies a record within a database table. You should never assign a record handle type variable to another variable. If for example in a search loop there is a need to store the record handle of some interesting record then store the record number and seal to separate script variables. Do not assign the record handle variable as such. Later you can build the desired record handle from the record number and seal value.