Results 1 to 4 of 4

Thread: Trigger problem

  1. #1
    Join Date
    Apr 2004
    Posts
    22

    Question Unanswered: Trigger problem

    Hello there !

    I want to create a trigger. The story begins here...

    I have a main table called
    PRODUCT_DIM

    SQL> desc product_dim;
    Name Null? Type
    ------------------------------- -------- ---------------------
    PRODUCT_ID NOT NULL NUMBER
    STYLE_ID NOT NULL NUMBER
    ..............
    ..............
    .............
    DIMENSION_CODE VARCHAR2(4)
    DIMENSION_CODE_DESC VARCHAR2(20)

    This table has millions of rows.

    Another table is DIM_MAP

    SQL> DESC DIMENSION_MAP
    Name Null? Type
    ----------------------------- -------- ---------------
    CRM_DIMENSION NUMBER(2) =====> PK
    CRM_DIMENSION_DESC VARCHAR2(5)
    PMMS_DIMENSION VARCHAR2(4)
    PMMS_DIMENSION_DESC VARCHAR2(20)

    PMMS_DIMENSION in DIM_MAP table matches with
    DIMENSION_CODE in PRODUCT_DIM table.

    I want to create a trigger on PRODUCT_DIM table,
    if any DIMENSION_CODE_DESC for the corresponding value DIMENSION_CODE field gets updated,
    PMMS_DIMENSION_DESC should also get updated with the same value
    for the corresponding PMMS_DIMENSION field.

    **REM: pmms_dimension = dimension_code

    I appreciate all your help in this.

    THANKS MUCH !

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >if any DIMENSION_CODE_DESC for the corresponding value >DIMENSION_CODE field gets updated,
    >PMMS_DIMENSION_DESC should also get updated with the same value
    >for the corresponding PMMS_DIMENSION field.
    bad, bad, bad, bad design.
    Please justify why is it needed/desired to have the description duplicated?
    Have you ever heard about Third Normal Form?
    The "requirement" above violates 3rd NF.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2004
    Posts
    22

    Question

    Quote Originally Posted by anacedent
    >if any DIMENSION_CODE_DESC for the corresponding value >DIMENSION_CODE field gets updated,
    >PMMS_DIMENSION_DESC should also get updated with the same value
    >for the corresponding PMMS_DIMENSION field.
    bad, bad, bad, bad design.
    Please justify why is it needed/desired to have the description duplicated?
    Have you ever heard about Third Normal Form?
    The "requirement" above violates 3rd NF.

    --------------------

    There is nothing much I (as a developer) can do about it !!!
    I just know that they are changing the hierarchy. They wanted new values to fit ..... so crm_dimension and crm_dimension_desc values will be used.

    If you could please help me ... Thanks !!

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    A shovel is a great tool for creating a hole in the ground,
    but only when the "right" end of the shovel comes into contact with the Earth.
    You folks are using the wrong end of the shovel!
    You are wasting CPU cycles and disk space maintaining redundant copies of the description which is 100% unnecessary.
    >they are changing the hierarchy. They wanted new values to fit
    Since "they" insist on this foolishness, then "they" can solve problems of their own making.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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