Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Update trigger for date edited |
Mon, Nov 17 2008 4:44 PM | Permanent Link |
Dale Derix | Using ElevateDB Manager, I've created a trigger to update the DateEdited field with the current date whenever a record is edited (updated). On the General tab, I have Action Time set to "Before", and Type set to "Update". The SQL tab is as follows. BEGIN SET NEWROW.ctDateEdited = CURRENT_TIMESTAMP(); END When I edit a record (by opening the table in the ElevateDB Manager), the value of the DateEdited field does not change. Do I also need to set something in the Columns tab or the Condition tab? I want this trigger to fire anytime anything changes in the record. Thanks. Dale |
Tue, Nov 18 2008 2:53 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dale,
<< Using ElevateDB Manager, I've created a trigger to update the DateEdited field with the current date whenever a record is edited (updated). On the General tab, I have Action Time set to "Before", and Type set to "Update". The SQL tab is as follows. BEGIN SET NEWROW.ctDateEdited = CURRENT_TIMESTAMP(); END When I edit a record (by opening the table in the ElevateDB Manager), the value of the DateEdited field does not change. Do I also need to set something in the Columns tab or the Condition tab? I want this trigger to fire anytime anything changes in the record. >> No, you shouldn't need to do anything else. Could you post the actual SQL that was generated from the SQL History window in the EDB Manager ? (Explorer menu/SQL History item) I tried the same thing here with 2.02 B3: CREATE TRIGGER "TimeStampTest" BEFORE UPDATE ON "customer" BEGIN SET NEWROW.LastInvoiceDate = CURRENT_TIMESTAMP(); END and it works fine. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Nov 18 2008 3:46 PM | Permanent Link |
Dale Derix | <<No, you shouldn't need to do anything else. Could you post the actual SQL that was generated from the SQL History window in the EDB Manager ? (Explorer menu/SQL History item)>> ALTER TRIGGER "OnUpdate" BEFORE UPDATE ON "Contacts" BEGIN SET NEWROW.ctDateEdited = CURRENT_TIMESTAMP(); END I'm still using the Trial version, which is 2.02 Build 2. Thanks, Dale |
Tue, Nov 18 2008 5:20 PM | Permanent Link |
Dale Derix | I'm sorry Tim. It seems to be working now. I hope I didn't waste too much of your time. Dale |
Wed, Nov 19 2008 2:22 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Dale,
<< I'm sorry Tim. It seems to be working now. I hope I didn't waste too much of your time. >> You owe me 30 seconds. I'm glad that it's working okay for you now. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |