10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

System-defined FunctionsName Operand Type ResultTypeDescriptionsin(n)all numeric types andmoneyfloat sine of n;returns a value from -1to 1sqrt(n)all numeric types andmoneyfloatsquare root of nFor trigonometric functions atan(), cos(), and sin(), you must specifyarguments in radians. To convert degrees to radians, use the followingformula:radians = degrees/360 * 2 * piTo obtain a tangent, divide sin() by cos().String FunctionsThe string functions operate on c, char, text, or varchar data.The string functions can be nested to achieve other string functions, forexample:left(right(x.name, size(x.name) - 1), 3)returns the substring of “x.name” from character positions 2 through 4.The following string function:concat(concat(x.lastname, ', '), x.firstname)concatenates “x.lastname” with a comma and a blank and then concatenates“x.firstname” with the first concatenation result. You can also use the +operator to concatenate strings as follows:x.lastname + ', ' + x.firstnameThe following table lists the string functions supported by OpenROAD. Theexpressions c1 and c2 represent the arguments and can be any of the stringtypes, except where noted. The expressions len and nshift represent integerarguments.Nameconcat(c1,c2)ResultTypeanycharacterDescriptionConcatenates one string to another. Theresult size is the sum of the sizes of the54 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!