Beginning with ODBC Driver for Teradata Release 14.10, scalar functions had to be used within escape sequences. This restriction is removed. Scalar functions can be used without escape sequences because Teradata Database natively supports them. In addition, ODBC Driver for Teradata now supports the following scalar functions:
Function Call | Purpose |
---|---|
BIT_LENGTH(s) | Returns the length in bits of the specified string. |
CONCAT(s1,s2[,...sn]) | Concatenates two or more parameter values into a single string. |
CURDATE() | Returns the current date. |
CURTIME() | Returns the current local time. |
DAYOFMONTH(e) | Returns the number of days from the beginning of the month to the specified date. |
DAYOFWEEK(e) | Returns the day of the week on which the specific date falls. |
HOUR(e) | Returns the hour field of the specified time expression. |
LOCATE(s1,s2[,p]) | Returns the position in s2 where the substring s1 starts. |
MINUTE(e) | Returns the minute field of the specified time expression. |
MOD(x1, x2) | Returns the remainder from a division. |
MONTH(e) | Returns the number of months from the beginning of the year to the specified date. |
NOW() | Returns the current date and time. |
SECOND(e) | Returns the second field of the specified time expression. |
UCASE(s) | Returns an equal string, which all lowercase characters convert to uppercase. |
WEEK(e) | Returns the number of weeks from the beginning of the year to the specified date. |
YEAR(e) | Returns the year of the specified date. |
The following functions were updated to support ODBC Driver:
Function Call | Change |
---|---|
CURRENT_DATE() | Can be called with or without parenthesis. |
LENGTH(s) | Supports numeric expressions. |
LTRIM(s) | Operates on numeric expressions. |
RTRIM(s) | Operates on numeric expressions. |
SUBSTRING(s,p[,n]) | Returns a substring of s starting at the position p, optional length n. |
Benefits
- Customers do not have to change existing projects with scalar functions.
- Teradata supports existing scalar functions across all Teradata products and platforms.
Additional Information
For more information, see Teradata Vantage⢠SQL Functions, Expressions, and Predicates, B035-1145.