Hi,
I am interested in opinions on the following,
main(product_id, short_text, price, type)
productTypes(type_id, type)
productTables(type_id, tableName)
productA(product_id, field1, field2)
productB(product_id, field1, field2)
To retrieve all products of type 'A', one must know the table name, in this case 'productA'.
Here is one method.
Create a table that contains the table name that corresponds to each product type, thus the stored procedure only needs to recieve the type_id which can be used to obtain the name of the respective table....and the result of all this would be dynamic SQL, right? I would not recommend it.sql
Monday, March 26, 2012
Product Sub-Typing
Labels:
database,
following,
interested,
microsoft,
mysql,
opinions,
oracle,
price,
product,
product_id,
producttables,
producttypes,
server,
short_text,
sql,
sub-typing,
type,
type_id
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment