[thelist] comparing multiple values in VBScript

Canfield, Joel JCanfield at PacAdvantage.org
Fri Dec 2 09:43:45 CST 2005


> Can you help me understand why you are using an insert here instead of
> an update? It seems like you have a purpose in mind, but I can't
> figure it out. Why aren't you just updating the original record?

ah; excellent question (Ken's too)

This exact bit is indeed creating a history table, thus the 'insert'
instead of 'update.'

My thoughts in writing only the changed fields to the history table was
that I could re-create the history by simply returning existing fields,
rather than checking at report time to see what fields changed from
record 1 to record 2. So, I'm doing that check at the time of insert
instead of at the time of select.

But, pondering the whole thing: this form *updates* the live fields, and
inserts the history fields. If I did just write everything, every time,
it would shorten and simplify this bit which is done a couple dozen
times a day, and only slightly complicate the reporting on the history,
which is done at most a couple times a week. Less code, less server
load, greater simplicity in the tool we use most. 

It's all incremental benefit, but I think it's the way to go. And since
my current project is to make this page as efficient as possible, you've
both suggested the solution.

Thanks again.

joel



More information about the thelist mailing list