Constructors, Converters, Descriptors, and Arithmetic Operators
Other basic vector operations for Oracle AI Vector Search involve creating, converting, and describing vectors.
- Vector Constructors
TO_VECTOR()andVECTOR()are synonymous constructors of vectors. The functions take a string of typeVARCHAR2orCLOBas input and return a vector as output. - Vector Serializers
FROM_VECTOR()andVECTOR_SERIALIZE()are synonymous serializers of vectors. The functions take a vector as input and return a string of typeVARCHAR2orCLOBas output. - VECTOR_NORM
VECTOR_NORMreturns the Euclidean norm of a vector as aBINARY_DOUBLE. This value is also called the magnitude or size and represents the Euclidean distance between the vector and the origin. For a vectorv = (v1, v2, ..., vn), the Euclidean norm is given by||v|| = SQRT(v12 + v22 + ... + vn2). - VECTOR_DIMENSION_COUNT
VECTOR_DIMENSION_COUNTreturns the number of dimensions of a vector as aNUMBER. - VECTOR_DIMS
VECTOR_DIMSreturns the number of dimensions of a vector as aNUMBER.VECTOR_DIMSis synonymous withVECTOR_DIMENSION_COUNT. - VECTOR_DIMENSION_FORMAT
VECTOR_DIMENSION_FORMATreturns the storage format of the vector. It returns aVARCHAR2, which can be one of the following values:INT8,FLOAT32,FLOAT64, orBINARY. - Arithmetic Operators
Addition, subtraction, and multiplication can be applied to vectors dimension-wise in SQL and PL/SQL. - Aggregate Functions
The aggregate functionsSUMandAVGcan be applied to a series of vectors dimension-wise.
Parent topic: Use SQL Functions for Vector Operations