Skip to Content

mvSQL Runtime Function - GENERATED()

Summary

Retrieve a generated value during the Event by the business engine.

Syntax

GENERATED(<column-identifier>,[<data-type>])

Parameters

column-identifier

mvSQL column identifier as a string.

Supports the following syntaxes:

  • 'Column' - Single-part identifier. Example: 'OrderId'
  • 'Table.Column' - Multi-part identifier. Disambiguates columns in separate tables that share the same name. Example: 'Order.Id'.
  • '"Column"' - Delimited identifier, single- or multi-part. Escape special characters in table or column names. Example: "Sales Order"."Sales Order No".

data-type

Data type, string, Optional.

Determines the empty (zero-filled) value returned if the column identifier does not match a generated value.

Valid arguments include:

  • 'string' - '', Default.
  • 'uuid' - '00000000-0000-0000-0000-000000000000'
  • 'number' - '0'

Returns

string

Generated value as a string. If the column identifier does not match a generated value, returns an empty (zero-filled) value.

Remarks

The GENERATED() function was added in a 2.7 hotfix.

Examples

GENERATED('OrderId')

Returns

'0be1cfe8-990d-4553-b0a9-0f7eedea3560'