Procedure help

Database
Enthusiast

Procedure help

Hi

I am very new to Teradata and trying to create Procedure which will update the table if it canot find the row to update it runs again until 10 times and should fail if it cannot find row. If it find row and updates row it should get succes..

Begin TRANSACTION;
SET AFFECTED_ROWS = 0;
SET RUN_COUNT = 0;
WHILE (AFFECTED_ROWS = 0 OR RUN_COUNT > 10)
DO
SELECT * FROM dev_fcrhubdb.dummy_table;
SET AFFECTED_ROWS = ACTIVITY_COUNT;
SET RUN_COUNT = RUN_COUNT + 1;
END WHILE;
IF (RUN_COUNT > 10)
THEN

ELSE

End TRANSACTION;