Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Aug 2001 @ 13:07:33 GMT


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


Subj:   Re: Integer vs Character PI
 
From:   Geoffrey Rommel

Dieter N�th wrote:

  - When you join, are you including any literals? Character literals are stored as VARCHAR, not CHAR. For instance, if you have a char(10) column that includes 'TAIWAN ', the following expressions:  


  hashrow(char10_column)
hashrow('TAIWAN ')
 


  do NOT return the same value, because the first is fixed and the second is variable.  


  Again, which release are you talking about? HASHROW always returns the same RowHash.  



Well, no, it doesn't. Really. Honestly. Literals are different, although I may have been wrong in stating that it was because they were VARCHAR rather than CHAR.

This has been true for many years, but for the record, my system is:

RELEASE V2R.04.00.02.10
VERSION 04.00.02.25

show table lcidba.hasher;

CREATE SET TABLE lcidba.hasher ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL
     (
      char01 CHAR(7) CHARACTER SET LATIN NOT CASESPECIFIC,
      vch02 VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC)
UNIQUE PRIMARY INDEX ( char01 );

+---------+---------+---------+---------+---------+---------+---------+

select * from lcidba.hasher;

 *** Query completed. One row found. 2 columns returned.

char01   vch02
-------  --------------------
0004132  0004132

+---------+---------+---------+---------+---------+---------+---------+

select hashrow(char01), hashrow(vch02)
 from lcidba.hasher;

 *** Query completed. One row found. 2 columns returned.

HASHROW(char01)  HASHROW(vch02)
---------------  --------------
AFAA4CD8         AFAA4CD8

+---------+---------+---------+---------+---------+---------+---------+

select hashrow('0004132');

 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 1 second.

HASHROW('0004132')
------------------
F519A34B


     
  <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