8.1 List of scalar functions
The following table lists all of the scalar functions.
No. |
Category |
Name of scalar function |
Description |
|
---|---|---|---|---|
1 |
Mathematical functions |
Trigonometric functions |
Returns the angle (in radians) that is the inverse cosine of the target data, in the range 0 to . |
|
2 |
Returns the angle (in radians) that is the inverse sine of the target data, in the range -/2 to /2. |
|||
3 |
Returns the angle (in radians) that is the inverse tangent of the target data, in the range -/2 to /2. |
|||
4 |
Returns the angle (in radians) that is the inverse tangent of y/x, in the range - to . |
|||
5 |
Returns the cosine (COS trigonometric function) of the target data, which must be specified in radians. |
|||
6 |
Returns the hyperbolic cosine of the target data. |
|||
7 |
Returns the result of converting the specified angle from radians to degrees. |
|||
8 |
Returns the value of . |
|||
9 |
Returns the result of converting the specified angle from degrees to radians. |
|||
10 |
Returns the sine (SIN trigonometric function) of the target data, which must be specified in radians. |
|||
11 |
Returns the hyperbolic sine of the target data. |
|||
12 |
Returns the tangent (TAN trigonometric function) of the target data, which must be specified in radians. |
|||
13 |
Returns the hyperbolic tangent of the target data. |
|||
14 |
Exponent and logarithm calculations |
Returns the result of raising the base of the natural logarithm to a power. |
||
15 |
Returns the natural logarithm of the target data. |
|||
16 |
Returns the logarithm of the target data (antilogarithm) to the specified base. |
|||
17 |
Returns the result of raising the target data to a specified power. |
|||
18 |
Numerical calculations |
Returns the absolute value of the target data. |
||
19 |
Returns the smallest integer that is equal to or greater than the target data. |
|||
20 |
Returns the greatest integer that is equal to or less than the value of the target data. |
|||
21 |
Returns the remainder after dividing the dividend by the divisor. |
|||
22 |
Returns pseudorandom numbers that follow a uniform distribution and are greater than or equal to the value specified for the minimum value and less than the value specified for the maximum value. |
|||
23 |
Returns pseudorandom numbers that follow a uniform distribution and are greater than or equal to the value specified for the minimum value and less than the value specified for the maximum value. If an SQL statement contains multiple RANDOMCURSOR functions for which the same identification number is specified, those functions always return the same values. |
|||
24 |
Returns pseudorandom numbers that follow a uniform distribution and are greater than or equal to the value specified for the minimum value and less than the value specified for the maximum value. If a query specification contains multiple RANDOMROW functions for which the same identification number is specified, those functions return the same values for each result row of the query specification. |
|||
25 |
Returns pseudorandom numbers that follow a normal distribution with an average μ and a standard deviation σ. |
|||
26 |
Returns the value of the target data rounded to the nth digit after the decimal point. |
|||
27 |
Returns the sign of the target data (+1 for positive, -1 for negative, 0 for 0). |
|||
28 |
Returns the square root of the target data. |
|||
29 |
Returns a value that has been truncated to the specified number of decimal places. |
|||
30 |
Character string functions |
Character string operations |
Concatenates two character string data items. |
|
31 |
Extracts a substring from a character string starting from the beginning (leftmost position) of the character string data. |
|||
32 |
Pads the beginning (left side) of the target data with the padding character string up to the specified number of characters. |
|||
33 |
Removes instances of the specified characters, starting from the beginning of the target character string. |
|||
34 |
Extracts a substring from a character string starting from the end (rightmost position) of the character string data. |
|||
35 |
Pads the end (right side) of the target data with the padding character string up to the specified number of characters. |
|||
36 |
Removes instances of the specified characters, starting from the end of the target character string. |
|||
37 |
Extracts a substring from a character string starting from any position in the character string data. |
|||
38 |
Removes instances of the specified characters from the target character string. The characters can be removed in any of the following ways:
|
|||
39 |
Acquisition of character string information |
Returns whether character strings that meet the search condition expression are included in the target data. |
||
40 |
Searches the target data for a character string and returns the starting position of the string. |
|||
41 |
Returns the number of characters in the target character string. |
|||
42 |
Character substitution |
Replaces any character string in the target data. All instances of the character string to be replaced in the target data are replaced with a replacement character string. |
||
43 |
Replaces any character in the target data. |
|||
44 |
Character string conversion |
Converts uppercase letters (A to Z) to lowercase letters (a to z) in character string data. |
||
45 |
Converts lowercase letters (a to z) to uppercase letters (A to Z) in character string data. |
|||
46 |
Datetime functions |
Returns the difference between the start date and time and the end date and time. |
||
47 |
Returns the day of the week that the specified date falls on. |
|||
48 |
Returns the specified date as the number of days elapsed since January 1 of that year. |
|||
49 |
Extracts a part (year, month, day, hour, minute, or second) from data representing the date and time. |
|||
50 |
Determines a person's age on a reference date given their birth date. |
|||
51 |
Returns the date or datetime of the last day of the month specified in the datetime data. |
|||
52 |
Returns the datetime data rounded to the unit specified in the datetime format. |
|||
53 |
Returns the datetime data truncated to the unit specified in the datetime format. |
|||
54 |
Binary column functions |
Binary data operation |
Concatenates two binary data items. |
|
55 |
Extracts a substring from binary data starting from any position in the binary data. |
|||
56 |
Bit operations |
Returns the bitwise logical AND of two binary data items. |
||
57 |
Returns the value resulting from shifting the bits of a binary data value to the left. |
|||
58 |
Returns the bitwise logical NOT of a binary data item. |
|||
59 |
Returns the bitwise inclusive OR of two binary data items. |
|||
60 |
Returns the value resulting from shifting the bits of a binary data value to the right. |
|||
61 |
Returns the bitwise exclusive OR of two binary data items. |
|||
62 |
Data conversion functions |
Returns the character code of the first character of the target data as an integer value. |
||
63 |
Converts binary data to a binary string representation (character string data consisting of 0 and 1). |
|||
64 |
Converts the data type of the data. |
|||
65 |
Returns the character corresponding to the character code represented by the integer target data. |
|||
66 |
Converts the data type of the data. You can also specify a datetime format or number format to control the conversion.
|
|||
67 |
Converts binary data to a hexadecimal string representation (character string data consisting of 0 to 9, and A to F). |
|||
68 |
NULL evaluation functions |
Evaluates the specified target data items in the order in which they are specified, and then returns the first non-null value. |
||
69 |
||||
70 |
Compares target data 1 to target data 2 and returns NULL if they are equal, or target data 1 if they are not equal. |
|||
71 |
Evaluates the specified target data items in the order in which they are specified, and then returns the first non-null value. |
|||
72 |
Information acquisition functions |
Returns the length of the target data in bytes. |
||
73 |
Comparison functions |
Compares the values in the target data and the comparison data one at a time, and if there is a match, returns the corresponding return value. If no match is found between the target data and comparison data, this function returns the predefined return value. |
||
74 |
Returns the greatest value among the specified target data items. |
|||
75 |
Returns the smallest value among the specified target data items. |
|||
76 |
Compares the values in the target data and in the comparison data one at a time, and, if any value in the target data is less than the value in the comparison data, returns the corresponding return value. If no value in the target data is less than any of the values in the comparison data, this function returns the predefined return value. |