SUBBITSTR Function Syntax | Teradata Vantage - SUBBITSTR Function Syntax - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/djk1612415574830.ditamap
dita:ditavalPath
SQL_Functions__Expressions__and_Predicates.Upload_071421/wrg1590696035526.ditaval
dita:id
B035-1145
lifecycle
previous
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.