Posted by --CELKO-- on 12/05/06 19:27
>> I have an instead of trigger for update on particular table which adds 3 or so columns and puts the total in a 4th <<
The quick, stinking dirty kludge is to use COALESCE() in your
computation.
The *right* answer is that good SQL programmers avoid triggers
(procedural code!! UGH!) and do not store redundant data in a table.
What you have re-discovered is the right-most column of a punch card in
a 1950's EDP system and mimiced it in SQL!! That is where we always
stored totals and the un-punched columns were read as a zero by the EAM
(google it!).
Your whole approach to SQL is totally wrong. Stop what you are doing
and get some minimal education. Look at using a VIEW that will always
be correct.
Navigation:
[Reply to this message]
|