SUBBITSTR Function Syntax | Teradata Vantage - SUBBITSTR Function Syntax - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantageā„¢
[TD_SYSFNLIB.] SUBBITSTR ( target_arg, position_arg, num_bits_arg )

Syntax Elements

TD_SYSFNLIB.
Name of the database where the function is located.
target_arg
A numeric or variable byte expression.
If target_arg is NULL, the function returns NULL.
position_arg
An integer expression indicating the starting position of the bit substring to be extracted.
If position_arg is negative or out-of-range (meaning that it exceeds the size of target_arg), an error is returned.
If position_arg is NULL, the function returns NULL.
num_bits_arg
An integer expression indicating the length of the bit substring to be extracted. This specifies the number of bits for the function to return. Because the return value of the function is a VARBYTE string, the number of bits returned is rounded to the byte boundary greater than the number of bits requested.
The bits returned is right-justified, and the excess bits (those exceeding the requested number of bits) are filled with zeros.
If num_bits_arg is negative, or is greater than the number of bits remaining after the starting position_arg is taken into account, an error is returned.
If num_bits_arg is NULL, the function returns NULL.