Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Fri, 29 Oct 2004 @ 06:23:46 GMT





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




Subj:   Re: ASCII function: Return ASCII value of the number
 
From:   Dennis Calkins



Maybe I read this Post backwards. Are you trying to

     take 65 and make an "A"    or
     take an "A"  and Make a 65 ?

My last post did the Later. You can chnage that around by....

An CHR UDF would be pretty simple ( agina if you are 5.1 or later )

     #define SQL_TEXT Latin_Text
     #include "sqltypes_td.h"

     void CHR( INTEGER *value,
               CHARCATER_LATIN *result[2],
               char sqlstate[6])
     {
          /* put the parameters in a couple locals */
           result[0] = (*value & 0xFF);
           result[1] = '\0';

          return;
     }


     CREATE FUNCTION CHR (I INTEGER )
     RETURNS CHAR(1) CHARACTER SET LATIN
     =85 ;




     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008