16.20 - Procedure - 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
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
procedure_name
The name of the SQL procedure whose most recent SQL create text is to be reported.

SHOW PROCEDURE displays procedure text as it was sent to the database. You must type line breaks in the procedure using the Enter or Return key to properly display the text.

Example: SHOW PROCEDURE

Following is an example shows the DDL for a procedure named spSample1:

     SHOW PROCEDURE spSample1;
      *** Text of DDL statement returned.
      *** Total elapsed time was 1 second.
     -----------------------------------------------------------------
     CREATE PROCEDURE spSample1 (IN  ip INTEGER, 
                                 OUT op INTEGER) 
     BEGIN DECLARE var_1 INTEGER;
     SELECT col1 INTO var_1
     FROM tab_1
     WHERE col_2 = ip;
     SET op = var1 * 10;
     END;

Example: Showing a Java External Stored Procedure with an XML Data Type

This example shows the DDL for a Java external stored procedure with an XML data type as an input parameter:
SHOW PROCEDURE get_XML;
*** Text of DDL statement returned.
 *** Total elapsed time was 1 second.
---------------------------------------------------------------------
REPLACE PROCEDURE get_XML(IN X1 XML, INOUT A1 INTEGER)
        LANGUAGE JAVA
        NO SQL
        PARAMETER STYLE JAVA 
        EXTERNAL NAME 
        'UDF_JAR:UserDefinedFunctions.get_XML(java.sql.SQLXML, int[])’;