Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Translate loop into Teradata Stored Procedure - response (1) by msk.khurram

$
0
0

Hi,
Hope this will work for you!
 
REPLACE PROCEDURE Test()
BEGIN
DECLARE logdate DATE;
DECLARE hrinput1 INTEGER;
DECLARE hrinput2 INTEGER;
SET logdate = '2013-03-01';
SET hrinput1 = '0';
SET hrinput2 = '1';
WHILE logdate <= '2013-04-01'
DO
--reset parameter values
SET hrinput1 = '0';
SET hrinput2 = '1';
WHILE hrinput2 <=25
DO
SET hrinput1 = hrinput1 + 1;
SET hrinput2 = hrinput2 + 1;
END WHILE;
SET logdate =  logdate + INTERVAL '1' DAY;
END WHILE;
END;
CALL Test ();
 
Cheers :)


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>