Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 04 Nov 2003 @ 22:15:32 GMT


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


Subj:   Nested Cursor
 
From:   Anomy Anom

<-- Anonymously Posted: Tuesday, November 04, 2003 17:11 -->

Hi,

I have cursor C1. After opening the cursor C1, I need to create one more cursor C2 based on the first Fetched record from C1 and then do some process and then close it. Now i need to Fetch the second record from C1 and form the cursor C2 again...

DECLARE C1 CURSOR FOR

select st....;

OPEN C1;
FETCH ;
 while  do

DECLARE C2 CURSOR FOR

select st....;

OPEN C2;
FETCH;
while  do

stmnts;

end while;
CLOSE C2;
end while;

Is it Ok to declare the Inner cursor again and again? or is there any other method do it properly.



     
  <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