It makes a scan of a table within a MsSQL-Server Database,
(named as "basetable", for the following sentences).
The application does not know this table, before it is installed.)
Creates X tables (depends on how many rows a group have) with the same structure as the basetable has.
Each table gets one datarow of the chosen datagroup(if the groups consist on 3 rows, then 3 tables will be created.
If the groups consist on 4 rows, then 4 tables... So each table will have 1 row of the chosen group)
Creates update and insert SQL-Trigger, between those X new tables
and the basetable.
Creates a view, with those X new tables as datasource, so each datagroup has now
just one row(made for special reasons). This view will have just one row,
if the user has chosen just one group.
It will have 2 rows, if the user has chosen 2 groups.
What was it made for:
This description of a task
(from the perspective of the company which has needed this tool)
is presented here to give a view,
to give an example, about:
We dont expect any special explications, like: a kind of translation from
a colloquial description, to any style for a computer scientist.
First of all:
The application has to be able to do what it has to do, without having any idea
about the database and the structure of the tables inside, not before it is installed and runs.
At the end, during the shut down process, it has to delete all triggers, tables, queries, which it has had created.
The situation was:
A company cares about their articles of their productionline, in common ways,
like a datatable on an SQL-Server.
The articles were always put together to a group, like 3 TableRows for each group, or 4, or 5 etc.
(keep in mind the app. does not know that, before it runs)
The company has made an advertising arrangment, about creating and designing flyers for their
articles, and each flyer has to have the entire group of the chosen article.
Those flyers were supposed to be created and designed with a tool by adobe, like indesign
or illustrator. This tool was able to read in data, but only if each group is available in one row,
within a datatable of the database.
Furthermore the designers have expected to have an option during their working process, to change the articles
(like: name, wight, price etc.)
To supply the data groups, as those tools has needed, a software has to be developed:
create a datatable(s), 3 Tables if each group consist of 3 rows, or 4 if.. or 5 if...
(Keep in mind the app. does not know that, before it runs)
create a view with this 3 or 4 or 5 tables,
if someone opens this view, he will see 1 row, 2 rows, or 3 rows...
(depends on how many groups the User has chosen)
This view-construction will refuse changings, thats why trigger were needed
The process needs to create 3 or 4 or 5 SQL-Trigger....,(one for each table
which were created) between the basetable and those created tables.(keep in mind the app. does not know that,
before it runs)
The process is able to do that, no matter what structure the basetable has, or what number
the group rows have