KEY_TO_SCALAR()

All functions > CORE > KEY_TO_SCALAR()

Drop the entity annotation and keep the base type and unit

Signatures

Returns: The same value with the entity removed

KEY_TO_SCALAR(key: T#E) → T
sql
ParameterTypeRequiredDescription
keyT#EYesIdentity key

Signature notes: A value that is already plain is unchanged and warns KEY-TO-SCALAR-NO-ENTITY. The call marks the value: CAST and :: refuse to put an entity back on it. Relabel with UNSAFE_CAST.

Notes

Hash a key with HASH01(CAST(KEY_TO_SCALAR(key) AS VARCHAR)) when HASH01 requires VARCHAR. Order two keys with IS_KEY_BEFORE, not with <.

See also

  • IS_KEY_BEFORE

  • KEY_PAIR

  • UNSAFE_CAST