All Forums Connectivity
farqis 2 posts Joined 07/07
24 Jul 2007
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.

FAQ-4151 7 posts Joined 04/07
24 Jul 2007

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.

Fred 1096 posts Joined 08/04
24 Jul 2007

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.

farqis 2 posts Joined 07/07
25 Jul 2007

Thanks for the info guys

You must sign in to leave a comment.