Default Values - Variables (Magic xpa 3.x)
Default values are the values assigned to variables when no specific value is explicitly assigned in the program. In Magic xpa you can define the default values.
Magic xpa differentiates between two kinds of default values:
-
When a new variable is instantiated in runtime; that is, when a task is run. If the variable is not assigned with an INIT expression, the variable's default value is used.
-
When a table definition is created based on the Data repository, in SQL databases, a default value can be defined in the database. This value will be given to the column when using an INSERT statement and the column was not part of the statement.
A default value can be either NULL or a real value.
Default values are defined in the following places:
-
Project level – Application Properties dialog box
-
Model level – Model Properties sheet
-
Column level – Column Properties sheet
-
Virtual Variable level – Virtual Variable Properties sheet
Initial default values are attribute-dependent.
|
|
Alpha
|
Empty string
|
Numeric
|
0
|
Date
|
1/1/0001
|
Time
|
00:00:00
|
Blob
|
Null
|
Logical
|
False
|
Studio and Runtime Behavior