Edit Table Construct


You can edit and save the tables used by HMI in "Table".

The table here is a table that exists in the database.

On this screen, you can edit the column settings (hereafter column setting) of the selected table.

The maximum number of columns is 256.


Contents

  • Table setting
  • Edit Table Data
  • Add Column
  • Aband Modification
  • Colums
  • Save as CSV File
  • Cancel
  • Save Construct
  • Save and Exit
  • About the table to be created

  • Table Setting

    This displays the screen of Table setting.

    Edit Table Data

    This displays the screen of Edit Table Data.


    Add Column

    Click "Add column" to add one column of editing area.

    At this stage, the editing has not been reflected in the table yet.


    Aband Modification

    This obtains the column settings of the currently saved table. Any editing contents that have not been saved until then will be discarded.

    If an error occurs during editing, it is recommended that you discard the editing once and check the saved column settings.


    Columns

    Operation

    Click the button to save the editing of the selected column.

    Click the button to delete the column from the editing screen. This editing will not be saved unless you press "Save Construct".

    Column Name

    You can change the column name by clicking on the name part. Names should be set with lowercase alphabet letters and numeric number except special letters such as "double quotation" and 'single quotation', and some reserved letters.

    Also, do not create columns with the same names.

    Comment

    Set comments for each column. The comment can be displayed by the table component of the HMI.

    Set the comment like“jp:XXX,en:XXX,zh:XXX”for multiple language. Table component of HMI can display the comment of the current selected language.

    Type

    This specifies the data type of the column.

    You can change the data type of the set column.(Type conversion hereafter)

    There are seven data types that can be set as follows: "Boolean ", "Integer", "Real", "String", "Date", "Time", and "Date-Time". Each corresponds to "boolean","int","float","text","date","time", and "timestamp" respectively.

    Invalid type conversion cannot be saved.

    For the correctness of type conversion, see the Data Type table below.

    Data Types
    Original Can be converted Can be converted but cannot be preserved Cannot be converted
    BooleanStringNumeric value Real, Date, Time, Date-Time
    IntegerReal, StringBooleanDate, Time, Date-Time
    RealStringIntegerBoolean, Date, Time, Date-Time
    StringBoolean, Numeric value, Real, Date *1NoneNone
    DateString, Date-TimeNoneReal, Integer, Real, Date, Date-Time
    TimeStringNoneReal, Integer, Real, Date, Date-Time
    Date-TimeStringDate, TimeBoolean, Integer, Real

    *1 When you convert strings, all numeric values stored in the table must match the format type of the conversing destination.

    Attribute

    You can change the attributes of a column.

    "Eigenvalue" means that there is no same value in other records. If this setting is enabled, creating of records with the same value in that column is prohibited. But NULL is an exception. The UNIQUE constraint is given.

    "Primary key" is used to individually determine the records on the table. When "Primary key" is enabled here, it indicates that the combination with "_id _" is unique. Also, NULL cannot be entered. For details, please refer to About the table to be created. PRIMARY constraints is given.

    Default Value

    This sets default values for each column.

    The default value is the value inserted when adding a new record to the table when there is no specification in the value.

    Changing this value will not change the value of a record that already exists.

    When a new column is added, the default value set here will be inserted in all records.

    Null cannot be set as the default value. Value must be set.

    You can set "now ()" as the default value of time-related columns. "now ()" indicates the current time.

    Save as CSV File

    This downloads the saved table in CSV format.

    We encourage you to save the csv file as a backup when deleting the table, deleting the record of the table, or converting a type that is not recommended.

    Cancel

    This moves from the page currently being edited to the list page of the table.

    Any unsaved edits will be discarded.

    Save Construct

    This saves the page currently being edited. A warning message might be displayed according to the contents of Column "Type" or the changes of "Attribute".

    When the warning appears, check the contents. When you are certain that there is no problem, click "execute regardless". If you want to delete the record saved in the table first and execute, click "delete and execute". To cancel, click "Cancel" button or X button on the screen.

    We encourage you to save the csv file as a backup when performing "execute regardless" or "delete and execute".

    Save and Exit

    This saves the page currently being edited. As with "Save Construct ", a warning message might be displayed according to the contents of Column "Type" or the changes of "Attribute".

    When the warning appears, check the contents. When you are certain that there is no problem, click "execute regardless". If you want to delete the record saved in the table first and execute, click "delete and execute". To cancel, click "Cancel" button or X button on the screen.

    We encourage you to save the csv file as a backup when performing "execute regardless" or "delete and execute".

    When saving is finished, the screen returns to the list of tables.


    About the table to be created

    The table created here has the following properties.

    "_id _" and "_timestamp _" are automatically added to the column

    "_id _", "_ timestamp _" are created to guarantee the function of "table".

    "_id_" is used for Edit Table so that change of one record does not affect multiple records.

    "_id_" is an integer sequential number and is set as the primary key.

    When operating the value of "_id_", it is recommended that you set other columns as primary key.

    "_timestamp_" is used for Data limitation, and saves the time when updating and adding to records are executed.

    "_timestamp_" is Date-Time (timestamp with time zone) and the default value is "now ()".

    Also, when updating records in the "Query" table, "_ timestamp _" is also updated to the current time unless otherwise specified.

    These two can be used by "Query" , however, avoid changing the value in "Query" intentionally as much as possible. This could cause an error you might not have considered in "Table".

    Null cannot be used in the value when creating table

    When adding columns, editing records, updating and adding with "query", default values are used instead of null.

    This is due to the inability to display null in the HMI.

    Therefore, setting default values in each column is necessary.

    It does not mean that null cannot be used in the table. (Not all columns are NULL constrained).