BYTE/BYTES Function Example | Teradata Vantage - Example: Using BYTE to Obtain the Number of Bytes in a Badge Picture - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantageā„¢

The following statement applies the BYTES function to the BadgePic column, which is type VARBYTE(32000), to obtain the number of bytes in each badge picture.

   SELECT BadgePic, BYTES(BadgePic) 
   FROM Employee; 

The result is as follows:

   BadgePic        Bytes(BadgePic)
   --------------  ---------------
   20003BA0                      4
   9A3243F805                    5
   EEFF08C3441900                7