Author Topic: Conditional Table Generation for Attributes  (Read 2208 times)

danbosscher

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Conditional Table Generation for Attributes
« on: February 12, 2015, 07:27:59 am »
I'm working on a document template where the properties of element attributes are displayed in a table format (separate table for each attribute). However, not every property that could be defined for each attribute is defined for every attribute, so I'm looking for a way to display each table with only the fields that will be defined.

My first idea was to set up a separate fragment for each field testing whether or not the field would be filled, similar to the following:

Select <Property> from t_attributes where <Property> is not NULL

This however ran into problems when two attributes have the same parent, as they would share the same Object_ID. The problem I kept running into was that all attributes that share a parent would end up in the same table.

I now have it working by defining a list of fragments each with a different possible set of fields defined and am able to get each attribute to then fall through to its appropriate table. However, this has me defining numerous version of the same table, requires more complicated SQL statements and is tedious and inefficient.

More or less, I'm wondering if anyone is aware of or can think of a better/more efficient way of accomplishing this