Represents a variable-length binary string.
where:
Syntax element … |
Specifies … |
n |
the number of bytes in the string. The maximum value for n is 64000. |
attributes |
appropriate data type, column storage, or column constraint attributes. See “Core Data Type Attributes” on page 17 and “Storage and Constraint Attributes” on page 18 for specific information. |
VARBYTE is a Teradata extension to the ANSI SQL:2011 standard.
The following table lists the client representations for the Teradata SQL VARBYTE data type.
Define the length of the VARBYTE string as k, where 0 <= k <= n.
Client CPU Architecture |
Client Internal Data Format |
IBM mainframe |
k + 2 bytes 16-bit SMALLINT (2 byte) length count k followed by k bytes of BYTE data. |
|
k + 2 bytes 16-bit SMALLINT (2 byte) length count k followed by k bytes of BYTE data. |
In the following example, the column named BinaryData is assigned the VARBYTE data type and has an upper limit of 1200 bytes:
CREATE TABLE DocTable
(DocType INTEGER
,DocName CHAR(26)
,BinaryData VARBYTE(1200));