All Forums Database
ljohnny 1 post Joined 08/16
10 Aug 2016
How to call a function from a procedure call in Teradata

I am creating a stored procedure. Let's call it SP1. In SP1, I need to call SP2, and one of the input parameter needs to be passed in by calling a function Func1
****************************************************** **********
REPLACE PROCEDURE SP1(
IN Var VARCHAR(20), IN Var2 VARCHAR(20), IN Var3 VARCHAR(20)
)
BEGIN
    DECLARE FuncResult VARCHAR(255);
    SET FuncResult = (SELECT Func1(:Var3));
    CALL SP2(:Var, :Var2, :FuncResult);
END;
****************************************************** ************
Will this work?

You must sign in to leave a comment.