Populateing a child table based on values in the parent table
I have 2 tables, one called BuildingArea and another called FloorLevel.
In the table BuildingArea theres a numeric field called numfloors that holds a numeric value (lets say 4), based on this numeric value I want to populate the FloorLevel table with the corresponding records Floor 1,Floor 2,Floor 3,Floor 4.
In a script i'd do something like the following..
Declare var $floor
select $floor=numfloors from BuildingArea where record = record from inserted
for $I = 1 to $floor
insert "Floor "+$I into FloorLevel