No announcement yet.

How to enter function values in tables ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to enter function values in tables ?

    I need to insert often current date values in my tables, such as CURRENT-DATE, CURRENT-TIME. How to do that in the table grid o form views ?
    It works when you do write the INSERT statement in SQL, but not from the table editing view.
    I tried siwtching to raw mode, to no avail. (BTW, whats the use of the Raw mode while editing a table ?)

  • #2
    You can try to employ the Raw Edit feature and type the function on the cell directly, e.g. PASSWORD('123abc'). Open the table, choose View > Raw Mode.


    • #3
      Thank for this helpful information. The following Navicat 11 Help info was in my opinion also helpful.

      Manipulating Raw Data Navicat normally recognize what user has input in grid as normal string, any special characters or functions would be processed as plain text (that is, its functionality would be skipped).
      Editing data in Raw Mode provides an ease and direct method to apply server built-in function. To access the Raw Mode function, control-click a field and select Raw from the pop-up menu.
      Note: Available only for MySQL, PostgreSQL, SQLite, SQL Server and MariaDB. (see also photo 1)

      I could however not find a method to add a timestamp by default for fields I assign to contain this information.

      Do you know a way to add this timestamp by default?

      If I place:


      as default value then I get the message: Error
      near "(": syntax error

      Thank you in advance for your help.

      Last edited by NavicatUserSqlite; 08-23-2014, 05:14 PM.


      • #4
        I think I found the answer....

        Instead of writing datetime()

        one needs to add parentheses (if you want the date and time by default)