CREATE/REPLACE PROCEDURE Examples | Teradata Vantage - Example: Creating a Procedure with Parameters of Different Data Types - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

The following example is for creating a valid procedure named spParams with six parameters of different data type combinations:

    CREATE PROCEDURE sp_params (INOUT iop1 SMALLINT,
                                OUT   op1  DECIMAL(10,3), 
                                IN    ip2  NUMERIC, 
                                INOUT iop2 FLOAT, 
                                OUT   op2  REAL, 
                                IN    ip3  DOUBLE PRECISION)
    BEGIN
     SET iop1=3;
     SET op1=5.2;
     SET iop2=10.2;
     SET op2=iop2;
    END;