Consolidated Segment Code Column for MIP Transaction Tables

Home / Consolidated Segment Code Column for MIP Transaction Tables

The chart of accounts (COA) is different for each organization. The COA code segments are expressed as individual columns in the table structure, making it difficult to query based on code values without resorting to dynamic SQL.

A possible solution is, for each table that contains the COA codes, to create a single calculated-persisted column that consolidates the multi-column values into a single delimited column. In this case, the values are consolidated with a caret (^) character. This example determines the formula for the new calculated-persisted field by examining the COA definition in the tblSegmentInfo table, then it creates the new [CodeSequence] column for each target table. The schema is checked to see if the column and its associated index already exist, and if so, it drops them before (re-)creating them. The tables involved only need to be the ones that the integrating application cares about, in this particular case, they are…

  • tblBLTrans – budget detail table
  • tblENTrans – encumbrance detail table
  • tblDLTrans – expense detail table
  • tblGLBLBalance – transaction summary table
  • tblDistCodeDetail – distribution codes, which are named sequences of codes without the GL (0) segment

COA