16.20 - SET SESSION DEBUG FUNCTION - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)

Purpose

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 “C/C++ Command-line Debugging for UDFs” in Teradata Vantage™ SQL External Routine Programming , B035-1147 .

Required Privileges

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.

Syntax



Syntax Elements

DEBUG FUNCTION
Keywords to precede function name.
DEBUG PROCEDURE
Keywords to precede stored procedure name.
DEBUG METHOD
Keywords to precede method name.
database_name
Name of database, if other than the current database.
user_name
Name of user, if other than the current user.
function_name
Name of function to debug.
procedure_name
Name of stored procedure to debug.
method_name
Name of method to debug.
ON
Set debugging on.
OFF
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;

ANSI Compliance

SET SESSION DEBUG FUNCTION is a Teradata extension to the ANSI SQL:2011 standard.

Usage Notes

You can only debug one function per session at a time. After you set debugging on for a function, debugging remains enabled until one of the following occurs:
  • 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.