4D v16.3

Rules for naming tables and fields

Home

 
4D v16.3
Rules for naming tables and fields

Rules for naming tables and fields  


 

 

4D feld and tables names must respect the following rules:

  • The name can contain up to 31 characters.
  • It must start with a letter of the alphabet.   
  • It may contain any combination of letters, numbers, spaces and underscores.
  • The following characters are not allowed in table names (will generate an error in the Structure editor): ( ) + - / * " ; = & | # > < ^ ' { } % DIAMOND (0x00D7), CUBE (0x00B3), SQUARE (0x00B2), PLUS-MINUS (0x00B1)
  • In general, you must avoid any characters that might cause the name to be misinterpreted in 4D or via external languages, such as punctuation marks (commas, colons, etc.)
  • 4D truncates table names that exceed 31 characters and removes any spaces from the beginning or end of the name.
  • Do not use the same name for two visible objects. If you use the same name twice, a warning dialog box will inform you that another visible object already has the same name and that the entry is not possible.
  • Do not use reserved names for naming a table or field. Reserved names include command names (Date, Time, etc), keywords (If, For, etc.) and constants.

Tip: Although it is possible to insert spaces in object names, entering a name with no spaces will allow you, in the Method editor, to select the object by double-clicking directly on it. It is thus generally recommended to use an underscore instead of a space.

Notes:

  • Additional rules must be respected when objects must be handled via SQL: only the characters _0123456789abcdefghijklmnopqrstuvwxyz are accepted, and the name must not include any SQL keywords (command, attribute, etc.). The ”SQL” area of the Inspector palette will warn you if a name does not respect an SQL rule (see Field properties). You can view the SQL reserved words in the Lists area of the Method editor.
  • You must also make sure to use characters that are compatible with JavaScript if you want to access your tables and fields from a Wakanda application by means of a 4D Mobile link (cf. Programming and Writing Conventions in the Wakanda documentation).

 
PROPERTIES 

Product: 4D
Theme: Creating a database structure

 
HISTORY 

 
ARTICLE USAGE

4D Design Reference ( 4D v16)
4D Design Reference ( 4D v16.1)
4D Design Reference ( 4D v16.3)