Hi Paul, Volker
Paul thank you for answering this question.
The universe of sgs are the simple_types, the universe of the database are the db_types.
sgs
always maps simple_types (used for presentation) to a db_type (used for persistence). this makes it possible to add properties to a simple_type in the user interface beyond database and it makes it also possible to solve storage issues like Volkers problem with money values.
to simplify the field definitions, for each simple_type there is a default mapping into a db_type.
In mysql for example the default mapping for simple_type="float" is db_type="float".
so these 2 expressions are strictly equivalent:
<field name="a_field" displayname="a_name"
simple_type="float"></field>
<field name="a_field" displayname="a_name"
simple_type="float" db_type="float"></field>
some default mappings for mysql:
simple_type float = db_type float
simple_type date = db_type decimal(10,0)
simple_type text = db_type varchar(255)
simple_type select = db_type varchar(255)
simple_type files = db_type text
so, with the db_type tag, you simply override the default mapping.
related to this topic are the store and restore tags which allows you to convert or manipulate data before storing in the database or after restoring from database.
Cheers
Patrick