1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

constraints

Discussion in 'SQL PL/SQL' started by bnramesh8, Oct 27, 2014.

  1. bnramesh8

    bnramesh8 Active Member

    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    80
    Hi,
    In oracle the Unique constraint allows upto how many null values for a column?
     
  2. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    Hi.

    Is defined by architecture, data, etc.

    Since to index fields the containing NULL - it isn't correct

    Here are useful links :

    Create indexes
    Logical DB limits
    Physical DB limits

    for example :
    Code (SQL):


    DROP TABLE test_tab purge;
    CREATE TABLE test_tab
    (x INT NOT NULL,
     y INT
     );
    INSERT INTO test_tab
    SELECT
    level,NULLIF(MOD(level,2),0)
    FROM dual CONNECT BY level <= 7;
    CREATE UNIQUE INDEX test_tab_u1 ON test_tab(x,y);
    rem ora-00001
    INSERT INTO test_tab VALUES(2,NULL);

    SQL>

    TABLE dropped
     
    TABLE created
     
    7 ROWS inserted
     
    INDEX created
     
    INSERT INTO test_tab VALUES(2,NULL)
     
    ORA-00001: UNIQUE CONSTRAINT (PRKNEW_DATA.TEST_TAB_U1) violated
     
     
  3. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi ramesh,

    I think there is no limit for that.