Hello. I am using LibreOffice Base 7.5 (Firebird Embedded) on a Windows 10 Desktop (64-bit).
.
I created a new database using Firebird Embedded (instead of my previous use of HSQLDB). I need to update two fields with the current date:
.
Table: tblProjects
- fldCreationDate - the date the record was created.
- fldModifyDate - the date the record was modified.
.
I was advised that a “Trigger” would actually work better with a Firebird Embedded database.
.
@Ratslinger kindly provided a sample demo that did EXACTLY what I wanted (Need Date fields that automatically insert the date that record was created and updated - #12 by Ratslinger), BUT he said he used the following code from @mariosv to create these two fields when the Table was FIRST CREATED:
create table MyData (
id int not null primary key,
record_created timestamp default current_timestamp,
...
)
.
MY QUESTIONS:
-
My table is ALREADY created with many fields… so should I delete only these two fields and recreate the two fields using the code?
-
If I must start over, is the following the correct code for my particular situation:
create table "tblProjects" (
id int not null primary key,
"fldCreationDate" timestamp default current_timestamp,
"fldModifyDate" timestamp default current_timestamp
)
.
- I assume that I will enter the above code in Tools > SQL (Command to Execute)?
. - Is there any way to view the SQL commands that have already been entered previously? I tried to view the code that was used in the FirebirdTriggerSample.odb demo that @Ratslinger used… but couldn’t figure out how to see it.
THANKS for any help at all…