convert-type( value a, type b, mask c )
Group |
Converts the data type of value a into the data type b. Additionally, you can set parameter c which describes the mask of the input value. If the type name is not supported, the function will stop with an error.
Valid values for b are
String
Integer
Double
Date
Boolean
Timestamp
Float
BigDecimal
BigInteger
Blob
The names can be used case-insensitive. This function can be used for the preparation of type sensitives comparisons of two values using one of the 'equals' functions or be used for 'goto' functions. The return value of the function is the converted value.
Description of Parameters
Parameter |
Description |
a |
Value to be converted. |
b |
Name of the data type. |
c |
Format (template) of the input value. |
Examples
Parameter a |
Parameter b |
Parameter c |
Result |
Remark |
String: 100 |
integer |
Integer: 100 |
||
String: 100,00 |
double |
####0,00 |
Double: 100.0 |
|
String: text |
biginteger |
BigInteger: 0 |
||
String: 13.12.2011 12:34:56 |
timestamp |
dd.MM.yyyy hh:mm:ss |
Timestamp: 2011-12-13 12:34:56 |
|
String: 2011-12-13 |
timestamp |
Timestamp: 2011-12-13 00:00:00.0 |
||
String: 2011-12-13 12:34:56 |
date |
Date: 2011-12-13 |
||
String: text |
timestamp |
Timestamp: 1970-01-01 00:00:00.0 |
The Empty Flag is not set. |
|
BigInteger: 1319106879766 |
integer |
Integer: 551919894 |
Integer is not able to represent a number that big leading to information loss. |
|
BigInteger: 1319106879766 |
date |
Date: 2011-10-20 |
The number is interpreted as Unix time. |
|
BigInteger: 1319106879766 |
timestamp |
Date: 2011-10-20 12:34:39.766 |
The number is interpreted as Unix time. |