Debugging a UDF | SQL External Routine Programming | Teradata Vantage - 17.10 - Debugging a User-Defined Function - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)
When debugging a function, be sure your tests include the following:
  • Limit checks on the input values
  • Limit checks on the return value
  • Proper handling of NULLs
  • Division by zero
  • All memory acquired by malloc is freed
  • All open operating system handles are released/closed

The Teradata C/C++ UDF Debugger allows some user-defined functions to be debugged within the database on a development or test system. The debugger only supports C and C++ functions. For more information on the Teradata C/C++ UDF Debugger, see C/C++ Command-line Debugging for UDFs.

For other user-defined functions, debugging is limited after the function is installed in the database. You can use other debugging tools to verify their functionality, or run them on a stand-alone virtual machine and debug the UDF server processes that executes them.

For an example of how to run, test and debug your function outside of Vantage, see the Teradata Downloads article, Developing Database Extensions (UDFs, etc.).