TO_EMBEDDING built-in function
The TO_EMBEDDING built-in function returns the embedding vector for an input string.
The schema is SYSIBM.
-
string-expression
- A `VARCHAR` value containing the text to be embedded. model-name
- A registered embedding model to be used for generating an embedding vector. USAGE privilege is required on the external model.
The result of the function is a VECTOR type value with the dimension and coordinate-type specified in model-name. If the first argument can be null, the result can be null. If the first argument is null, the result is the null value.
The following example shows the command syntax for returning an embedded vector by using the
external model
model1:db2 "VALUES TO_EMBEDDING('hello embedding' USING db2inst1.model1)"