xml datatype
-
i am designing a database for inventory the field requirements vary a lot depending on the product nature? The fields for Digital Cameras (number of pixels, maximum zoom, type of storage) would be very different from say, Hard Disks (capacity, interface type, speed, form-factor). i hav a tables with the shema product proid int prodname varchar proattribute xml catid int category catid int catname vachar prodincatattribut (xsd) how can i be to able to store the attribute for a category of product as prodincatattribut (.xsd) as define by user . and ties the proattribute(xml) to it. so that users can only put the values of this attribute or any other better design approach will be appriciate
-
i am designing a database for inventory the field requirements vary a lot depending on the product nature? The fields for Digital Cameras (number of pixels, maximum zoom, type of storage) would be very different from say, Hard Disks (capacity, interface type, speed, form-factor). i hav a tables with the shema product proid int prodname varchar proattribute xml catid int category catid int catname vachar prodincatattribut (xsd) how can i be to able to store the attribute for a category of product as prodincatattribut (.xsd) as define by user . and ties the proattribute(xml) to it. so that users can only put the values of this attribute or any other better design approach will be appriciate
Think templates. Each product category should get it's own attribute template. By assigning a category to a certain product, the product will also get that category's attribute template.
My advice is free, and you may get what you paid for.
-
Think templates. Each product category should get it's own attribute template. By assigning a category to a certain product, the product will also get that category's attribute template.
My advice is free, and you may get what you paid for.
-
Ebube wrote:
The fields for Digital Cameras (number of pixels, maximum zoom, type of storage) would be very different from say, Hard Disks (capacity, interface type, speed, form-factor)
Like you said, each product type (= category) has it's own attributes. So you create one xml template (xsd) per category. Then you have a choice, you can save the templates with unique names in a folder, and save the names to the Categories table, or you can try and save the entire file as a blob, or bits to the database (I would go with the first option). Then when a new product is entered into the system, you create a new xml file based on the correct attribute template, based on the category the user chooses for the product.
My advice is free, and you may get what you paid for.