Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 01 Apr 2008 @ 11:13:48 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: FOR cursor in teradata
 
From:   Rapuru, Syamala

Hi,

Please do the following modifications to the test case and it works.

1) Remove semicolon after SELECT statement

2) Use 'END FOR' instead of 'END LOOP'.

     FOR REC AS test CURSOR FOR
     SELECT DISTINCT column_name1
     FROM table_name1
     WHERE column_name2= 'Y'
     GROUP BY column_name1
     HAVING COUNT(*)>1
     DO
     SET variable1 = REC.column_name1;
     Rest of select and update statements
     END FOR;

Thanks

Syamala



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023