Creating calculated field behaviour
Posted: Sat Oct 26, 2013 8:59 am
Hi Guys,
Im a FileMaker developer, converting one of my database apps into LiveCode and SQLite. One of the things we have in FileMaker are calculated fields, so if I had a field called price and a field called qty, I can create a calculated field called total_price and put the formula price*qty. Sql doesnt have this feature probably for performance, but whats the best way to replicate this kind of behaviour in LiveCode?
Do I create a standard integer field in my SQLite database and run an update query every time the user focus's out of the price or qty field? Just wondering regarding the integrity of the data, if one update for whatever reason dodnt get published the data will be out of sync.
Another thing I have noticed in my SQL UI (Im using Navicat essentials) is something called Triggers and Queries. I'm wondering whether I should be using these trigger updates, but then these update/trigger when I write to the where as I want the total price displayed when the user is keying in price and qty details.
Whats the best way to approach this, many thanks as always
Jalz
Im a FileMaker developer, converting one of my database apps into LiveCode and SQLite. One of the things we have in FileMaker are calculated fields, so if I had a field called price and a field called qty, I can create a calculated field called total_price and put the formula price*qty. Sql doesnt have this feature probably for performance, but whats the best way to replicate this kind of behaviour in LiveCode?
Do I create a standard integer field in my SQLite database and run an update query every time the user focus's out of the price or qty field? Just wondering regarding the integrity of the data, if one update for whatever reason dodnt get published the data will be out of sync.
Another thing I have noticed in my SQL UI (Im using Navicat essentials) is something called Triggers and Queries. I'm wondering whether I should be using these trigger updates, but then these update/trigger when I write to the where as I want the total price displayed when the user is keying in price and qty details.
Whats the best way to approach this, many thanks as always
Jalz