13.07.2015 Views

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Supported Functions6.1.67 STRSTR(num,[length[,precision]])Returns a string of length characters. If the integer length is equal to or greater than the number of characters in the numericnum (including decimal point and sign characters), STR returns num converted to a string and padded with leading blanksto make the resulting string of length characters.If the optional integer precision is specified, num is truncated to the specified number of decimal digits before string conversion.If precision is omitted, num is truncated to its integer portion. If precision is larger than the number of decimaldigits, num is padded with trailing zeros before string conversion.If length is omitted, it defaults to 10. If length is less than the number of characters in num (after adjustment by precision)a dummy string consisting of all asterisks of length number of characters is returned.6.1.68 STUFFSTUFF(string,start,length,replace)Returns string with length number of characters removed and the replace string inserted. The point of removal and insertionis specified by the start integer, counting from the beginning of string. If length is 0, no characters are removed. If replaceis the empty string, no characters are inserted.If start is greater than the number of characters in string, no value is returned. If start is 1, length number of characters areremoved from the beginning of string and the replace string inserted. If start is 0, length minus 1 number of characters areremoved from the beginning of string and the replace string inserted.If length is greater than or equal to the number of characters in string, the replace string is returned. The replace stringlength is not limited by the length of string or length.6.1.69 SUBSTRINGSUBSTRING(string,start,length)Returns a substring of string beginning at the location start for the length number of characters. If start is greater than thelength of string, or if length is 0, no string is returned.6.1.70 SUMSUM(numfield)SUM(DISTINCT numfield)Aggregate function: used in a query to return the sum of the values in the numfield column. For example:SELECT SUM(Age) FROM Sample.PersonSUM(DISTINCT numfield) sums the unique values in the field column. Fields with NULL are ignored.<strong>Caché</strong> <strong>Transact</strong>-<strong>SQL</strong> (T<strong>SQL</strong>) <strong>Migration</strong> <strong>Guide</strong> 49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!