Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 29 Aug 2003 @ 12:57:37 GMT


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


Subj:   Re: ON CHAR(19)=DEC(18,0)
 
From:   Geoffrey Rommel

  In fact, an explain (when d1 is dec(16,0) or less) shows that c1 is casted to float with a format literal. It seems that DEC(x.0) with x>16 makes the parser create a format literal that is rejected by the code creator later.  



I would ask the GSC about this, but here's my two cents. When comparing character columns to numeric, the optimizer has to convert them to compatible numeric data types. Since, generally speaking, it doesn't know what to expect in character columns, the preferred conversion is to float -- but then the decimal(18) column has to be converted to float also. A decimal(18) column has 63 bits of precision and therefore cannot be converted to a float (which has only 52 bits of precision). Apparently the optimizer recognizes this and refuses even to generate a parse tree; thus, you are getting no output from "explain".



     
  <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