Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 03 Jan 2006 @ 16:01:48 GMT


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


Subj:   Handling a 64 bit ID
 
From:   Coffing Christopher

A-Team

We are trying to determine how to best handle a requirement to support a 64-bit ID in Teradata.

I just wanted to bounce something off of you to see if you concur. The project has a requirement for a 64-bit number as the ID for each of the tables (A 32-bit value from a Source seed and a 32-bit value from another Source seed). This is my problem, Teradata doesn't support 64-bit numbers and a double looses precision (I think 56-bits plus 8 for exponent in IEEE definition).

Is the only way to support this is to produce a two part key of two integers, then the external 64-bit client multiplies the numbers together and reports the value to the User?

     create table big_int (

     int1 integer,

     int2 integer,

     double3 double) ;


     insert into big_int

     (2147483647, 2147483647, null);


     update big_int set double3 = cast(int1 as double precision) * cast(int2
     as double precision) ;


     select * from big_int

     where double3 = cast(int1 as double precision) * cast(int2 as double precision) ;


     select * from big_int where double3 = cast(4611686014132420609 as double);


     select * from big_int where double3 = 4611686014132420609;

Any assistance is greatly appreciated.

Chris Coffing



     
  <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