Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 28 Apr 2003 @ 13:16:52 GMT


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


Subj:   Re: Moving through Cursor in Stored Procedure
 
From:   Dieter N�th

Joseph Massena wrote:

  This is my first time using the List Server Teradata User Group and I was wondering if anyone can help me out. In Stored Procedures, is there a way to move though the Cursor to compare one row with the next row. I've been studying the Chapter 4 of the SQL Reference Volume 6 and I see the "WHERE CURRENT OF", but nothing showing if moving through the cursor is doable.  


  I am trying to place the first row of the cursor into a previous row variable and compare it to the next row. if they are the same I would like to delete the previous row information from another table. Now if the next row is different I would place it in the previous row variable and continue to load the next row and compare it to the new previous row variable again.  



A much faster way than a cursor is probably using OLAP-functions. So please post more info about tables used etc.


Dieter



     
  <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