2.2.4.2.1.3 Variable Length Tokens(xx10xxxx)

Except as noted later in this section, this class of token definition is followed by a length specification. The length, in bytes, of this length is included in the token itself as a Length value (see section 2.2.7.3).

The following are the two data types that are of variable length.

  • Real variable length data types like char and binary and nullable data types, which are either their normal fixed length corresponding to their TYPE_INFO (section 2.2.5.6), or a special length if null.

    Char and binary data types have values that are either null or 0 to 65534 (0x0000 to 0xFFFE) bytes in length. Null is represented by a length of 65535 (0xFFFF). A char or binary, which cannot be null, can still have a length of zero (for example an empty value). A program that MUST pad a value to a fixed length typically adds blanks to the end of a char and binary zeros to the end of a binary.

  • Text and image data types have values that are either null, or 0 to 2 gigabytes (0x00000000 to 0x7FFFFFFF bytes) in length. Null is represented by a length of -1 (0xFFFFFFFF). No other length specification is supported.

Other nullable data types have a length of 0 if they are null.

Note  The DATACLASSIFICATION variable length token does not start with a length specification (see section 2.2.7.5).