Comments and Stored Procedures Teradata

Comments are allowed in procedures and on procedures as seen below.

Commenting in a Stored Procedure

Stored procedures allow for comments along with the SQL and SPL statements. Either or both the ANSI comment ( – single line) or the Teradata comment ( /* */ multiple lines ) techniques may be used. Again, it is easier using the Teradata method for multiple line comments and the ANSI method easier for single line comments.

The next example shows a comment inside of Test_Proc:

Commenting on a Stored Procedure

Like other Teradata RDBMS objects, comments may also be added to the object. When comments are present, a HELP DATABASE or USER command displays them along with the name and kind of object. In addition, comments may also be stored on the parameters of a stored procedure. These comments can assist in the execution of the procedure.

The syntax for the COMMENT ON for a stored procedure is:

COMMENT ON PROCEDURE <procedure-name> '<comment-here>' ;

This COMMENT places a comment on the procedure called Test_Proc, used above:

COMMENT ON PROCEDURE Test_Proc 'Procedure tests 2 input values and returns result' ;

The syntax for commenting on a parameter in a stored procedure is the same as a column comment for in table or view using COMMENT ON:

COMMENT ON COLUMN <procedure-name>.<argument-name> '<comment-here>' ;

The next COMMENT places a comment on the parameters in the Test_Proc:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Teradata Topics