Thread: How to approach dynamic status reporting

How to approach dynamic status reporting

From
"James B. Byrne"
Date:
I have a situation whereby edi unit record files from an external
system are read, parsed and loaded into a PostgreSQL database.  As
transmissions relating to each transaction are read a log table
entry is made by transaction for each type of transmission
encountered.  The nature of the external application is such that
the current status of any given transaction is ultimately dependent
upon the contents of the log table entries associated with that
transaction. For example:

Given log entries for transaction X of aa99, bb88, cc77, the current
status of X might be: 'completed'.  However the status of X derived
from log entries of aa99, bb88, cc77, dd66 might be: 'under
revision', while that from log entries aa99, bb88, cc77, dd66, aa99
might be: 'in progress'.

I have that part implemented and, insofar as testing reveals,
working.  My problem is that I now wish to select transactions from
the parent table based upon their derived status values.  I can see
several ways to proceed.  For instance I could store the last
calculated status value as a column on the parent table and then use
a WHERE table.column IN selection.  First, however, I wish to
inquire if this sort of thing crops up elsewhere and, if so, how is
it handled?

Sincerely,

--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3