Field Type Use Recommendations

If you want to define a new field into the LANSA dictionary use this decision tree:

 

All other types are provided for compatibility with non-LANSA database tables. Generally you should avoid using them when defining new fields or columns in new DBMS tables.

Commonly Used Field Types

 

Type

Description

Typical DBMS Storage Type

Maximum Dictionary Definable Length 

Subject to Code Page Conversions

Notes

Useable in RDML or RDMLX Programs

Integer

Integer

INTEGER

4 bytes.

 

Hardware and compiler behaviors may vary.

RDMLX

Packed

Standard decimal number

DECIMAL

RDMLX programs: 63 digits of which up to 63 may be decimals

RDML programs: 30 digits of which up to 9 may be decimals

N/A

 

Both

String

Variable length alphanumeric string with a dictionary defined maximum length.

VARCHAR (variable length)

65535

YES

Not padded with blanks to the dictionary defined maximum length, except that a zero length string has 1 space added.

RDMLX

VarBinary

Exactly the same as String but never subjected to code page conversions.

VARBINARY

32767

NO

Not padded to the dictionary defined maximum length.

RDMLX

NVarChar

Similar to String but data is handled as Unicode. This allows multiple languages to be used at execution time.

NVARCHAR

65535 characters

YES (but only when converted to native String)

 

RDMLX

Alpha

Constant length alphanumeric string with a dictionary defined maximum length.

CHAR (fixed length)

256

YES

Always padded with blanks to the dictionary defined maximum length.  

Both

Date

Date in ISO format: YYYY-MM-DD

 

DATE

N/A

N/A

 

RDMLX

Time

Time is ISO format HH:MM:SS

 

TIME

N/A

N/A

 

RDMLX

DateTime

Date and Time in ISO format YYYY-MM-DD HH:MM:SS[.fffffffff] where the existence and length of the [.fffffffff] portion are definable.  

DATETIME

29

N/A

 

RDMLX

Boolean

True/False

Decimal

N/A

N/A

 

RDMLX

 

 

Specialized Character and Binary Types (useable only in RDMLX programs)

 Type

Description

Typically Stored in a DBMS as

Maximum Dictionary Definable Length 

Typical DBMS Storage length used

Subject to Code Page Conversions

Important

Char

Exactly the same as String, except fixed length and DBMS storage implementation is usually CHAR.

CHAR

65535

Fixed length

YES

 

Binary

Exactly the same as VarBinary but DBMS implementation varies.

BINARY

32767

May be either Fixed or Variable.

NO

Databases that use fixed length column types will pad to the maximum length.

NChar

Exactly the same as NVarChar, except fixed length and DBMS storage implementation is usually NCHAR

NCHAR

65535

Fixed length

YES (but only when converted to native String)

 

CLOB

Character Large

OBject   

CLOB

Undefined

Varies according to content

YES

DBMS performance considerations may apply.

BLOB

Binary

Large

OBject

BLOB

Undefined

Varies according to content

NO

DBMS performance considerations may apply.

 

 

Rarely Used Numeric Types

Type

Description

Typical DBMS storage Type

Maximum Dictionary Definable Length 

When to Use

Important

Useable in RDML or RDMLX Programs

Signed

Signed or Zoned decimal

DECIMAL

RDMLX programs: 63 digits of which up to 63 may be decimals

RDML programs: 30 digits of which up to 9 may be decimals

For programmatic numeric/character overlaying operations.  

Signed is less efficient than Packed or Integer on mathematical operations.

Both

Float

Floating Point

FLOAT

Undefined.

Floating point numbers are approximations, not exact numbers.

When using non-LANSA defined DBMS tables only.

Hardware and compiler behaviors may vary.

RDMLX