This section describes standard mechanisms as to how to create, update or remove records in the server from the client.
Data transport is handled with the Attribute String. Both the client and the server can pack and unpack an Attribute String.
The server uses records instead of the Attribute Strings. All DML (Data Manipulating Language), create, modify and remove operations in the server are actioned using records. The attribute string is transformed to a server record when the server receives an Attribute String. A server record is defined as:
This declaration means that all columns in the table exists in the record.
An Indicator Record is a type of server record. This record contains all columns from the table but instead of the actual data it contains a Boolean value if the attribute is changed or not. It should be used internally in the generated server framework methods.
The client fetches data from database views using SQL. Many records can be
fetched at the same time if needed, for example in an overview form. The
attributes objid
and objversion
in a view must be
fetched to the client to be able to update or remove a record. These two
attributes are used by the server framework for identification, locking and
version control.
The actions New__
, Modify__
and Remove__
are used for manipulating data. Please note that these methods have double
underscores, and they should not be mixed up with the server methods which have triple underscores. They can be called using action parameters
which are set to
CHECK or DO. The client normally calls the server, first
of all
using action CHECK, and then again using action DO. The
CHECK action can sometimes be omitted, see
Client Information for
further
information.
A new record is created in this way:
New__
method in PREPARE
mode.Prepare_Insert___
to fetch the default values.New__
method in CHECK mode.Unpack___
and unpacks the attribute string into a server record and an
indicator record.Check_Insert__
and checks that all values in the
attribute string are correct.New__
method in
DO modeUnpack___
and unpacks the attribute string into a server record and an
indicator record.Check_Insert__
and checks
that all values in the attribute string are correct.Insert___
and creates a new record in the entity.objid
, objversion
and
automatic values like server generated attributes and/or server generated
primary keys back to the client in the attribute string format. Other
information is sent to the client in the Info_ parameter, which can be
displayed by the client if required, see
Client Information for
more information.Updating a record is done in this way:
Modify__
method in CHECK mode.Unpack___
and unpacks the attribute string into a server record and an
indicator record.Check_Update__
and checks that all values in the attribute
string is correct.Modify__
method
in DO mode.Unpack___
and unpacks the attribute string into a server record and an
indicator record.Check_Update__
and checks that all values in the attribute
string is correct.Update___
and updates the entity.objid
, objversion
and
automatic values like server generated attributes and/or server generated
primary keys back to the client in the attribute string format. Other
information is sent to the client in the Info_ parameter, which can be
displayed by the client if wanted, see
Client Information for
more information.Removing a record is done in this way:
Remove__
method in CHECK mode.Check_Delete__
and checks that it is valid to
remove the record.Remove__
method
in DO mode.Check_Delete__
and checks that is is valid to
remove the record.Delete__
and deletes the record.