TEXT_GENERATION built-in function

The TEXT_GENERATION built-in function returns the generated text based on an input string. TEXT_GENERATION is a non-deterministic function.

Read syntax diagramSkip visual syntax diagramTEXT_GENERATION(string-expressionUSINGmodel-name)

The schema is SYSIBM.

string-expression
A string value representing the prompt from which to generate text.
model-name

A registered text generation model to be use for text generation. In dynamic SQL statements, the CURRENT SCHEMA special register is used as a qualifier for an unqualified external model name. In static SQL statements, the QUALIFIER precompile or bind option implicitly specifies the qualifier for an unqualified external model name. The external model must be defined with model type TEXT_GENERATION (SQLSTATE 42858).

The result of the function is a string type as defined 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.

Notes

  • The privileges held by the authorization ID of the statement must include at least one of the following privileges:
    • The USAGE privilege on the external model.
    • DATAACCESS authority.