I am new to Teradata. I need to create a procedure which has to select and insert values based on a If Condition. While creating this procedure it is throwing me syntax error. Can any one help me with this.
Create Procedure Test_Run_Ins(IN T1 Integer, IN T2 Integer) Begin
Declare cnt Integer; Declare i Integer;
Select Max(ABC)+1 into :cnt From Test;
If i <= cnt
Insert into TEST_RUN ( A, B, C ) Select :cnt, 123, 456 From TestX Where BC between :T1 and :T2;