In this article:

String

Integer

Float

DateTime

Blob

Boolean

Date

Decimal

Working with Data Types

Foresight Analytics Platform supports work with the following data types:

String

The String data type is used to present string data.

Each string is a structured array consisting of zero or more Unicode characters.

String values are enclosed in quotation marks: "Any text". If a string contains a quoted text, it should be enclosed in double quotation marks to be visible in the string: "Any text ""Text""".

A string may contain up to 2 Gb of data.

Operations with strings

Allowed size of data values

Integer

The Integer data type is used to present integer numbers (integer values).

Each value occupies 4 bytes of memory and is a 32-bit integer number with a sign in the range from -2147483648 to 2147483647. The size digits 0-31 are used to store the number itself, the size digit 32 is used to store the sign.

Operations with integer numbers

Float

The Float data type is used to present numbers with a floating point (real values).

Each value occupies 8 bytes of memory and is a number with double precision with a floating point and a sign in the range from - 5.0 x 10^-324 to 1.7 x 10^308. To total length of the number is 15 or 16 numbers. Therefore, if the number's integer part contains 4 digits, the fractional part can occupy 11 or 12 digits.

On an attempt to write a number that is longer than 15-16 digits to the value of the Float type, only the first 15-16 digits are saved, the rest is replaced with zeroes.

To specify greater numbers, one can write numbers exponentially: 1 000 000 = 1e6, 0.000015 = 1.5E-5.

NOTE. The Decimal data type is used to present numbers with a higher precision.

Operations with real numbers

DateTime

The DateTime data type is used to store date and time.

Each value is a date and time in the range from 00:00:00 1 of January of 100 year (A.D.) to 23:59:59 31 of December of 9999 year (A.D.).

If the date that is less than the allowed one is specified, the date, to which the current century is added, is automatically formed. For example, when the date 1st of January of 30 year is specified, the date 1st of January of 2030 year is formed.

NOTE. The Date data type is used to store date without time.

Operations with date and time

Blob

The Blob data type is used to present big binary data, for example, images and videos or large text data with the specified encoding.

Each value is an array consisting of zero or more binary or character data.

Value of the Blob type start with the 0h prefix followed by character strings in decimal format without quotation marks, for example, 0h202020, 0h6ABCDEF.

The maximum allowed size of data stored in a value of the Blob type depends on the size of available system memory.

Boolean

The Boolean data type is used to present logical values.

Each value is one of the logical values: True (truth) or False (lie).

Operations with logical values

Date

The Date data type is used to store a date without time.

Each value is a date in the range 1 of January of 100 year (A.D.) to 31 of December of 9999 year (A.D.).

If the date that is less than the allowed one is specified, the date, to which the current century is added, is automatically formed. For example, when the date 1st of January of 30 year is specified, the date 1st of January of 2030 year is formed.

Operations with date

Decimal

The Decimal data type is used to present numbers with a floating point (real numbers) with a high precision.

Each value occupies 16 bytes of memory and is stored as an integer number with a sign and scaled with a variable coefficient as a degree of ten. The scalable multiplier sets the number of decimal places after the point, which changes in the range from 0 to 28.

For the zero scale (decimal fraction is absent) the maximum value by module is +/-79 228 162 514 264 337 593 543 950 335. For 28 decimal places after the point, the greatest value by module is +/-7,9228162514264337593543950335, and the least non-zero value by module is +/-0,0000000000000000000000000001 (+/-1E-28).

Numbers of the Decimal type are presented by means of the m or M suffix: 1.123m, 1.123e10m, 1.123E-10M. Numbers without the suffix are considered as real numbers of the Float type; if they are assigned to the variable of the Decimal type, a type incompatibility error occurs.

NOTE. Data sources, which use the Decimal data type and are created in previous platform versions, may not be supported in later versions. A data source may require to be recreated.

Operations with real numbers of a high precision

See also:

DbDataType