Sample Header Ad - 728x90

How to add a column with computed columns with values of row on Sybase IQ

0 votes
1 answer
1601 views
How to add a computed column to a table referring a field from current row at Sybase IQ 16 Here is want I want to achieve: When inserting a new row (or updating a row) I want to have a column updated based on a function referencing another field. To make an example I've got this table: CREATE TABLE "myTable" ( id integer, sales integer, bonus integer ) Where bonus should be calculated as sales * 10 -- remember, just an example. I was thinking about adding some trigger functions doing this, but then I found computed columns -- unfortunately wasn't able to get this running.
Asked by frlan (495 rep)
Apr 4, 2014, 12:28 PM
Last activity: Apr 7, 2014, 08:57 AM