Executing Queries from UDF

Connectivity
Fan

Executing Queries from UDF

Hi,

I need to know if there is any way I could execute a query from within a UDF. I would really appreciate if anyone could help me with this or definiteively say that it cannot be done.
3 REPLIES
Enthusiast

Re: Executing Queries from UDF

No I/O of any type is allowed in a UDF; That includes disk, network, or standard I/O. The exception being FNC_Trace_Write. If you attempt I/O through some other means, such as including assembly code or separate package installation that attempt I/O, your code will probably fail or cause the database software to fail.
Teradata Employee

Re: Executing Queries from UDF

In Teradata V2R6.1 and later, a UDF can do "external I/O" via operating system calls; this is documented in the manuals. You can't have embedded SQL statements in source code provided to CREATE FUNCTION.
Fan

Re: Executing Queries from UDF

Thanks for the info guys