Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 24 Jun 2015 @ 14:13:33 GMT


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


Subj:   Re: odbc sql extensions vs teradata sql extensions
 
From:   Dempsey, Mike

Many of the ODBC functions also exist in Teradata SQL. Virtually all the numeric functions exist, and many of the string functions (see below) (These all exist in Teradata 15.0 and above. A few may not exist before that.)

     ODBC            Teradata
     -----------     --------------
     ASCII           ASCII
     CHAR            CHR
     CONCAT          str1 || str2
     DIFFERENCE      CAST(SUBSTR(SOUNDEX(str1),2) AS INT) -
                             CAST(SUBSTR(SOUNDEX(str2),2) AS INT)
     INSERT          have to use sub-string and concat
     LCASE           LOWER
     LEFT            LEFT
     LENGTH          LENGTH
     LOCATE          INSTR
     LTRIM           LTRIM
     REPEAT          n/a
     REPLACE         OREPLACE
     RIGHT           RIGHT
     RTRIM           RTRIM
     SOUNDEX         SOUNDEX
     SPACE           RPAD('', n)
     SUBSTRING       SUBSTR or  SUBSTRING(str, FROM n FOR m)
     UCASE           UPPER

The EXTRACT() function is used to replace many of the ODBC Date/Time functions. We also have CURRENT_DATE, CURRENT_TIME (these are treated like variables - no () on the end) For TimestampAdd() you would use Interval arithmetic on the columns themselves.

If you are using a recent version of SQL Assistant you can get additional information (a brief description) by typing a function name and then hovering over it with the mouse.

(The 'Display Quick Info Tips' option on the Code Editor tab of options must be checked for this to work.) You can also include all built-in function names in the drop down lists that appear while typing your SQL by checking 'Display Suggestions' and 'Include built-in functions' on the same options tab.


Mike Dempsey



     
  <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