ROTATERIGHT Function Syntax | Teradata Vantage - ROTATERIGHT 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.] ROTATERIGHT ( target_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.
num_bits_arg
An integer expression indicating the number of bit positions to rotate.
IF... THEN the function...
num_bits_arg is equal to zero returns target_arg unchanged.
num_bits_arg is negative rotates the bits to the left instead of the right.
target_arg and/or num_bits_arg are NULL returns NULL.
num_bits_arg is larger than the size of target_arg rotates (num_bits_arg MOD sizeof(target_arg )) bits.

The scope of the rotation operation is bounded by the size of the target_arg expression.

When operating against an integer value (BYTEINT, SMALLINT, INTEGER, or BIGINT), rotating a bit into the most significant position will result in the integer becoming negative. This is because all integers in Vantage are signed integers.