Implicit Data Types of Literals

Implicit Data Types of Literals

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

Implicit Data Types of Literals

Literals express values outside of pre-defined application objects. Because literals have no definition in the Object Dictionary, the software assumes a data type for each literal. This implicit data type is determined based on the characters contained in the value, and on whether or not the value is enclosed in quotation marks.

Literals that are enclosed in quotation marks, or that are unquoted but contain letters, are assumed to be character strings. Character strings are always implicitly CHAR.

Unquoted literal values that contain only digits, or digits and a decimal point are assumed to be numbers. Number literals are always implicitly VASTINT.

Constants (literals defined as objects, with names, in the Object Dictionary) can be assigned either the CHAR or VASTINT data type. No other type is permitted. The assigned data type overrides the data type implicit in the value of the constant.

Examples of Implicit Data Types

1234Is implicitly VASTINT.
abcdIs implicitly CHAR.
2.6Is implicitly VASTINT.
a1b2Is implicitly CHAR.
‘1234’Is implicitly CHAR.
‘ abcd’Is implicitly CHAR.
‘-2.6’Is implicitly CHAR.
‘a1b1’Is implicitly CHAR.

See Also

About Conditional Expressions

Conversion Between Data Types

Data Types and Storage of Values

Data Types and the Use of Database Indexes

How To Use Data Types

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish