Modifying Stored Procedures - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

To modify a stored procedure definition, use the REPLACE PROCEDURE statement.

Example: Inserting Salary Information into the Employee Table

Assume you want to change the previous example to insert salary information to the Employee table for new employees.

The REPLACE PROCEDURE statement looks like this:

REPLACE PROCEDURE NewProc (IN name CHAR(12),
                           IN number INTEGER,
                           IN dept INTEGER,
                           IN salary DECIMAL(10,2),
                           OUT dname CHAR(10))
BEGIN
   INSERT INTO Employee (EmpName, EmpNo, DeptNo, Salary_Amount)
      VALUES (name, number, dept, salary);
   SELECT DeptName
      INTO dname FROM Department
         WHERE DeptNo = dept;
END;