DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: No duplicates

  1. #1
    Join Date
    Jul 2003
    Location
    Saint Louis MO, USA
    Posts
    8

    No duplicates

    Using CREATE TABLE. . . How can you specify that no duplicates are allowed on a specific field?
    _

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    apply a unique constraint. Here's some example constraints ...

    Code:
    create table
       my_table
          (
          col1 number primary key,
          col2 number unique,
          col3 references my_parent_table
          );
    
    
    create table
       my_table
          (
          col1 number
             constraint
                xpkmy_table
             using index
                tablespace my_ts
                pctfree 0 nologging,
          col2 number
             constraint
                unq02my_table
             using index
                tablespace my_ts
                pctfree 0 nologging
           );
    Now, go and read the SQL Reference, and the Concepts Guide, on the subject of constraints.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Jul 2003
    Location
    Saint Louis MO, USA
    Posts
    8
    Thanks that worked. Where is the SQL Reference, and the Concepts Guide you mentioned?

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

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


Click Here to Expand Forum to Full Width