I have an app that maintains multiple inventories (perhaps better to call it multiple product listings).
I have multiple facilities. Each facility has it's own set of products that are sold.
I have created a Products table with it's own maintanance capabilities ("Product Master Maintenance").
To keep the user from having to maintain a separate products table for every product in every facility, I have a "Product Exceptions Maintenance" function. Most products and products information(fields), are the same for all facilities but often things like price are different per facility.
So the way this works is that when a new product is entered to the product master, it applies to all facilities unless there is an exception for that product, in the exceptions table.
I probably overkilled that explanation!
Anyway, I want to write a view that results in one row per product, with the exception, if any, overwriting the master where applicable. The view would of course only contain one facilities data. Currently I am wtriting the master to a cursor then scan...endscan that cursor and finding, if any, an exception and replacing the master data with the exception data. I just want to simplify this if possible.
My tables: Products, ProdPerFac
The tables are exactly alike except ProdPerFac contains cfacilities_id which relates to Facilities.cid
Any assistance appreciated,
John
I have multiple facilities. Each facility has it's own set of products that are sold.
I have created a Products table with it's own maintanance capabilities ("Product Master Maintenance").
To keep the user from having to maintain a separate products table for every product in every facility, I have a "Product Exceptions Maintenance" function. Most products and products information(fields), are the same for all facilities but often things like price are different per facility.
So the way this works is that when a new product is entered to the product master, it applies to all facilities unless there is an exception for that product, in the exceptions table.
I probably overkilled that explanation!
Anyway, I want to write a view that results in one row per product, with the exception, if any, overwriting the master where applicable. The view would of course only contain one facilities data. Currently I am wtriting the master to a cursor then scan...endscan that cursor and finding, if any, an exception and replacing the master data with the exception data. I just want to simplify this if possible.
My tables: Products, ProdPerFac
The tables are exactly alike except ProdPerFac contains cfacilities_id which relates to Facilities.cid
Any assistance appreciated,
John