sturmy31
Forum Replies Created
-
Hi Péter,
Thanks a lot!
I’ll wait the next version with $$NOW$$.
When can we expect this new version ?
Kind regards
RogerHi Peter,
No need to migrate except for this problem, so I’ll may be wait $$NOW$$ !
Don’t forget the possibility to hide mandatory fields in Entry if they have default value defined.
If it’s complicated to see that on table, we can imagine to specify it on the Entry template using $$KEEPACTUALVALUE$$ which means you put something like that:
UPDATE MyTable SET MyTable.MandatoryField = MyTable.MandatoryField
Best regards
RogerIt would be cool to have $$NOW$$ variable to put as Default Value even if the value is set at the load of the page containing form and not when the form is posted.
??
Kind regards
RogerIt would be great to be abble to hide mandatory fields in “Entry” if there is a Default Value defined !
Regards
RogerHi Peter,
Doesn’t work:
create table test_cur_timestamp (date_inserted datetime default current_timestamp
,date_updated datetime default current_timestamp on update current_timestamp)
==> #1067 – Valeur par défaut invalide pour ‘date_inserted’create table test_cur_timestamp (date_inserted datetime default ‘0000-00-00 00:00:00’,
date_updated datetime default current_timestamp on update current_timestamp);
==> #1067 – Valeur par défaut invalide pour ‘date_updated’create table test_cur_timestamp (date_inserted timestamp default current_timestamp
,date_updated datetime default current_timestamp on update current_timestamp)
==> #1067 – Valeur par défaut invalide pour ‘date_updated’create table test_cur_timestamp (date_inserted timestamp default ‘0000-00-00 00:00:00’
,date_updated timestamp default current_timestamp on update current_timestamp)
==> Works ! … but fields must be mandatorycreate table test_cur_timestamp (date_inserted timestamp default current_timestamp
,date_updated timestamp default current_timestamp on update current_timestamp)
==> #1293 – Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clauseIn fact I think you have no problem because you’re using a recent version of MariaDb.
I use Version 5.5.42 !
In forum they say that this problem is corrected in newer versions.
I have no the possibility to migrate…Hi Peter,
Sorry, but after testing it doesn’t work ??
In fact, MySQL doesn’t permit to have more than 1 field of type timestamp (or Datetime) with DEFAULT or “on update” CURRENT_TIMESTAMP in the same table.
Some workaround are discussed here : https://stackoverflow.com/questions/4489548/why-there-can-be-only-one-timestamp-column-with-current-timestamp-in-default-cla
BUT … these solutions are based on Not Null timestamp fields with which you can set to 0 and then have CURRENT_TIMESTAMP set instead.
Having Not Null Timestamp field we can’t hide them on WP DAta Access Forms …Even if I define a template Entry with nullable fields and after set these fields to not null without reconciliate, it doesn’t work (message : “Item CretationDate must be entered”).
I would like to have all DDL defined into WP Data Access, thus no trigger.
Is there a possibility to “force” a not null field to be hidden, and then in that case, to set the field to its current value or to Default for an insert ?
Thank you
Roger- This reply was modified 3 years, 6 months ago by sturmy31.
- This reply was modified 3 years, 6 months ago by sturmy31.
- This reply was modified 3 years, 6 months ago by sturmy31.
- This reply was modified 3 years, 6 months ago by sturmy31.
- This reply was modified 3 years, 6 months ago by sturmy31.
- This reply was modified 3 years, 6 months ago by sturmy31.
Hi Peter,
Thanks for your QUICK answer which solves my problem.
Thank you again for your great job !
RogerComplement ….
Finally I found a solution with the attribute “default current_timestamp on update current_timestamp” on an hidden Timestamp field.
The problem is that it works ONLY if the field is displayed on the creation form (insert only). If the field is hidden, the timestamp is not set while on the update form, the timestamp is set even if the field is hidden.
I qlso tried to put CURRENT_TIMESTAMP as default value on the field in Designer, but still no effect if field is hidden on creation form.