Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 18 May 2005 @ 08:03:44 GMT


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


Subj:   Calculate TIMESTAMP difference
 
From:   LEE,JAE HYUK

Hi,

I'm trying to find a way to calculate the time difference. For example, in a stored procedure, I've defined as following.

     DECLARE ctime = TIMESTAMP(6);
     SET ctime = CURRENT_TIMESTAMP;

     DELETE FROM table WHERE (INTERVAL '30' SECOND < ctime - c);

The definition for table is following. It's defined in the BTEQ file (Outside of stored procedure)

     CREATE TABLE table(
       a INTEGER,
       c TIMESTAMP(6)
     );

As you can see, the purpose of DELETE clause is to delete the row which is more than 30 seconds old.

For some reason, I get a compile error in DELETE statement.

Please help me finding the solution.


Thank you.



     
  <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: 27 Dec 2016