Identifies the UDF, UDM, or stored procedure to be run in debug mode the next time the function, method, or stored procedure is invoked.
For more information, see CREATE PROCEDURE (External Form) EXTERNAL NAME external_string_literal, CREATE FUNCTION (External Form EXTERNAL NAME external_string_literal, CREATE METHOD EXTERNAL, and the appendix on "C/C++ Command-line Debugging for UDFs" in SQL External Routine Programming, B035-1147.
You must have the EXECUTE FUNCTION and the DROP FUNCTION privilege on the function or stored procedure you want to debug.
You must have the UDTMETHOD and the UDTUSAGE privileges for the method you want to debug.
- DEBUG FUNCTION
- Keywords to precede function, method, or stored procedure name.
- Name of database, if other than the current database.
- Name of user, if other than the current user.
- Name of function, method, or stored procedure to debug.
- Set debugging on.
- Set debugging off.
Example: Enabling Debugging for the Session
SET SESSION DEBUG FUNCTION function_name ON;
Example: Disabling Debugging for the Session
SET SESSION DEBUG FUNCTION function_name OFF;
SET SESSION DEBUG FUNCTION is a Teradata extension to the ANSI SQL:2011 standard.
- Debugging is turned off for the function.
- Debugging is turned on for another function with a subsequent SET SESSION DEBUG FUNCTION statement.
- The session terminates.
After you set debugging on for a function and a query invokes the function, the function is passed to the debugger. If a debugger is not active, the query cannot complete until the debugger is started, attaches to session running the query, and allows all instances of the function being debugged to complete.