Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
sumGirl asked whether IDS 9.40 supports computed columns, like MSSQL, so AmountCalc follows AmountOne and AmountTwo. Michael Krzepkowski suggested a view, and June C. Hunt agreed a view was her first choice. If the column must be kept, June found insert and update triggers gave decent results in a quick test.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
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.
↪ replying to Michael Krzepkowski
June C. Hunt — — source: Usenet: comp.databases.informix
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
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.