Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 23 Jan 2010 @ 00:39:41 GMT


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


Subj:   BITAND function
 
From:   Kalki, Santosh

Folks,

I need help with a UDF that performs BITAND operation on a decimal integer.

For example

(0,1,1,0,0,0,0) decimal equivalent of this is integer 48. Now is there a UDF that takes a decimal and identifies which bit has been set. In this example of 7 bits bit 5 & 6 have been set.

     select
     bitand(48,64)
     ,bitand(48,32)
     ,bitand(48,16)
     ,bitand(48,8)
     ,bitand(48,4)
     ,bitand(48,2)
     ,bitand(48,1);

should yield non zero number for 32 & 16.

Thanks and appreciate your help.



     
  <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