Create a Trigger in Sequel Pro 1.1.2

已查看 450 次
跳至第一个未读帖子

Keith Kaiser

未读,
2016年7月25日 21:47:212016/7/25
收件人 Sequel Pro
I have a simple table of only a few columns. One of the columns is DOL (Date of Launch) another is DOR (Date of Recovery). I would like to write a trigger that activates when both of these fields are update, or a new record is inserted that calculates the number of days between the two date fields.

Currently i run a simple query;

UPDATE longestRecovery set record = DATEDIFF(DOR, DOL) 

To do the work. But it seems to me I should be able to update the 'record' value with a trigger.

I've tried a number of things; I usually name it Calculate Record, Action time is set to 'After' and Event to 'Insert. But I've tried a number of combinations with no luck.

When I click 'Add' I get:

Error creating trigger
The specified trigger was unable to be created.

MySQL said: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

or I might get:

MySQL said: Unknown system variable 'record'

Can someone tell me how to do this please?
回复全部
回复作者
转发
0 个新帖子