Support > Repository > Primary key option > The prepared pattern
ja | en

I will explain how to use the prepared primary key pattern.

Example of operation

We will explain the key configuration of 0 digit and 6 digits.(Figure 1)

Figure 1 0-filled 6-digit key

Definition method

Prepare the model as shown in Figure 2.Primary key item "ID" is a character string type.(Figure 2)

Figure 2 Definition of report model

Set the primary key as follows.

DesignationContents
orderuse
Start number(Numerical value)
Padding specification of ordinal part0, 6 ("0" packed 6 digits)

Supplement

  • Order can also be applied to string type items.
  • In padding specification, filling characters ("0" in the above example) designate only one character.There is no limit on the number of digits.
Figure 3 Defining order

Example of operation

As a specific example of "arbitrary prefix" + "delimiter" + "automatic numbering", we explain the key structure like "sales report - 001000".(Figure 4)

Figure 4 Prefix + delimiter + auto numbering primary key

Definition method

Set the primary key as follows.

DesignationContents
orderuse
Start number(Numerical value)
pattern[Prefix] [delimiter] [sequence]
prefix(Arbitrary character string)
Delimiter(Arbitrary character string)
Padding specification of ordinal part0, 6 ("0" packed 6 digits)

Supplement

  • Order can also be applied to string type items.
  • More than one character can be specified for prefix and delimiter.
  • In padding specification, filling characters ("0" in the above example) designate only one character.There is no limit on the number of digits.
Figure 5 Defining order

Example of operation

As a concrete example of "date" + "delimiter" + "automatic number assignment", we explain the key composition like "2014-001000".(FIG. 6)

Figure 6 Date + delimiter + auto numbering primary key

Definition method

Set the primary key as follows.

DesignationContents
orderuse
Start number(Numerical value)
patternHeisei ○ ○ [delimiter character] [order]
Flat ○ ○ [delimiter] [order]
H ○ ○ [delimiter] [order]
YYYY [delimiter] [order]
prefix(Arbitrary character string)
Delimiter(Arbitrary character string)
fiscal year(Blank)
Start in April
Padding specification of ordinal part0, 6 ("0" packed 6 digits)

Supplement

  • Order can also be applied to string type items.
  • Patterns can select the prefix "Heisei", "Hei", "H" or four-digit year.
  • If the fiscal year is blank, it will be January to December.Choosing "Start in April" will be from April to March.
  • In padding specification, filling characters ("0" in the above example) designate only one character.There is no limit on the number of digits.
Figure 7 Defining order

Attention on order

The sequence continues to increase monotonically.Even if the year changes, it will not be reset. For example, with the notation "Heisei 26 - 12345" set, the next key will be "Heisei 20 - 12346" if it becomes the following year.

To change the order every year, please create customization code.