Threads considerations

 

A user-defined function (UDF) that is defined as FENCED runs in the same job as the SQL statement that calls the function. However, the UDF runs in a system thread, separate from the thread that is running the SQL statement.

Because the UDF runs in the same job as the SQL statement, it shares much of the same environment as the SQL statement. However, because it runs under a separate thread, the following threads considerations apply:

 

Parent topic:

Writing UDFs as external functions

 

Related reference


Multithreaded applications
Fenced or unfenced considerations