Column naming convention
Each column in the LN data dictionary corresponds to one or more columns in an Oracle table.
The rules for column names are:
- General:
If you create an LN column name in Oracle, the column name is preceded by the string
t$
. For example, the LN column with the namecpac
is created in Oracle with the namet$cpac
. To avoid reserved words, you can precede column names witht$
. If a column name contains a period, the period is replaced by a dollar sign. - When the Multi language
Application Data feature is enabled, column names preceded by the string
t$$
are generated by the database driver. - Long string columns:
LN columns of type String can exceed the maximum length of character columns in Oracle.
The maximum length depends on the version of Oracle and the Oracle data type you use.
In Oracle 11g and 12c, the Oracle data type CHAR has a limit of 2,000 characters. If an LN string column exceeds this limit, the column is split into segments with up to 2,000 characters each. The first 2,000 characters are placed in a column in which the name of the column is extended with
#1
. The next 2,000 characters are placed in a column with a name extended with#2
, and so on until all the characters of the string are placed in a column.The Oracle data type VARCHAR2 has a limit of 4000 characters.
For example, if an LN string column called
desc
contains 2,500 characters, these two Oracle columns are created in Oracle:-
t$desc#1
: size 2000 -
t$desc#2
: size 500
-
- Array columns:
In the LN data dictionary, you can define array columns; an array column is a column with multiple elements in the column. The number of elements is called the depth. For example, you can define a column that contains a date as an array of three elements: a day, a month, and a year. In Oracle, the three elements of the array column are placed in separate columns. The names of these columns include a suffix with the element number. For example, an array column
date
becomes:-
t$date$1
: Element 1 -
t$date$2
: Element 2 -
t$date$3
: Element 3
Note: If the element is of type String, and one element type exceeds the maximum Oracle character size, the element is split, such as:-
t$str$1#1
: Element 1, part 1. -
t$str$1#2
: Element 1, part 2.
-
- Array compression:
The maximum number of Oracle columns is limited. If the number of LN columns exceeds the maximum number of Oracle columns, the database driver tries to compress (join) array columns to reduce the number of columns. All array elements of one array column are stored as one column in the Oracle database with the elements concatenated in binary format (Oracle data type RAW). To start, the driver compresses the array column that yields the highest number of columns. The driver continues to compress array columns until the number of columns is less than the maximum number of columns.
The name of the compressed column in Oracle follows the same convention used for the other columns, such as:
-
t$array
: Contains all elements of the compressed column.
Note: If a compressed array column exceeds the maximum length of a RAW Oracle column, the column is split into segments, as previously described. -