Column Default Value Expression Macros
Default Value Expression Macros
Session-Specific Column Expressions
Column Expressions
Database-Specific Column Expressions
Database-Specific Date Functions
Other Database-Specific Functions
Metadata Macros
Macros for External Database Objects
The purpose of this help topic is to provide instruction on column default value expression macros.
- A macro may be entered as a default value when creating a column. These macros are delimited by braces ({}).
Default Value Expression Macros
The supported macros are listed in the table below.
Macro |
Description |
{today +|- 0-9
hour|day|week|month|year} |
Replaced internally with the current system date, and then the additional instructions act upon the date returned. Limited to date-type fields. Refer to Search Tips topic for more details. |
{current.postInstruction +|- 0-9
hour|day|week|month|year}
|
Replaced internally with the current system date and time and then the additional instructions act upon the date and time returned. Limited to timestamp-type fields. Refer to Search Tips topic for more details. |
{application.id} |
The unique identifier associated with the current application session. |
{column.table_name.column_name} |
Replaced internally with the column name's value from the related table name. The related table name must be an identifying ancestor. For example, md_relation is an identifying ancestor of md_relation_col. As a result, md_relation_col.parent_table_name has {column.md_relation.parent_table_name} as a macro. When in create mode, the md_relation_col column's child_table_name column will be defaulted to the value of its associated md_relation column's parent_table_name column value.
Also supports the ability to retrieve the default value from one of the table's business key constituents. One example is the databases table. The data_model column should default to the database_name that was entered in the Create page while in create mode; therefore, the Default Value for the data_model column of the md_database table should be set up with the following value: "{column.md_database.database_name}". |
{db.length} |
Return the length of a string expression |
{db.udfowner} |
Return the owner name for User-Defined Functions.
SqlServer Note: All user-defined functions need to be prefixed with "dbo." when used in SQL statements. |
Session-Specific Column Expressions
The session-specific column expressions are listed in the table below.
Macro |
Description |
{session.id} |
The unique identifier associated with the current session.
Implementation: Session Applications view, to show applications associated with the current session. |
{session.instance} |
The name of the current application server instance (host + environment). |
{session.locale} |
The locale (language _ country/region) associated with the current session.
Implementation: Table Literal, Column Text, to display the literal text associated with the current session's locale. |
{session.timezone} |
The time zone identifier (e.g. America/New_York). |
{session.timezonevalue} |
The effective time zone offset value (in hours). For example, if the time zone identifier is America/New_York, then in daylight saving time, the effective time zone offset value is -4.00, and otherwise, the value is -5.00. |
{session.user} |
Replaced internally with the session user name. Limited to character-type fields. Refer to Search Tips topic for more details. |
{session.session_att_key} |
Replaced internally with the value from the md_session_att table, where the Attribute Key is equal to the value specified as session_att_key. |
{session.session_att_key[/ReplacementValue]} |
[…] optional
The replacement value for a missing/undefined/empty session attribute.
May also be used to specify a default value. |
|