DATAMODEL Command

DATAMODEL — Modify datamodel and matching database table.

Synopsis

DATAMODEL APPEND data_model_name

DATAMODEL SELECT data_model_name TABLE table_name [ CONDITION condition [condition...] ]

DATAMODEL REMOVE data_model_name

DATAMODEL UPDATE data_model_name

Introduction

The DATAMODEL command loads, appends a row to, removes a row from or updates a row in a datamodel. The database table linked to this datamodel will updated accordingly. All DATAMODEL commands will return a status. As soon as something goes wrong, the status will have a value other than 0. The status can be retrieved by calling the built-in function DATAMODELSTATUS().

Arguments

data_model_name

The name of the data model as defined in the development environment.

table_name

The name of the table where data needs to be changed.

condition

Additional SQL conditions can be placed here to limit the numbers of entries in the Data Model.

Example

. . .
. . .
CLEAR DATAMODEL Cust
DATAMODEL SELECT Cust TABLE Cust
FOREACH Cust
	M-status.Cust = "Active"
	DATAMODEL UPDATE Cust
ENDFOR
. . .
. . .
CLEAR DATAMODEL Devices
DATAMODEL SELECT dmDevices TABLE Devices CONDITION "where device_id = '" L-deviceID "'"
FOREACH dmDevices
	M-installDate.dmDevices = DATE()
	DATAMODEL UPDATE Cust
	BREAK
ENDFOR
. . .
. . .

Related Commands

FOREACH SQL