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

Translate loop into Teradata Stored Procedure - forum topic by adtrombley

$
0
0

How can I translate the following ms sql to Teradat Stored Procedure?
 

DECLARE @logdate DATETIME  

DECLARE @hrinput1 INTEGER

DECLARE @hrinput2 INTEGER

SET @logdate = '2013-03-01' 

SET @hrinput1 = '0'

SET @hrinput2 = '1'

 

while @logdate <= '2013-04-01' 

BEGIN 

--reset parameter values

set @hrinput1 = '0'

set @hrinput2 = '1' 

while 

@hrinput2 <=25

BEGIN 

print @hrinput1

print @hrinput2

 

 

set @hrinput1 = @hrinput1 + 1

set @hrinput2 = @hrinput2 + 1 

END 

print @logdate

set @logdate = DATEADD(day, 1, @logdate) 

END

 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles