This is a discussion on computed columns possible in informix? within the Informix forums, part of the Database Server Software category; --> Let's say I have two columns: AmountOne and AmountTwo. I'd like to create a column that is dynamically populated ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Let's say I have two columns: AmountOne and AmountTwo. I'd like to create a column that is dynamically populated called AmountCalc that would subtract AmountOne from AmountTwo. Since either of the two columns can change, AmountRemaining will always be correct. Is this doable in IDS? I am using IDS 9.40 if that makes a difference. I believe in MSSQL Server there is a way to define a column to do this so that you don't have to remember to manually change the AmountRemaining column if one of the other two values gets changed. We are trying to reproduce the same functionality in Informix. |
| |||
| sumGirl wrote: > Let's say I have two columns: AmountOne and AmountTwo. I'd like to > create a column that is dynamically populated called AmountCalc that > would subtract AmountOne from AmountTwo. Since either of the two > columns can change, AmountRemaining will always be correct. Is this > doable in IDS? I am using IDS 9.40 if that makes a difference. > > I believe in MSSQL Server there is a way to define a column to do this > so that you don't have to remember to manually change the > AmountRemaining column if one of the other two values gets changed. We > are trying to reproduce the same functionality in Informix. Use a view. hth Michael |
| |||
| "Michael Krzepkowski" <mkrzepkowski@hotmail.com> wrote in message news:Pfg8d.199356$%S.181424@pd7tw2no... > sumGirl wrote: > > Let's say I have two columns: AmountOne and AmountTwo. I'd like to > > create a column that is dynamically populated called AmountCalc that > > would subtract AmountOne from AmountTwo. Since either of the two > > columns can change, AmountRemaining will always be correct. Is this > > doable in IDS? I am using IDS 9.40 if that makes a difference. > > > > I believe in MSSQL Server there is a way to define a column to do this > > so that you don't have to remember to manually change the > > AmountRemaining column if one of the other two values gets changed. We > > are trying to reproduce the same functionality in Informix. > > Use a view. Or get the old man to do it for you, love. |
| ||||
| Michael Krzepkowski wrote: > sumGirl wrote: > > Let's say I have two columns: AmountOne and AmountTwo. I'd like to > > create a column that is dynamically populated called AmountCalc that > > would subtract AmountOne from AmountTwo. Since either of the two > > columns can change, AmountRemaining will always be correct. Is this > > doable in IDS? I am using IDS 9.40 if that makes a difference. > > > > I believe in MSSQL Server there is a way to define a column to do this > > so that you don't have to remember to manually change the > > AmountRemaining column if one of the other two values gets changed. We > > are trying to reproduce the same functionality in Informix. > > Use a view. A view would be my first choice as well. However, if you need to keep that field for some reason, a quick, simple test with triggers (insert and update) gave me decent results. -- June Hunt |