Results 1 to 3 of 3

Thread: Index

  1. #1
    Join Date
    Jan 2003
    Posts
    18

    Unanswered: Index

    Hi,
    When I tried to create a Index on a Primary key column as follows it gives me the following error message.
    This happens when I try to create the index for the very first time.

    create table emp2 (no number,name varchar2(20),constraint pk_emp2_no primary key(no));

    create index ind2 on emp2 (no);

    Error message:
    ORA-01408: such column list already indexed

    Can anyone please tell me wether its possible to create index on primary key column or its not at all necessary.
    Thanks in advance.

    Regards,
    Senthil

  2. #2
    Join Date
    Jan 2003
    Location
    Bangalore
    Posts
    44

    Re: Index

    Hi Senthil,
    When you create a table with primary key, you dont need to create the index on that column, since that column is already indexed by defalut.
    If you try to create a index on the same column, it give this message.

    - Regards
    Mahesh Kumar BK

    Originally posted by senthil5_kumar
    Hi,
    When I tried to create a Index on a Primary key column as follows it gives me the following error message.
    This happens when I try to create the index for the very first time.

    create table emp2 (no number,name varchar2(20),constraint pk_emp2_no primary key(no));

    create index ind2 on emp2 (no);

    Error message:
    ORA-01408: such column list already indexed

    Can anyone please tell me wether its possible to create index on primary key column or its not at all necessary.
    Thanks in advance.

    Regards,
    Senthil

  3. #3
    Join Date
    Jan 2003
    Posts
    18

    Re: Index

    Hi Mahesh,
    Thanks a Lot

    Regards,
    Senthil


    Originally posted by mahesh_bk1
    Hi Senthil,
    When you create a table with primary key, you dont need to create the index on that column, since that column is already indexed by defalut.
    If you try to create a index on the same column, it give this message.

    - Regards
    Mahesh Kumar BK

Posting Permissions

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