System variables may be identified by a leading underscore in the variable name. Such an identifier is not normally valid in mSQL for table or field names. Examples of the supported system variables and uses for those variables are provided below.
where last_name = 'Smith'
update emp_details set title = 'IT Manager'
where _rowid = 57
rowid of a table row is intended to be used for "in place" updates. An
example of such an update is the query above. The rowid can be used when
there is no other way to identify a particular row (e.g. there are two
people called John Smith and staff identifiers are not being used). It
is not to be used as a substitute for an application maintained key or
index. Applications should use sequences if they wish to use server maintained
The primary use for the _timestamp system variable will
be internal to the mSQL engine. Using this information, the engine may
determine if a row has been modified after a specified point in time (the
start of a transaction, for example). It may also use this value to synchronise
a remote database for database replication. Although neither of these functions
is currently available, the presence of a row timestamp is the first step
in the implementation.
Example queries showing possible uses of the _timestamp
system variable are show below.
where first_name like '%fred%'
order by _timestamp
select * from emp_details where _timestamp 88880123
An example query using _seq system variable is shown below.
An example query using _sysdate system variable is shown below.
An example query using _systime system variable is shown below.
An example query using _user system variable is shown below.