Hi @samonpress,
>>> I was wondering if its possible to create computed columns within Data Designer module itself?
You could use the Data Designer to add a column to your table and use it to store computed values. Strickly spoken however, computed values can be computed and should as such not be stored I think, although you might have reason to do so.
I guess a view would be more applicable, or a feature in Data Projects and/or the Data Publisher. Unfortunately, both are not (yet) avialable. Sorry! But they are on my to do list… 😉
Best regards,
Peter
Hi Peter!
Looking forward to that feature! For now, can creating a trigger be an alternative solution to this situation?
Actually, I want to save the computed value because the numbers used for calculation will change time to time. However, the computed number which shows up on the day will be our promise to the other party.
I’ve been trying to use this trigger statement which is not going through.
CREATE OR REPLACE TRIGGER grand_trigger
BEFORE INSERT ON termsheet_db
FOR EACH ROW
WHEN INSERTING THEN
INSERT INTO termsheet_db(grand_totalamt) VALUES (NEW.grandtotal_amt+100),
END;
Need help!
Hi @samonpress,
You cannot insert a new row into a table in a before insert trigger. This would create an infinite loop. Try this:
SET NEW.grandtotal_amt= NEW.grandtotal_amt + 100;
Best regards,
Peter