Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778

    Unanswered: Product Sub-Typing

    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.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    ...and the result of all this would be dynamic SQL, right? I would not recommend it.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •