Examples for all bit byte manipulate functions can be found at: pkg_install_location\teradataml\data\notebooks\sqlalchemy\Teradata Vantage Bit-Byte Manipulation Functions using SQLAlchemy.ipynb.
Supported functions
S/N | Function Name | Description |
---|---|---|
1 | BITAND | Performs the logical AND operation on the corresponding bits from the two input arguments. |
2 | BITNOT | Performs a bitwise complement on the binary representation of the input argument. |
3 | BITOR | Performs the logical OR operation on the corresponding bits from the two input arguments. |
4 | BITXOR | Performs a bitwise XOR operation on the binary representation of the two input arguments. |
5 | COUNTSET | Returns the count of the binary bits within the target_arg expression that are either set to 1 or set to 0 depending on the target_value_arg value. |
6 | GETBIT | Returns the value of the bit specified by target_bit_arg from the target_arg byte expression. |
7 | ROTATELEFT | Returns an expression rotated to the left by the number of bits you specify, with the most significant bits wrapping around to the right. |
8 | ROTATERIGHT | Returns an expression rotated to the right by the number of bits you specify, with the least significant bits wrapping around to the left. |
9 | SETBIT | Sets the value of the bit specified by target_bit_arg to the value of target_value_arg in the target_arg byte expression. |
10 | SHIFTLEFT | Returns the expression target_arg shifted by the specified number of bits (num_bits_arg) to the left. The bits in the most significant positions are lost, and the bits in the least significant positions are filled with zeros. |
11 | SHIFTRIGHT | Returns the expression target_arg shifted by the specified number of bits (num_bits_arg) to the right. The bits in the least significant positions are lost, and the bits in the most significant positions are filled with zeros. |
12 | SUBBITSTR | Extracts a bit substring from the target_arg input expression based on the specified bit position. |
13 | TO_BYTE | Converts a numeric data type to the database server byte representation (byte value) of the input value. |