I asked this earlier but the answer was not very clear. So I am rephrasing the questions.
Setup:
A PROCEDURE has ATTRIBUTES AND COMPONENTS.
An ATTRIBUTE has ELEMENTS
A COMPONENT has ATTRIBUTES and these ATTRIBUTES have ELEMENTS too.
PROCEDURES are stored in the table TB_PROC
PROCEDURE's ATTRIBUTES are stored in the table TB_ATTR
COMPONENTS are stored in the table TB_COMP
COMPONENTS' ATTRIBUTES are stored in TB_COMP_ATTR
Here is the twist:
The elements for each attribute is stored as a column in the attributes' tables. These columns are created dynamically as needed. So if a new attribute is inserted with elements "temperature", "cook time", "hardness", 3 columns will be added to the TB_ATTR temperature, cook time and hardness. Now if another attibute is added with element "Time", again a new column (Time) is added to TB_ATTR.
I want to write a report that will report on a procedure and display all its attributes and elements. How do I do that If I don't know what the columns are going to be? How do I skip over null elements too? Because for the second attribute that contains "time" it does not contain "temperature", "cook time" etc.. and I don't want to display them if they are null.
Thanks for any help.
Setup:
A PROCEDURE has ATTRIBUTES AND COMPONENTS.
An ATTRIBUTE has ELEMENTS
A COMPONENT has ATTRIBUTES and these ATTRIBUTES have ELEMENTS too.
PROCEDURES are stored in the table TB_PROC
PROCEDURE's ATTRIBUTES are stored in the table TB_ATTR
COMPONENTS are stored in the table TB_COMP
COMPONENTS' ATTRIBUTES are stored in TB_COMP_ATTR
Here is the twist:
The elements for each attribute is stored as a column in the attributes' tables. These columns are created dynamically as needed. So if a new attribute is inserted with elements "temperature", "cook time", "hardness", 3 columns will be added to the TB_ATTR temperature, cook time and hardness. Now if another attibute is added with element "Time", again a new column (Time) is added to TB_ATTR.
I want to write a report that will report on a procedure and display all its attributes and elements. How do I do that If I don't know what the columns are going to be? How do I skip over null elements too? Because for the second attribute that contains "time" it does not contain "temperature", "cook time" etc.. and I don't want to display them if they are null.
Thanks for any help.