HI, I am not new to Relational DBs but have only just started using Libreoffice Base. More importantly I have not done much with triggers in the past. I have a table that has a Date column, when a new row is inserted I want another column on the same row set to the extracted Month and Year from Date column just added as part of the row insert. (This is to make future querying and reporting easier.)
I have been trying to create this Trigger but I keep getting syntax error messages. I have not been able to find any examples of Create Trigger statements that help much. Can anyone give me some pointers.
Thanks Phil
The mechanics of creating a trigger are dependent on the database being used. Base is not a database it is a database front end development tool. Asking how to make a trigger in Base is meaningless unless you say which type of database you are connecting to. For intstance, MySQL, PostgreSQL, etc.
If you are using a file based system with Base (the embedded HSQL engine, or dBase, for instance) then triggers are not supported.
To follow up on the last comment. From within Base, when used data engine supporting triggers, the way to enter the trigger definition is in the SQL window. Open that from the menu TOOLS → SQL
The actual statement needed would be discussed in the documenation from the database engine vendor.
For the newly supported Firebird engine, when embedded in the Base file, that is found here: Firebird: Firebird RDBMS
Extern MySQL https://dev.mysql.com/doc/refman/5.7/en/trigger-synt