Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 20 Apr 2004 @ 12:54:16 GMT


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


Subj:   Why does teradata accept 61.999999 seconds as the max value in time stamp
 
From:   Naresh_Kumar

Per teradata documentation,

TimeStamp (YYYY-MM-DD hh:mi:ss.ssssss)

The string ss.ssssss represents seconds.

The valid range for the first two digits is 00-59. You must specify both digits. You can specify from one to six factional digits.


But, here what terdata does:-

     show table ts;
     show table ts;
      *** Text of DDL statement returned.
      *** Total elapsed time was 1 second.
     ------------------------------------------------------------------------
     ---
     CREATE SET TABLE WEEKLY.ts ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           ts TIMESTAMP(6))
     PRIMARY INDEX ( ts );


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     insert into ts (ts) values ( cast('1998-11-23 15:30:23' as timestamp));
     insert into ts (ts) values ( cast('1998-11-23 15:30:23' as timestamp));
      *** Insert completed. One row added.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     insert into ts (ts) values ( cast('1998-11-23 15:30:61' as timestamp));
     insert into ts (ts) values ( cast('1998-11-23 15:30:61' as timestamp));
      *** Insert completed. One row added.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     sel * from ts;
     sel * from ts;
      *** Query completed. 2 rows found. One column returned.
      *** Total elapsed time was 1 second.
                             ts
     --------------------------
     1998-11-23 15:30:23.000000
     1998-11-23 15:30:61.000000
      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     insert into ts (ts) values ( cast('1998-11-23 15:30:62' as timestamp));
     insert into ts (ts) values ( cast('1998-11-23 15:30:62' as timestamp));
      *** Failure 6760 Invalid timestamp.
                     Statement# 1, Info =0
      *** Total elapsed time was 1 second.
      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     insert into ts (ts) values ( cast('1998-11-23 15:30:61.999999' as
     timestamp));
     insert into ts (ts) values ( cast('1998-11-23 15:30:61.999999' as
     timestamp
     ));
      *** Insert completed. One row added.
      *** Total elapsed time was 1 second.


      BTEQ -- Enter your DBC/SQL request or BTEQ command:
     sel * from ts;
     sel * from ts;
      *** Query completed. 3 rows found. One column returned.
      *** Total elapsed time was 1 second.
                             ts
     --------------------------
     1998-11-23 15:30:23.000000
     1998-11-23 15:30:61.999999
     1998-11-23 15:30:61.000000

-Naresh



     
  <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