Results 1 to 3 of 3

Thread: sql procedure

  1. #1
    Join Date
    Jul 2003
    Location
    porto - Portugal
    Posts
    74

    Unanswered: sql procedure

    Hi people,

    I have to build this table(LINE) and the key must be build with style_id
    and colour id but the problem is that they can't have duplicates values but they have..so what can i do?...my key really have to be (style_id, colour_id).

    Someone could help me?


    CREATE TABLE BASEREFT.LINE(
    "DESC_LINE" CHAR(35),
    "CO_ID" SMALLINT ,
    "DIV_ID" SMALLINT WITH DEFAULT 9999,
    "DPT_ID" SMALLINT WITH DEFAULT 9999,
    "CAT_ID" CHAR(5) WITH DEFAULT '99999',
    "CAT_DESC" CHAR(50) ,
    "SCTN_ID" CHAR(3) ,
    "SCTN_DESC" CHAR(50) ,
    "STYLE_ID" CHAR(10) ,
    "COLOUR_ID" CHAR(2),
    "FABRIC_TYPE_ID" CHAR(4) ,
    "FABRIC_TYPE_DESC" CHAR(50) ,
    "PRDCT_TYPE_ID" CHAR(1) ,
    "PRDCT_TYPE_DESC" CHAR(50) ,
    "PRI_GRP_PRDCT_TYPE_ID" CHAR(4) ,
    "PRI_PRDCT_TYPE_DESC" CHAR(50) ,
    "SUPP_ID" INTEGER ,
    "SUPP_DESC" CHAR(50) ,
    "SSN_ID" CHAR(2) ,
    "SSN_DESC" CHAR(50) ,
    "WKS_ON_SALE" INTEGER ,
    "CNTRY_OF_ORIGIN_ID" CHAR(3) ,
    "IFS_ID" CHAR(2) WITH DEFAULT '99',
    "IFS_DESC" CHAR(50) ,
    "CONT_FLG" CHAR(1) ,
    "CO_ATTR_VAL_ID_01" CHAR(3) ,
    "CO_ATTR_VAL_ID_02" CHAR(3) ,
    "CO_ATTR_VAL_ID_03" CHAR(3) ,
    "CO_ATTR_VAL_ID_04" CHAR(3) ,
    "CO_ATTR_VAL_ID_05" CHAR(3) ,
    "CO_ATTR_VAL_ID_06" CHAR(3) ,
    "CO_ATTR_VAL_ID_07" CHAR(3) ,
    "CO_ATTR_VAL_ID_08" CHAR(3) ,
    "CO_ATTR_VAL_ID_09" CHAR(3) ,
    "CO_ATTR_VAL_ID_10" CHAR(3) ,
    "CO_ATTR_VAL_ID_11" CHAR(3) ,
    "CO_ATTR_VAL_ID_12" CHAR(3) ,
    "CO_ATTR_VAL_ID_13" CHAR(3) ,
    "CO_ATTR_VAL_ID_14" CHAR(3) ,
    "CO_ATTR_VAL_ID_15" CHAR(3) ,
    "CO_ATTR_VAL_ID_16" CHAR(3) ,
    "CO_ATTR_VAL_ID_17" CHAR(3) ,
    "CO_ATTR_VAL_ID_18" CHAR(3) ,
    "CO_ATTR_VAL_ID_19" CHAR(3) ,
    "CO_ATTR_VAL_ID_20" CHAR(3) ,
    "CO_ATTR_VAL_ID_21" CHAR(3) ,
    "CO_ATTR_VAL_ID_22" CHAR(3) ,
    "CO_ATTR_VAL_ID_23" CHAR(3) ,
    "CO_ATTR_VAL_ID_24" CHAR(3) ,
    "CO_ATTR_VAL_ID_25" CHAR(3) ,
    "CO_ATTR_VAL_ID_26" CHAR(3) ,
    "CO_ATTR_VAL_ID_27" CHAR(3) ,
    "CO_ATTR_VAL_ID_28" CHAR(3) ,
    "CO_ATTR_VAL_ID_29" CHAR(3) ,
    "CO_ATTR_VAL_ID_30" CHAR(3) ,
    "DPT_ATTR_VAL_ID_01" CHAR(3) ,
    "DPT_ATTR_VAL_ID_02" CHAR(3) ,
    "DPT_ATTR_VAL_ID_03" CHAR(3) ,
    "DPT_ATTR_VAL_ID_04" CHAR(3) ,
    "DPT_ATTR_VAL_ID_05" CHAR(3) ,
    "DPT_ATTR_VAL_ID_06" CHAR(3) ,
    "DPT_ATTR_VAL_ID_07" CHAR(3) ,
    "DPT_ATTR_VAL_ID_08" CHAR(3) ,
    "DPT_ATTR_VAL_ID_09" CHAR(3) ,
    "DPT_ATTR_VAL_ID_10" CHAR(3) ,
    "DPT_ATTR_VAL_ID_11" CHAR(3) ,
    "DPT_ATTR_VAL_ID_12" CHAR(3) ,
    "DPT_ATTR_VAL_ID_13" CHAR(3) ,
    "DPT_ATTR_VAL_ID_14" CHAR(3) ,
    "DPT_ATTR_VAL_ID_15" CHAR(3) ,
    "DPT_ATTR_VAL_ID_16" CHAR(3) ,
    "DPT_ATTR_VAL_ID_17" CHAR(3) ,
    "DPT_ATTR_VAL_ID_18" CHAR(3) ,
    "DPT_ATTR_VAL_ID_19" CHAR(3) ,
    "DPT_ATTR_VAL_ID_20" CHAR(3) ,
    "ROW_STATUS" CHAR(1),
    PRIMARY KEY (STYLE_ID,COLOUR_ID)
    )
    IN USERSPACE5;

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Do not make it a primary key. Make it an index instead.

    Andy

  3. #3
    Join Date
    Jul 2003
    Location
    porto - Portugal
    Posts
    74
    Thanks for your help..i'll do like that

Posting Permissions

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