• RELEVANCY SCORE 4.72

    DB:4.72:What Is The Diff Between Unique And Non Unique Key az





    What is the diff between unique and non unique key

    DB:4.72:What Is The Diff Between Unique And Non Unique Key az


    hi,

    unique key -- allows to have null values. but data should not be redundant.

    non unique keys [primary , foreign .......] - depends on whichkey we r using.

    if helpful reward some points.

    with regards,

    Suresh Aluri.

  • RELEVANCY SCORE 4.67

    DB:4.67:Re: Null Values Unique Key 9c




    Unique key + non null = Primary key! Is it correct?

    DB:4.67:Re: Null Values Unique Key 9c

    Thanks for digging out *6 year old* thread.. ;)

  • RELEVANCY SCORE 4.48

    DB:4.48:Unique Key c3




    Hello All,

    I have a table , say T1

    I have defined one column as unique and not null also.

    Does it behave as primary key constraint?

    Does NOT NULL + UNIQUE = PRIMARY KEY?

    Thanks.

    DB:4.48:Unique Key c3

    Does it behave as primary key constraint?
    No. There's a lot of overlapping functionality betwen unique and primary keys, but there are differences too. Primary keys are created as constraints and they automatically get a unique index and a NOT NULL constraint. Unique keys are created as an index and may allow nulls (though its not a good idea performancewise to have nulls in unique keys)

  • RELEVANCY SCORE 4.44

    DB:4.44:Unique Key kc


    hi
    i am writing a script to load the table.
    for that table , it's having a combination of two unique keys .
    eg unique key (no,date,dept)
    unique key (no,dept,id)

    how do i use this unique key in the select st from ET table to database table

    thx in advance

    DB:4.44:Unique Key kc

    I'm not sure I understand the question? Can you explain it again? I assume "select st" means "select statement". What does ET in "from ET table" mean?

    If either (no, dept, date) or (no, dept, id) is a unique key, you can ensure that your SELECT statement returns exactly one row by specifying all three columns in the WHERE clause of the SELECT statement.

    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • RELEVANCY SCORE 4.42

    DB:4.42:Re: To Add Primary Key dk


    first clear your funda regarding primary key, because duplicate as well as null records can't be there .

    Primary key is the combination of not null and unique key.

    DB:4.42:Re: To Add Primary Key dk

    SQL create table test3 ( id number );
    Table created.
    SQL insert into test3 values ( null );
    1 row created.
    SQL insert into test3 values ( 1 );
    1 row created.
    SQL insert into test3 values ( 1 ) ;
    1 row created.
    SQL insert into test3 values ( 2 );
    1 row created.
    .
    .
    SQL alter table test3 add constraint test3_pk primary key (id) deferrable novalidate;

    Table altered.
    .
    .
    SQL select * from test3;

    ID
    ----------
    .
    1
    1
    2

    SQL insert into test3 values ( 2);
    insert into test3 values ( 2)
    *
    ERROR at line 1:
    ORA-00001: unique constraint (FLYSPON.TEST3_PK) violated
    .
    .
    .
    Of course it goes without saying that you should NEVER EVER consider doing this.
    .
    .
    .Message was edited by:
    The Flying Spontinalli

  • RELEVANCY SCORE 4.39

    DB:4.39:Re: Create Unique Primary Key 3a


    To use it

    select seq_abc.nextval
    into :issue_mt.issue_id
    from issue_mt;

    DB:4.39:Re: Create Unique Primary Key 3a

    And what happens when 2 users do this at the same point in time? A dup val on index. You need to LOCK your table before you do this to make sure only ONE user is generating your "unique" number. But this would mean only one user can do this operation at a time; so unless you are on a single user environment I wouldn't even think about thinking about doing this.

    Have a look:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:4208600959452287::::P11_QUESTION_ID:3379873654938
    and
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
    and the documentation
    http://www.oracle.com/pls/db102/ranked?word=sequenceremark=federated_search

    The whole purpose of sequences would be to generate unique numbers; not sure why this doesn't work for you.

    cheers

  • RELEVANCY SCORE 4.28

    DB:4.28:What Is The Need Of Primary Key As Opposed To Using Not Null And Unique ? 3j


    Hi
    What is the need of primary key as opposed to using not null and unique ?
    Regards

    DB:4.28:What Is The Need Of Primary Key As Opposed To Using Not Null And Unique ? 3j

    For all practical reasons: none.

    From a relational database theory perspective there is only one concept: a key.
    The SQL standard decided to introduce two concepts: PK and UK, where PK is in essence UK+NotNull-on-all-key-columns.

  • RELEVANCY SCORE 4.27

    DB:4.27:Constraints.....In Oracle zp


    Difference between them
    CANDIDATE KEY
    COMPOSITE KEY
    ALTERNATE KEY
    UNIQUE KEY

    and plzz give me some example...

  • RELEVANCY SCORE 4.27

    DB:4.27:Re: How To Create A "Conditional" Unique Key? jk


    Rene
    it is not a trick it is a unique index which simply requires the unique combination of the values of its two columns.

    DB:4.27:Re: How To Create A "Conditional" Unique Key? jk

    well, the OP says he do not care about old dates, so there is no need to index dates. Your solution is easy, it is probably more performant than mine, but it does not allow to have duplicates values for old dates, so it is not the same result.

    the original message states:
    For old data a date column has a value for current data this columns is empty. yes, it does not states that for old data, a date column has an unique values, so your solution is maybe to restrictive

  • RELEVANCY SCORE 4.23

    DB:4.23:Difference Between Unique Key Versus Primary Key? aj


    Whats the main difference between a unique key constraint and a primary key constraint? Which is better for large partitioned tables in a data warehouse environment.

    Thanks,
    Scott

    DB:4.23:Difference Between Unique Key Versus Primary Key? aj

    Dear,

    Diffenece b/w primary key unique key as below :

    Primary key unique with mandatory (not null. Always take value in primary key).

    Unique key unique with not mandatory (null ).

    Safhan.

  • RELEVANCY SCORE 4.19

    DB:4.19:Windows 8 Tranformation Pack Unique Product Key 3z


    pls send win8TP3 unique porduct key thais email-thanveerbabu@gmail.com, My unique user ID:54214360766451443219031642

  • RELEVANCY SCORE 4.16

    DB:4.16:Primary Key And Unique Key Not Guaranteed To Create Unique Indexes j3


    Hi Guys,

    While going through Oracle Documentation at the following link,

    Came across the statement -
    " Creating unique indexes through a primary key or unique constraint is not guaranteed to create a new index, and the index they create is not guaranteed to be a unique index. "

    Was thinking doesn't the primary key and unique key meant to create the unique index?

    Any information in this regard or links to any kind of info or documentation is more than welcome.

    The link where this is mentioned -
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref815

    Thanks,
    Av.

    DB:4.16:Primary Key And Unique Key Not Guaranteed To Create Unique Indexes j3

    PK unique keys doesn't create the unique index, but they create the index on the columns
    there is a difference between unique key and unique index and creating a unique constraint means creating an index and enforcing uniqueness on columns.

    Cheers
    Deepak

  • RELEVANCY SCORE 4.16

    DB:4.16:About Unique Key z3


    Some one ask what is the difference between unique key and primary key.
    I had given the answer unique can store null values but primary key not.

    But he replied don't give me the stupid answer, i want to hear some other soln.
    what is the technical difference between unique and primary key.

    Thank's in advance

    DB:4.16:About Unique Key z3

    Hi,

    Hope the below link will help you.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462

    Regards

  • RELEVANCY SCORE 4.16

    DB:4.16:Re: About Unique Key s3


    There can be records with more than one NULL values in a unique key column. But there cannot be a same value for two records. The basic difference between UNIQUE and PRIMARY KEY is that UNIQUE KEY column can hold NULL values but PRIMARY KEY column cannot!!

    DB:4.16:Re: About Unique Key s3

    Thank you for the explanation Laurent!!

  • RELEVANCY SCORE 4.16

    DB:4.16:Constraints cs


    hi,

    why oracle introduced primary key ? The Primary key purpose is solved by using UNIQUE key and NOT NULL constraints..?
    Can u mention some uses of primary key?

    DB:4.16:Constraints cs

    A primary key has the functionality of unique and not null constraints,so less maintanence.
    Also Foreign key requires primary or unique key which is not possible with not null constraints.

  • RELEVANCY SCORE 4.15

    DB:4.15:Enforcing Primary Key Integrity ff



    When there is no primary key or unique key defined on target at data base level how can I force the data going in to follow the unique constraint. I defined unique key in informatica target definition but that doesn't prevent data going in to have unique constraint.Please help.

    Thanks

    DB:4.15:Enforcing Primary Key Integrity ff


    When there is no primary key or unique key defined on target at data base level how can I force the data going in to follow the unique constraint. I defined unique key in informatica target definition but that doesn't prevent data going in to have unique constraint.Please help.

    Thanks

  • RELEVANCY SCORE 4.15

    DB:4.15:Re: Unique Constraint Errors In Impdp 7z


    Since you are using TABLE_EXISTS_ACTION=TRUNCATE, unique constraint violations are results of unique constraint/unique index/primary key that exist in target tables but do not exists in source.

    SY.

    DB:4.15:Re: Unique Constraint Errors In Impdp 7z

    Hello,

    You can disable all the foreign keys, do the import and then, reenable them.

    Or you can disable all the foreigns keys, truncate all the tables, reenable the foreign keys and do the import.

    Regards,
    Sylvie

  • RELEVANCY SCORE 4.11

    DB:4.11:Re: How Does Oracle Implement The Constraints? 1a


    You wrote:
    "Oracle enforces the UNIQUE key constraint by implicitly creating a unique index on the composite unique key"

    Again ... Oracle does NOT use indexes to enforce any constraint. Period. end of discussion.

    But that comes from the concepts manual.

    UNIQUE Key Constraints and Indexes

    Oracle enforces unique integrity constraints with indexes. For example, in Figure 21-4, Oracle enforces the UNIQUE key constraint by implicitly creating a unique index on the composite unique key.

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/data_int.htm#i3372

    scroll down a little...

    Amardeep Sidhu

    Message was edited by:
    Amardeep Sidhu

    DB:4.11:Re: How Does Oracle Implement The Constraints? 1a

    Very nice explanation as like always sir.
    Best regards
    Aman....

  • RELEVANCY SCORE 4.11

    DB:4.11:Re: Constraint cf


    no can't create primary key onthe colum which already has unique key.
    the following error will result if you try
    ORA-02261: such unique or primary key already exists in the table

    DB:4.11:Re: Constraint cf

    do you happen to know every forum ID by name ?Isn't there more elegant like this ?
    ;-)

    Nicolas.

  • RELEVANCY SCORE 4.11

    DB:4.11:Re: Difference Between Primary Key And Unique Key With Not Null Constraint ca


    i believe clustered indexes are created for index organized tables

    DB:4.11:Re: Difference Between Primary Key And Unique Key With Not Null Constraint ca

    Thanks all for putting your efforts,
    I really got more insights of Cluster Index,
    it cleared my confusion, and I am sure for few others too... :)

    Thanks to you,
    Nimish Garg
    3360
    Sven W.
    jeneesh

  • RELEVANCY SCORE 4.11

    DB:4.11:Key Field In File Content Conversion dp



    Is Keyfield must be unique in FCC ?

  • RELEVANCY SCORE 4.11

    DB:4.11:Indexes sk


    What is the difference between Unique and non-unique indexes.

    Unique is created with Primary key and Unique key constraint where the non-unique is created when users created indexes, but I am not clear about there difference

    PK

    DB:4.11:Indexes sk

    Non unique indexes, are used to improve performance on search based on indexed predicate , or indexed join column
    Unique indexes , beside non unique advantage, also have the propertie to Guarantee that index columns combination will not repeat.
    So if you have a table with col1,col2,col3 , and a index on col1 and col2,
    You can have values like
    1,1,1
    1,2,1
    but not
    1,1,2 (since col3 arent part of this unique index)
    regards

  • RELEVANCY SCORE 4.11

    DB:4.11:Primary Key And Unique Index.. zs


    Is Primary Key and Unique Index is same? If no then what is the difference between them.

    thanx.

    Swarup

    DB:4.11:Primary Key And Unique Index.. zs

    Hi,
    For applying uniqueness both have the same role.
    There are few many differences between these two.
    1. A table can have only one primary key but can have any number of unique keys.
    2. Primary key cannot be null but unique keys can be.

    When you make a column or combinations of columns for a primary key , it becomes unique and not null.

    RAJESH

  • RELEVANCY SCORE 4.07

    DB:4.07:Unique And Non-Unique Indexes... x1


    I was reading Oracle Concepts Manual and there is a paragraph about indexes which states:

    Oracle recommends that unique indexes be created explicitly, using CREATE UNIQUE INDEX. Creating unique indexes through a primary key or unique constraint is not guaranteed to create a new index, and the index they create is not guaranteed to be a unique index.

    I find it bit confusing. Does primary key not always create index and maintain uniqueness of data ? Or it means something else ?

    Thanks
    Sidhu

    DB:4.07:Unique And Non-Unique Indexes... x1

    Thanks Richard...

    Have been waiting for you to strike :)

    I will go through all the posts and get back if any doubts :)

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

    Thanks Satish n Niall again for clarifications...

    Sidhu

  • RELEVANCY SCORE 4.07

    DB:4.07:How To Change Unique To Non Unique Key.? a8



    i like to know how to change a unique key to non unique key in tables..? if anyone knows pls answer...

    DB:4.07:How To Change Unique To Non Unique Key.? a8


    Hi,

    goto se11,in the change mode deselect the bkey check box/b of that field in the table.

    Regards,

    Sowjanya

  • RELEVANCY SCORE 4.07

    DB:4.07:Primary Keu Unique Key x1



    Hi all,

    Is there any difference between primary key and unique key.

    thanks

    Aashish

    DB:4.07:Primary Keu Unique Key x1


    The Main difference is that Unique Key allows null value but Primary Key doesn't allow null values.

    thats it.

  • RELEVANCY SCORE 4.06

    DB:4.06:Uniqueness Using Unique Indexes jm


    Hi,

    Primary Key: Does defining attributes as non-null values and creating unique indexes is same as Primary key constraint declaration?

    Unique Key: Does creating unique indexes for attributes is same as Unique key constraint declaration?

    Can I define unique keys without using constraint declaration? I understand creating PK,UK constratints create indexes. But can I do other way..like...just create unique indexes and uniqueness is taken care of..

    How can I differentiate a primary key index from a unique key index?

  • RELEVANCY SCORE 4.02

    DB:4.02:Re: Entity Validation f8


    Did you check this - http://www.gabrielsideras.com/2010/09/28/adf-unique-key-validation/

    DB:4.02:Re: Entity Validation f8

    If you do want to use that method it needs to be..

    instead of
    throw new ValidatorException(new FacesMessage("OrganisationName already exist"));
    use
    bindings.reportException('OrganisationName already exist');

  • RELEVANCY SCORE 4.02

    DB:4.02:Validation And Unique Key 9d


    Hi,

    I am spending time to validate every one unique key in unique way.
    Are there rules or function for universal validation of any unique key?
    I would like to replace error page returning from database.

    Konstantin

    DB:4.02:Validation And Unique Key 9d

    Hi Joel, Konstantin and Vikas,

    I have also thought about using a single PL/SQL function to handle this sort of thing.

    A simple function would be ok if the PK and unique constraint are both for single columns. The function could then receive the table name, PK column name, the name of the column to check for uniqueness and the value to check.

    It becomes more complicated, of course, if the PK and/or the unique constraint is on more than one column (and how many times have we seen users creating PKs over several fields?!?!?). Still doable, although it may be easiest to have one function per constraint.

    The nicest solution - and one that probably won't happen! - would be if the constraint itself could return user-defined error messages :o) Either that or Apex could allow us to trap ORA error numbers and return user-defined messages?

    Andy

  • RELEVANCY SCORE 4.02

    DB:4.02:How To Create Unique Row Id Without Using Primary Key Oy Composite Key . 9c


    how to create unique row id without using Primary key or composite key .

    Deepak Gupta-(Project Manager)

    DB:4.02:How To Create Unique Row Id Without Using Primary Key Oy Composite Key . 9c

    newid always return new id when run . but i need no charge value..

    Purpose of sync record from table using dblink . but source table has no unique row . so any option in sql server that each row has unique value. so that i create job then sync incremental data ..

    (i am not using composite key )

    Deepak Gupta-(Project Manager)

  • RELEVANCY SCORE 4.01

    DB:4.01:Unique Key But Except Certain Strings. k7


    Hi

    I would like to have unique index on 2 fields on one table. but if their values are "NA" or "Existing", unique should not be applied, that means there may be multiple "NA"s or multiple "Existing"s.

    Is there no way to do this using unique key?.

    Pl suggest.

  • RELEVANCY SCORE 4.00

    DB:4.00:Can Foreign Key Refer To Unique Key? f1


    Hi....

    DB:4.00:Can Foreign Key Refer To Unique Key? f1

    If you join that table x with table y using a

    WHERE x.pk_column = y.fk_columnpredicate. Then the rows with "matching" NULL's will not show up in the query result.
    But this has nothing to do with an FK referencing a UK.
    It has everything to do with how NULL's are treated in the SQL standard.

    A predicate like:

    NULL = NULLwill evaluate to FALSE (that's just how SQL treats NULL's in this case).

  • RELEVANCY SCORE 4.00

    DB:4.00:Re: Partition Pruning cc


    ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index

    this is the error when i was trying to

    create unique index on primary key column local;

    DB:4.00:Re: Partition Pruning cc

    hmmmm i got it..

    thanks a lot anurag for a good conversation and helping me out.

    have a great day

    regards
    Raj

  • RELEVANCY SCORE 4.00

    DB:4.00:Unique Key xz


    hi
    i am having a doubt.
    we r using the combination of unique keys for table loads and also we r using outer joins on that unique keys.
    and also in that unique key combination, some columns are null.
    will unique key will work for outer join , based on null values??

    thx

    DB:4.00:Unique Key xz

    Maybe you should try it then?

  • RELEVANCY SCORE 4.00

    DB:4.00:Re: Unique Values zm


    Why dont you mark the required column as key in your interface

    DB:4.00:Re: Unique Values zm

    Ok .. then you issue resolved with the DISTINCT check box .
    That is the most important thing .

    Sorry for not understanding your question properly .

    Thanks,
    Sutirtha

  • RELEVANCY SCORE 4.00

    DB:4.00:Primary Key j1


    A) Why Oracle automatically creates unique index on Primary and Unique key?

    B) Why only Primary or Unique key can be made Foreign key? Why not non-PK or UK?

    DB:4.00:Primary Key j1

    Hi,
    Please go through this.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462

    regards,
    Dipankar.

  • RELEVANCY SCORE 3.99

    DB:3.99:Non-Unique Key f7



    Hello Gurus,

    what does non-unique key do ? I think unique key can be used for selecting a unique row from a internal table object, and also used for sorting . but why is non-unique key there if I can only select row by index ( which is stadard table)?

    thanks very much!

    DB:3.99:Non-Unique Key f7


    Hi bo zhang

    As you know unique keys are used as primary indexes in the where clause of a select statement.

    To have secondary indexes in the where clause, we've to make use of non-unique keys.

    But in performance view, we should not use, since as it is a non-unique, we come across many duplicates, so generally we use it as the situation demands.

    At max., we can make 16 secondary indexes.

    Here i like to differentiate b/w index and keys to clear the confusion. At the creation of database table through se11, we've to position the unique key fields at top of the table fields to clarify the entries to be identified.

    About Indexes, after activating the table in se11, the system implicitly creates indexes for the table based on primary keys and secondary indexes based on non-unique keys.

    For further doubts feel free to contact me.

    If it helpful to you, reward me plz.

    Thanks

    Suren

  • RELEVANCY SCORE 3.99

    DB:3.99:Sharepoint 2007 Library Custom Column Unique Key Constraint 9c


    Hi,Is it possible out of the box to have unique key constraint on custom column of SharePoint 2007 document library?Adeveloper

    DB:3.99:Sharepoint 2007 Library Custom Column Unique Key Constraint 9c

    You can also use Policy which is Inbuilt feature in SharePoint 2007.
    Go to Settings - List Settings - Information Policy Management Settings - Define Policy - Press OK - Click on Enable Unique Column Policy - Select column which you wanna make unique - Press OK

    Thanks, Chintan

  • RELEVANCY SCORE 3.99

    DB:3.99:Re: Unique Random Number Generation sa


    if you need a simple unique key on one system try System.currentMills()

    DB:3.99:Re: Unique Random Number Generation sa

    I suppose not, but the current millis are the baseof
    many
    unique functions no ?It is? Can you give me an example? I could imagine it
    being a piece of it. Well i call it base because i believe it's fundamental - the other
    parts are useful, but a starting point is required - millis, hence
    "base".

  • RELEVANCY SCORE 3.99

    DB:3.99:Does A Microsoft.Office.Interop.Word.Inlineshape Object Has A Unique Key? xd


    Does anybody know whether a Microsoft.Office.Interop.Word.InlineShape object has a unique key?This unique key should also be available via the openxml.Thx!Wim

    DB:3.99:Does A Microsoft.Office.Interop.Word.Inlineshape Object Has A Unique Key? xd

    Hi Wim I've tried to use the AlternativeText property too. But the problem here is that, after closing, opening and saving the document again, Word corrects the value which I've have set.I'm not seeing this behavior. If I assign a value to the AlternativeText property of an InlineShape, save the document, then close it and later open it, the value I've assigned is retained.Theoretically, it would be possible to add a bookmark around the InlineShape object's range, and use the bookmark name as identification. Bookmarks, however, tend to be a bit volatile (easily deleted), which is why I did not propose this approach in my original answer. The following line of pseudocode (meaning I'm typing off the top of my head, so may make a small error) illustrates how this could be done:    'Parent should be the document in which the InlineShape is embedded    shape.Parent.Bookmarks.Add(shape.Range, Bookmark Name);You should then later be able to pick this up from the WordOpenXML; the InlineShape should be within the opening and closing elements of the bookmark.Please note that the VSTO forum really supports the VSTO technology. While we do field some general object model questions that could be of interest to VSTO developers, the XML vocabularies for the Office applications are not a supported topic.Cindy Meister, VSTO/Word MVP

  • RELEVANCY SCORE 3.96

    DB:3.96:How Many Null Values Can We Give In Unique Key Column 1d


    Please tell me how many maximum number of null values we can give in any Unique key column?

    DB:3.96:How Many Null Values Can We Give In Unique Key Column 1d

    in some databases it is not possible to define a unique index on a column with multiple NULL values (because NULL is treated as a value in the index - and not as a missing information) - http://stackoverflow.com/questions/767657/how-do-i-create-unique-constraint-that-also-allows-nulls-in-sql-server describes the situation in MS SQL Server:
    What you're looking for is indeed part of the ANSI standards SQL:92, SQL:1999 and SQL:2003, ie a UNIQUE constraint must disallow duplicate non-NULL values but accept multiple NULL values. In the Microsoft world of SQL Server however, a single NULL is allowed but multiple NULLs are not... In SQL Server 2008, you can define a unique filtered index based on a predicate that excludes NULLs
    But Oracle has no problems with these situations.RegardsMartin

  • RELEVANCY SCORE 3.96

    DB:3.96:Doubt sc


    Is it possbile to have 2 null values in a unique key column.

    DB:3.96:Doubt sc

    Hi,
    Yes you can have 2 null value in unique key column
    A unique constraint is a single field or combination of fields that uniquely defines a record. Some of the fields can contain null values as long as the combination of values is unique.

  • RELEVANCY SCORE 3.96

    DB:3.96:How To Create A Unique Key Using Two Or More Attributes? 8s


    how to create a unique key using two or more attributes ?

    DB:3.96:How To Create A Unique Key Using Two Or More Attributes? 8s

    The following example illustrate how to create a unique key using two or more attributes/fields

    Scenario: Implementing Unique Key on ManagerID Location ID in DepartmentEO(Department Table)

    Step#1: Open the Desired Entity Object DepartmentEO. Go to Overview tab Click General Finger tab.

    Step#2: Expand Alternate Keys section click +.

    Step#3: In the Pop-up wizard, Enter a name for alternate Key Unique_Manager_X_Location.

    Step#4: Select the desired attributes/fields from available list Shuffle to right side.

    Step#5: Now go to Business Rules finger tab.

    Step#6: Select Entity Validators in the list click + to add a new entity level validation rule.

    Step#7: In the Pop-up, Select Rule Type as Unique Key

    Step#8: In the Rule Definition tab select the key Unique_Manager_X_Locationcreated.

    Step#9: Now go to Failure Handling tab, and click the Magnifier Icon .

    Step#10: If the key is not already created then in the Select Text Resource Popup, Using the functional design document, Enter display value, Key and Description. And click Save Select Button.

    Step#11: Now Click OK.

  • RELEVANCY SCORE 3.96

    DB:3.96:Primary Key And Unique Key k9


    We can have only one primary key and many unique keys on a table.

    Primary key is same as a unique key with no null values.

    So can't we have multiple primary keys by making multiple unique keys with not null constraint on the columns involved in the unique keys.

    DB:3.96:Primary Key And Unique Key k9

    Anish's post is wonderful. It demonstrates implementation of multiple unique identifiers perfectly.

    However, we have a problem with semantics.

    In relational design, any column or combination of columns that uniquely identifies a row is referred to as a Unique Identifier, or Candidate Key (however, I never see the term Candidate Key in Oracle documentation).

    The "Primary Key" is the Candidate Key chosen by the database designer as the one that is most easily recognizable to the developers and users. This is why Oracle only allows one Primary Key constraint per table.

    When the designer cannot identify a column or set of columns which easily distinguisehes each row from the rest of the rows, then they specify that the Primary Key will be system generated(ie. Employee Number, Order Number, etc.). In Oracle the Sequence object is frequently used for this. A system generated key is called a Surrogate Key. (Surrogate Key is another term I don't usually find in Oracle documentation either).

  • RELEVANCY SCORE 3.94

    DB:3.94:Re: Foreign Keys sk


    I think you are saying that you want to create a unique key not a unique index... is that right?

    If you were trying to create a unique key that would allow you to later create foreign keys against that table you use the following syntax:

    ALTER TABLE test_b add constraint test_b_uk UNIQUE (sid, eid);

    DB:3.94:Re: Foreign Keys sk

    John Spencer wrote:
    The OP stated they had a multicolumn PK and wanted to enforce an FK on only the leading column of the PK. That cannot be done. They only mentioned (possibly because the whole thing confuses me) that sid was unique about an hour after I posted my comments.That is a very technical point of view. Actually I would prefer to come from the business logic side. So no matter which primary or unique constraints already exists, that reference can still be possible, aslong it makes sense. I would never reference to a constraint, but to another column(s). And if the business logic is satisfied, after that I would start to handle the technical side also keeping in mind, that different dbms may have different technical needs.

    Ikrischer

  • RELEVANCY SCORE 3.94

    DB:3.94:How To Create Unique Key In Ms Access. aa


    hello,

    DB:3.94:How To Create Unique Key In Ms Access. aa

    Press Ctrl key and select both rows in the design view. Make them as Primary key.Regards
    Puboo
    My blog : http://www.thurupathan.spaces.live.com/

  • RELEVANCY SCORE 3.94

    DB:3.94:How To Drop A Unique Key From A Table x7


    Hi

    Is it possible to drop a unique key from a table with out deleting the table?.if so can anyone help me in dropping the unique key from a table

    Thanking you in advance
    Dinny

    DB:3.94:How To Drop A Unique Key From A Table x7

    If you don't know how to check your constraint name try this one:

    SQL select constraint_name,constraint_type,table_name
    2 from user_constraints
    3 where table_name='T001'
    4 /

    CONSTRAINT_NAME C TABLE_NAME
    ------------------------------ - ------------------------------
    SYS_C002862 U T001

    Best Regards
    Krystian Zieja / mob

  • RELEVANCY SCORE 3.92

    DB:3.92:Unique Product Key fa


    please help me what is the unique product key?
    my unique user id is54214273481730643700650614

    DB:3.92:Unique Product Key fa

    This one may help.
    http://support.microsoft.com/kb/2279109

    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided AS IS with no warranties or guarantees , and confers no rights.

  • RELEVANCY SCORE 3.90

    DB:3.90:I Want A General Query For Retrieveing Below Database Objects cx


    plz give me a General Query or function for retrieveing below things related to microsoft sql server 2000 or more versions....
    i want
    schema,table name,view ,column count,primary key,primary key schema,composite primary key,foreign key,unique key count,identity column,table size ,remarks,row count,primary key count,foreign key count,foreign key column count,primary key column count,unique
    key count,unique key column count,computed column count,identity column count

    thank u...

    DB:3.90:I Want A General Query For Retrieveing Below Database Objects cx

    i m not saying that u give me a big query ....but i also done with big query for retrieveing above things if u give me idea how it reduce ...nd ya u say copy paste so that things only do lossers ok !!!

  • RELEVANCY SCORE 3.90

    DB:3.90:How Do You Create A Table With Two Unique Columns xk


    How do you create a table with two unique columns. I am using the following syntax below and I keep getting the error message such unique or primary key already exist.

    create table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2(4) NOT NULL UNIQUE,
    Tyle_Location varchar2(30) NOT NULL UNIQUE,
    Type_Description varchar2(20),
    PRIMARY KEY (Type_id)
    );

  • RELEVANCY SCORE 3.90

    DB:3.90:Oraclebi Discoverer Plus "Unique Key: Br1" za


    Hello
    I am getting OracleBI Discoverer "Unique Key: BR1" in Oracle Discoverer Plus 10g.

    Is there any body know any thing about it?

    Regards

    DB:3.90:Oraclebi Discoverer Plus "Unique Key: Br1" za

    I have encountered this message when using the Scheduling Manager. The EUL5_Batch_Reports table requires a scheduled workbook name to be unique for the whole EUL, not just for a particular user. But when a second user tries to use an existing name, they get the option to "Keep this name, but delete the existing workbook and its results". If they choose this option, it works if the conflicting workbook belongs to them, but if it does not, they get Unique Key:BR1.

    Scott

  • RELEVANCY SCORE 3.90

    DB:3.90:What Is The Difference Between Primary Key And Unique Key? j9


    What is the difference between primary key and unique key?

    DB:3.90:What Is The Difference Between Primary Key And Unique Key? j9

    Also, primary keys are NOT NULLs. (Unique can be null)

    And are "prefered" when making foreign key references to a table without columns.

    And are used in Index Organazied tables.

  • RELEVANCY SCORE 3.90

    DB:3.90:Generate A Key Using Database Sequence 3z


    Hii,
    how do i create a unique key with database sequencer in oracle or terradata.
    thanks
    sam

    DB:3.90:Generate A Key Using Database Sequence 3z

    You can also use an insert trigger to populate the key field in case it's NULL.

    CREATE SEQUENCE TRK_DATABASE_SEQ;

    CREATE OR REPLACE TRIGGER "CDBS"."TRK_DATABASE_BI" BEFORE
    INSERT ON "CDBS"."TRK_DATABASE" FOR EACH ROW begin
    if :new.db_key is null then
    select trk_database_seq.nextval
    into :new.db_key
    from dual;
    end;
    end;

  • RELEVANCY SCORE 3.89

    DB:3.89:Regarding Composite Unique Key dp


    hi all
    Can anybody tell me the syntax of Composite unique key

    Regards
    S

    DB:3.89:Regarding Composite Unique Key dp

    if u'r looking for composite primary key, this might help,

    alter table table_name add constraint constraint_name primary key (col1, col2, ...coln)[pre]

  • RELEVANCY SCORE 3.88

    DB:3.88:How To Use Non-Unique Indexes To Enforce Primary Key sf


    Can anyone tell me how to use non-unique index to enforce primary key?

    Thanks

    DB:3.88:How To Use Non-Unique Indexes To Enforce Primary Key sf

    Primary key must be unique. Primary key is something that can represent the record.

    Non-unique key is representative of a group of common value. It is meaningful in query performance instead of business logic.

    Steve

    null

  • RELEVANCY SCORE 3.88

    DB:3.88:Composite Unique Key In Entity Object js


    Hello
    Is it possible to define a composite unique key in an entity object?
    That means a unique key that consists of more than one column?

    Regards Erik

    DB:3.88:Composite Unique Key In Entity Object js

    The paper about business rules in ADF BC gives some suggestions how to deal with secondary unique identifiers (and also explains why the Unique property does not work as you might expect it to do). You can find it here in section 6.1.3.1.1:

    http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf

    --
    Jan Kettenis

  • RELEVANCY SCORE 3.88

    DB:3.88:Cmp And Unique Constraint x3



    Hi,is there any way to define Unique-Constraints via CMP outside of the Primary Key ?David

    DB:3.88:Cmp And Unique Constraint x3


    Did you find out if/how this can be achieved?

  • RELEVANCY SCORE 3.88

    DB:3.88:Unique Indexes fs


    Hi,

    I am very confused regarding unique indexes. Does unique index contain duplicates key values? If yes then how?

    Thank you for your cooperation.

    Kind Regards,

    Adnan Hamdus Salam

    DB:3.88:Unique Indexes fs

    Please post your 4 digits Oracle version and Statpack/AWR or SQL output which show exactly SQL statement and wait events.

    Very likely reason is that concurrent transactions try to insert the same key in a unique index. Application code has to be checked: especially how unique key (or primary keys) are generated. The right way with Oracle is to use sequences for that: http://docs.oracle.com/cd/E11882_01/server.112/e25789/schemaob.htm#i5667.

  • RELEVANCY SCORE 3.86

    DB:3.86:Primary Key Vs Unique+ Not Null ( Are They Same ?) c9


    Hi

    Is Primary key UNIQUE +NOT NULL constraint are same or do they differ. What is the difference. Will Unique Not NULL replace Primary Key.

    Table test ( a number(10) unique not null, b number(10) primary key)

    DB:3.86:Primary Key Vs Unique+ Not Null ( Are They Same ?) c9

    A PRIMARY KEY constraint and a UNIQUE constraint on NOT NULL column(s) are two different syntaxes used to create candidate key constraints. In logical and practical terms these two methods achieve the same thing, ie: they create keys in tables.

    The so-called PRIMARY KEY constraint is therefore just a syntax shortcut, but one that can only be used once per table.

  • RELEVANCY SCORE 3.84

    DB:3.84:Alter Type To Create A Unique Key 1a


    Hi everyone!I am trying to create a unique constraint using DQL. I want the system to validate if a value is unique and I don't want to use BOF. I beleive my syntax is incorrect! I already tried a lot of combinations and search for examples but nothing.I am using something like this:ALTER TYPE "xpto" ADD UNIQUE KEY (xpto_doc_number) REPORT Doc Number must be unique ON VIOLATION ENFORCE BY APPLICATIONMany thanksPaula

    DB:3.84:Alter Type To Create A Unique Key 1a

    I do realize the original post was made two year ago and we're now using 6.5 SP2, but I think the nature of the problem is the same. I can't get DA/WP to recognize the unique attribute.I've tried the following DQL, this one adds the unique value to the type:alter type com_asset drop unique ("com_asset_id");ALTER TYPE com_asset ADD UNIQUE (com_asset_id) REPORT 'Message of your Choice' ON VIOLATION ENFORCE BY APPLICATION PUBLISH;The query went through fine again, I ran data dictionary publishing job, restarted tomcat, and I'm still able to enter in duplicate values in WP.So I tried the following statement, this one adds the unique value to the attribute:ALTER TYPE com_asset MODIFY "com_asset_id" (DROP UNIQUE);ALTER TYPE com_asset MODIFY "com_asset_id" (ADD UNIQUE ("com_asset_id") REPORT 'Message of your Choice' ON VIOLATION ENFORCE BY APPLICATION) PUBLISH;The query went through fine again, I ran data dictionary publishing job, restarted tomcat, and I'm still able to enter in duplicate values in WP.Anyone have any idea on how this is suppose to be done? We implemented a unique index through MAKE_INDEX admin method, but throwing ORA-0001 every time there is a duplicate value is not a good/acceptable validation technique.Message was edited by: Jzi

  • RELEVANCY SCORE 3.84

    DB:3.84:Re: Best Data Structure For Performance? js


    but doesnt
    allow non-unique key values.Your keys should be unique!(?)

    DB:3.84:Re: Best Data Structure For Performance? js

    Hello,

    Just a couple of updates - i have decided to hold the sms in a data structure
    like HashMapString, ListDeliverSMSObjects

    where the string corresponds to the username of the client and the
    DeliverSMSObjects is the SMS object.

    i.e. the sms are grouped under the username and not based on MSISDN number, when each client connects hashmap is checked if it has key matching with client's username. if a key is available then the list of sms belonging to that username is sent across to the client.

  • RELEVANCY SCORE 3.78

    DB:3.78:Need To Set Unique Flag On Key Field In Custom Table f8



    Where can I set a unique flag on a key field in a custom table? I need to prevent duplicates based on this key field.

    DB:3.78:Need To Set Unique Flag On Key Field In Custom Table f8


    Thanks! I didnt have the field Unique on the form. Thanks for solving the mystery.

    Karen

  • RELEVANCY SCORE 3.78

    DB:3.78:Unique Key a3


    how many unique key passible in a table,
    i think that not more than 32.is i true/
    singhsiddh@yahoo.com

  • RELEVANCY SCORE 3.76

    DB:3.76:Re: Unique Constraint 7k


    Well to answer you ,its YES . This is one of the difference between a primary key and a unique key constraint is that unique can accept NULLS. Primary key is similar to Unique key with not null constraint enforced.

    DB:3.76:Re: Unique Constraint 7k

    Hi,That's right; PL/SQL uses NULL. As of my last message, no one was talking about PL/SQL. Since I was pointing OP towards the SQL documentation, which calls it UNKNOWN, I used the same word. It's helpful, especially in pure SQL, to understand the distinction between expressions and conditions. Expressions can be NULL, while conditions can be UNKNOWN.

  • RELEVANCY SCORE 3.74

    DB:3.74:Unique Key Domainrule In Ssis fd


    Does an Domainrule has an unique key that I can use in SSIS?
    A normal export from object 'DQS Cleansing' have only extra columns

    DB:3.74:Unique Key Domainrule In Ssis fd

    I think it's not an answer on my question.

  • RELEVANCY SCORE 3.74

    DB:3.74:How To Detect Unique Key Violation And Priamry Key Violation Seperately sm


    i want to detect unique key violation and primary key violation separately

    by using
    catch(SqlException ex)
    if(ex==2627)
    ///then some code

    but this number is same for unique key and primary key
    how to detect these two differently
    thanks

    DB:3.74:How To Detect Unique Key Violation And Priamry Key Violation Seperately sm


    Error 2627 is for constraint voilation including primary key)
    Error 2601 is unique key violation
    --------------------------
    SELECT * FROM sys.messages
    WHERE
    text like '%duplicate%' and text like '%key%'
    and language_id = 1033 --and text like '%violation%'Regards, RSingh

  • RELEVANCY SCORE 3.74

    DB:3.74:What Is Difference Primary Key And Unique+Not Null 98


    hi

    what is the difference primarykey and unique+notnull

    thanks
    prathyushmca@gmail.com

    DB:3.74:What Is Difference Primary Key And Unique+Not Null 98

    In principle and in practice they are the same. It is just a "feature" of SQL that it has two alternative syntaxes for creating candidate keys (with the essentially pointless limitation that you can only use the "PRIMARY KEY" constraint once per table).

  • RELEVANCY SCORE 3.74

    DB:3.74:Hi All cs


    if we create an unique key will it create an index

    DB:3.74:Hi All cs

    if we create an unique key will it create an indexEasy to test isn't it?

    SQL create table t
    as select empno from emp
    /
    Table created.

    SQL select index_name, uniqueness
    from user_indexes where table_name = 'T'
    /
    no rows selected.

    SQL alter table t add constraint t_uk unique (empno)
    /
    Table altered.

    SQL select index_name, uniqueness
    from user_indexes where table_name = 'T'
    /
    INDEX_NAME UNIQUENES
    ------------------------------ ---------
    T_UK UNIQUE
    1 row selected.

    SQL drop table t
    /
    Table dropped.so an index is created in this case.
    Difference comes when there's already an index available, which can be used by the constraint:

    SQL create table t
    as select empno from emp
    /
    Table created.

    SQL select index_name, uniqueness
    from user_indexes where table_name = 'T'
    /
    no rows selected.

    SQL create index t_uk on t (empno)
    /
    Index created.

    SQL alter table t add constraint t_uk unique (empno)
    /
    Table altered.

    SQL select index_name, uniqueness
    from user_indexes where table_name = 'T'

    INDEX_NAME UNIQUENES
    ------------------------------ ---------
    T_UK NONUNIQUE
    1 row selected.

    SQL drop table t
    /
    Table dropped.No additional index is created in this case.

  • RELEVANCY SCORE 3.74

    DB:3.74:Index ap


    Hello,

    Index from Oracle concept manual:

    Alternatively, you can define UNIQUE integrity constraints on the desired columns.
    Oracle enforces UNIQUE integrity constraints by automatically defining a unique
    index on the unique key. However, it is advisable that any index that exists for
    query performance, including unique indexes, be created explicitly.

    Why the unique index created by unique key constarint cannot be used for query purpose?

    Thanks.

    DB:3.74:Index ap

    Sybrand,

    First you complain because people don't read the manual, now you're complaining because this guy IS reading the manual and asking questions about the bits he doesn't understand.

    BSingh,

    Can I suggest the following strategy. Read the Concepts manual through - there will be lots of bits that don't quite make sense. Then read the basic Database Administrator's Guide - there will be bits that don't make sense, but it will fill a lot of holes in your understanding of the Concepts manual. Then read the SQL reference manual (but skip lightly through it) - looking particularly at things like "create table", "create index, create sequence" - this will fill a lot more holes.

    Then go back to the Concepts manual and read it again - you will be surprised how much more of it makes sense - and how few questions you will really need to ask. (You will also, alas, find bits where the three manuals contradict each other)

    This is a procedure I follow for every significant release of Oracle.

    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • RELEVANCY SCORE 3.74

    DB:3.74:Bridge Table Needs A Unique Key p8


    Hi!

    I have a scenario where a table can work as a bridge table however, this table do not have unique key. Is it important/mandatory for a bridge table to have a unique key?

    Thanks,
    Rakesh

    DB:3.74:Bridge Table Needs A Unique Key p8

    Rakesh,

    Usually bridge table is on the many side of the join, which implicitly conveys it holds foreign key.
    Thus when you have a bridge table in physical layer, defining the relationships between tables will automatically prompt for creating a foreign key on bridge table, hope this is suffice.

    mark answers promptly

    J
    -bifacts
    http://www.obinotes.com

  • RELEVANCY SCORE 3.74

    DB:3.74:Unique &Amp; Primary Key Constaints cm


    Does oracle creates indexes when we create unique primary key constaints?

    DB:3.74:Unique &Amp; Primary Key Constaints cm

    Hi Vijay,

    Yes, it will create indexes when we create unique primary key and by default PK will create with not null columns.

    Regs,
    Naresh

  • RELEVANCY SCORE 3.74

    DB:3.74:Unique Constraint And Primary Key 19


    In short , what are diffrences between primary key and unique constraint.
    I know both use unique indexes , but is there any difference
    thx

    DB:3.74:Unique Constraint And Primary Key 19

    Here are the differences:
    1). Primary keys do not allow NULLs. Unique constraint can have one NULL.2). There is only one primary key per table. Multiple unique constraints can be defined.3). By default when you create a primary key it is enforced by clustered index. By default unique constraint is enforced by non-clustered index.

    Plamen Ratchev

  • RELEVANCY SCORE 3.74

    DB:3.74:Problem Of Constraint, Primary Key, Unique Key, F-Key zm


    Hi
    Can anybody help me regarding the constraint, I want to attach primary key and unique key both in a column suppose customer_id, further I need the good free tutoriols addresses.
    pls. help me in this regard.

    thanks in advance.

    Roshan

    DB:3.74:Problem Of Constraint, Primary Key, Unique Key, F-Key zm

    Given that primary key enforces uniqueness already, you can achieve both by just defining your primary key.

  • RELEVANCY SCORE 3.74

    DB:3.74:What Is The Different Between Unique Constraint &Amp; Primary Key??? 7m


    Hi Every body...
    i 've a lettle question in database building...

    What is the different between Unique Constraint Primary Key ????

    waiting replays... ::)(::

    DB:3.74:What Is The Different Between Unique Constraint &Amp; Primary Key??? 7m

    thanks for all for replay...

    i gut the main diferent .. which is "Primary key couldn't ever 've any null value" but "Unique constraint can 've one"......

    Again more thanks for replaying me...

  • RELEVANCY SCORE 3.74

    DB:3.74:Unique And Primary Key 91


    column with unique constraint + not null constraint = primary key! (to some extent) Is it correct?
    I invite your ideas

    DB:3.74:Unique And Primary Key 91

    It acts as a primary key. As per rule a table can be defined with only one primary key but a primary key may be the combination of 1 or more fields in case of more than 2 it can be called as compositer primary key
    Ok
    Baba

  • RELEVANCY SCORE 3.73

    DB:3.73:Internal Table Non-Unique Key Consequences x1



    Hi Experts

    I have a i_tab which is defined as follows:

    i_tab TYPE STANDARD TABLE OF TAB_STRUCTURE
    WITH HEADER LINE
    WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0

    DB:3.73:Internal Table Non-Unique Key Consequences x1


    Try to change this way

    LOOP at i_tab.
    v_tabix = sy-tabix
    READ TABLE NEW_DATA WITH KEY
    oi_ebeln = DATA_PACKAGE-doc_num
    oi_ebelp = DATA_PACKAGE-doc_item
    sched_line = DATA_PACKAGE-sched_line
    conf_line = i_tab-conf_line
    BINARY SEARCH.
    IF sy-subrc = 0.
    Move-corresponding new_data to i_tab.
    " Here after the read your sy-tabix value get changed so use v_tabix instead of sy-tabix
    modify i_tab index v_tabix " .
    ENDIF.
    ENDLOOP.

  • RELEVANCY SCORE 3.73

    DB:3.73:How To Manage Unique Key ? ka


    My table has a unique key ... but OWM prevents version enabling
    of a table which has a unique key.

    Before version enabling the unique key means: a same value
    cannot be used twice.

    After version enabling it should mean: a same value cannot be
    used twice at the same time .

    How to manage such a situation ?

    Thank you.

    DB:3.73:How To Manage Unique Key ? ka

    Arun,

    Thanks for the info. That would seem to be the most logical approach. Looking forward to giving it a test drive.

    Matt.

  • RELEVANCY SCORE 3.73

    DB:3.73:How To Generate A Unique Key Based On A Some String Value f1


    Hello every one,

    I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..

    For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..

    Is there any way we can get the unique value using Java ?

    Thanks

    DB:3.73:How To Generate A Unique Key Based On A Some String Value f1

    Friends,

    I found the answer for my question.. It is very simple.. String.hashCode() will return a Unique hash code value based on JVM ...

    Cheers

  • RELEVANCY SCORE 3.73

    DB:3.73:Does Adf Business Components Work Well With Tables Without Primary Key? sa


    We have tables using unique index without primary key. Can ADF Business Components relate business objects based on the unique index columns of the tables?

    DB:3.73:Does Adf Business Components Work Well With Tables Without Primary Key? sa

    We have tables using unique index without primary key. Can ADF Business Components relate business objects based on the unique index columns of the tables?

  • RELEVANCY SCORE 3.73

    DB:3.73:Constraint m3


    The Employee table contains EmployeeID,LoginID,Name,Title attributes.the EmployeeID and LoginID contain unique values. EmployeeID attribute has been chosen as the primary key. Which type of key (Candidate Key/Foreign Key/Alternate Key/Unique Key) can be defined on the LoginID attribute ?

    DB:3.73:Constraint m3

    Hi,
    Which type of key need to be defined on the LoginID attribute depends on the relationship of the tables in the database.
    T-SQL question like this one, please post in this forum: http://social.technet.microsoft.com/Forums/en-US/transactsql/threads
    Our mates there will be glad to provide help.
    Thanks.Yao Jie Tang -Microsoft Online Community

  • RELEVANCY SCORE 3.73

    DB:3.73:Primary Key And Unique Key cm


    Hi All,

    Pls anyone clarify my doubt.

    What is the difference between Primary key

    and Unique key with not null constraint.

    If both are same , why shoud we need to declare primary key?

    Thanks in advance,
    rampa.

    DB:3.73:Primary Key And Unique Key cm

    refer this thread...

    Primary Key and Unque Key

  • RELEVANCY SCORE 3.73

    DB:3.73:Unique Key Versus Index On Sql Server 2008 When Defining A Column To Be Unique kk


    I have a table named countries and i define the country_name column to be unique by creating a “Index/Key” of type “Unique Key” on sql servwer 2008 r2. but i have the folloiwng question:-

    will creating “Index/Key” of type “Unique Key” ; automatically creats a non-clustered index on this column?if i change the type from being “Unique Key” to Index and i keep the Is Unique value to be Yes,, then will there be any differences ?

    DB:3.73:Unique Key Versus Index On Sql Server 2008 When Defining A Column To Be Unique kk

    I'm pretty sure Louis would be able to explain it much better than I am. :)
    When you convert business requirements into the working system, as the first step you're working with the logical model. You are dealing with entities and attributes, relations between entities, keys, etc. That model is kind of database (or data storage)
    independent.
    Physical database design is done based on the logical model and goes to the object levels (tables, indexes, etc). On that stage you start to take database server implementation details into consideration. Physical database schema does not necessarily exactly
    maps logical schema - for example, you can decide to store logical entity in the multiple tables, denormalize the schema and so on.

    In real life, of course, logical and physical design stages often mixed with each other. That approach has own pros and cons which is subject of completely different conversation.

    What I tried to say - there is no difference in SQL Server physical implementation between unique constraint and unique index. SQL Server uses unique nonclustered index internally to force uniqueness of unique constraint. Unique constraint/key much
    closer conceptually to the logical design while unique index is purely physical design concept. While forcing uniqueness via unique constraint is cleaner from the logical model standpoint, using unique index instead adds some flexibility for the future performance
    tuning.
    Again, it's up to you what to choose - just a matter of personal preferences. And, of course, you can always start with unique constraint and later replace it with unique index if needed.
    Thank you!
    My blog: http://aboutsqlserver.com

  • RELEVANCY SCORE 3.73

    DB:3.73:Unique Key Generation kk


    All:

    If I obtain a KeyGenerator using the most simple methods (i.e. defaulting to DES and init() only with key size), am I gauranteed that the keys that are generated will be unique? If not, what is the likelihood of a key collission? And, in what ways can I accomplish unique generation?

    Thanks,
    Scott

    DB:3.73:Unique Key Generation kk

    Thanks very much for your reply!

    I'm wondering, you say when using a "proper secure prng". If you have a moment could you clarify this and possibly give a bit of code that does so? Will the default prng be satisfactory for this?

    Thanks,
    Scott

  • RELEVANCY SCORE 3.73

    DB:3.73:Why Do We Need Primary Key In A Database? 8s


    I am looking for the best shortanswers.
    Let's disregard for the momentthat FOREIGN KEY reference can be setup to UNIQUE KEY and unique index columns since they are used infrequently for special reasons or by mistake.
    The SS implementation of PRIMARY KEY is NOT NULL unique index column (default clustered).
    There can only be one PRIMARY KEY on a table while no such restriction on UNIQUE KEYs and unique indexes.

    Kalman Toth SQL 2008 GRAND SLAM
    Paperback: Pass SQL Exam 70-461 Job Interview: Programming SQL Server 2012

    DB:3.73:Why Do We Need Primary Key In A Database? 8s

    I like what Rui and Tom wrote. I've been using Access since 1999, and SQL Server since 2009, and I don't think I have ever used a PK. I learned what a PK is right around the time I first started using databases, but I never 'needed' a PK.
    I can certainly understand the critical need for a PK, but almost all of my work over time has been importing/exporting financial data to/from databases and spreadsheets. Sometimes I'd happen to have a unique identifier (CUSIP) in some of the Tables,
    but the CUSIP wasn't used much, and even if it was, I was never doing cascade updates and cascade deletes on the data. Nevertheless, I can see the obvious need for such a thing if you are dealing with customer data, in which case a unique identifier
    is essential!!!

  • RELEVANCY SCORE 3.71

    DB:3.71:Re: How Can I Read Xml Definition Files For Bc4j? 81


    Presently BC4J only support unique key enforcement on the primary key, so effectively all attributes marked as unique are considered part of a single, concatenated unique key.

    DB:3.71:Re: How Can I Read Xml Definition Files For Bc4j? 81

    They will be on the EntityDefImpl and AttributeDefImpl classes respectively.

  • RELEVANCY SCORE 3.71

    DB:3.71:Re: Is Their A Difference Between Primary Key And Unique Key With Not Null Valu ds


    In fact none, the constraint is the same. But table can have only one primary key, but many unique keys.

    DB:3.71:Re: Is Their A Difference Between Primary Key And Unique Key With Not Null Valu ds

    SBH wrote:
    For quick review, below is the link

    http://www.dba-oracle.com/data_warehouse/clustered_index.htmYou appear to have stumbled on a site that is a mine of disinformation about Oracle.

    It would be helpful, if you explain it too..thnx !!The site is wrong and makes up its own terminology as it goes along.

    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_searchword=clustered+index

    There is no create clustered index in Oracle.

    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • RELEVANCY SCORE 3.71

    DB:3.71:Re: Primary Key And Unique Key jz


    Hi ,

    if user entered duplicate values in the column of any table after that if developers/ DBA wanna ALTER table by usonh primary key constraint or unique key constraint

    It will not be allowed Some ORA erroe will appear

    2) You cannot enter more that one null value in columns having UNIQUE KEY constraint

  • RELEVANCY SCORE 3.71

    DB:3.71:Re: Commit Delete Before Insert When Having Unique Key. pj


    Hiyou can definite alternate key for unique key constarint on Entity .Zeeshan Baig's Blog: Defining Unique Key Constraints for Non-Primary Key Attributes in ADF-BCwhat is ur usecase here?if you want delet the existing key are you calling commit?

    DB:3.71:Re: Commit Delete Before Insert When Having Unique Key. pj

    I also have custom validator to display the error message to the user.

  • RELEVANCY SCORE 3.70

    DB:3.70:Unique Key kc


    Does the creation of a unique key on a column create a unique index or any index at all.
    Please help in solving the query as it urgent.

    Regards.

  • RELEVANCY SCORE 3.69

    DB:3.69:Query In Foreign Key ad


    When we create a foreign key is it mandatory the referred column should be a Primary or Unique Key. Can't I refer any column without any unique key in it.

    DB:3.69:Query In Foreign Key ad

    user13024762 wrote:
    When we create a foreign key is it mandatory the referred column should be a Primary or Unique Key. Can't I refer any column without any unique key in it.no, you can't

  • RELEVANCY SCORE 3.69

    DB:3.69:Re: Function In Unique Key 8d


    You want a DATE column in that case...

    DB:3.69:Re: Function In Unique Key 8d

    thanks APC, I learnt something new today! I hope you too ;-)Laurent, I think I always learn something when I read one of your posts.

    Cheers, APC

  • RELEVANCY SCORE 3.68

    DB:3.68:Unique Key? fs


    Dear all,

    I have the problem to dealing with unique key. The following is one of the unique key and column of "DOC_NO"
    can be nullable and it works.

    ALTER TABLE CSS_BILL_HDR ADD (
    CONSTRAINT CSS_BIHD_UK1 UNIQUE (DOC_NO) ENABLE);

    Now, I have to add one column named as "SYSTEM_CODE" which is not null field and I need to alter the unique key constraint. It looks like the following and the error occurs:

    ALTER TABLE CSS_BILL_HDR ADD (
    CONSTRAINT CSS_BIHD_UK1 UNIQUE (SYSTEM_CODE,DOC_NO) ENABLE);

    Do anyone knows what is happening?

    Thanks

    DB:3.68:Unique Key? fs

    My guess would be that doc_no has some null values. with a single column UNIQUE constraint, this is fine.

    SQL CREATE TABLE t as SELECT ROWNUM id,ROWNUM id2, object_name
    2 FROM all_objects
    3 WHERE ROWNUM 21;

    Table created.

    SQL INSERT INTO t
    2 SELECT ROWNUM + 20,ROWNUM,object_name
    3 FROM all_objects
    4 WHERE ROWNUM 11;

    10 rows created.

    SQL COMMIT;

    Commit complete.

    SQL UPDATE t SET id = NULL
    2 WHERE id2 in (1,5,9);

    6 rows updated.

    SQL COMMIT;

    Commit complete.

    SQL ALTER TABLE t ADD CONSTRAINT t_unq UNIQUE (id);

    Table altered.So, each of the NULLS are unique, at least for purposes of the constraint. However, I do have duplicate values in the id2 column where id is null so:

    SQL ALTER TABLE t drop CONSTRAINT t_unq;

    Table altered.

    SQL ALTER TABLE t ADD CONSTRAINT t_unq UNIQUE (id,id2);
    ALTER TABLE t ADD CONSTRAINT t_unq UNIQUE (id,id2)
    *
    ERROR at line 1:
    ORA-02299: cannot validate (OPS$ORACLE.T_UNQ) - duplicate keys foundSo, a single null column does not invalidate a single column UNIQUE constraint, however, NULL plus a duplicated value does invalidate a two column UNIQUE constraint.

    TTFN
    John

  • RELEVANCY SCORE 3.68

    DB:3.68:Primary Key Vs Unique Key k9


    Hello,

    What is the best practise to create a Primary key? Should I create a system generated unique key for Primary Key or a natural identifier /unique key to represent Primary key. What are the benefit and drawback on use of these. ? Does Oracle has any best practise identified on this matter? I will appreciate any link/doc .

    Thanks
    Syed

    DB:3.68:Primary Key Vs Unique Key k9

    Hello,
    What is the best practise to create a Primary key? Should I create a system generated unique key for Primary Key or a natural identifier /unique key to represent Primary key. What are the benefit and drawback on use of these. ? Does Oracle has any best practise identified on this matter? I will appreciate any link/doc .The difference between an unique and primary key is that in a primary key non-null values are not
    allowed. Oracle automatically creates indexes to protect the integrity of the columns.

    You should, usually, define the key on the column yourself if for no other reason than to make it
    meaningful.

    William Coldiron

  • RELEVANCY SCORE 3.67

    DB:3.67:Diferneces B/W Unique And Primary Key mx


    can any one give me 3 diferences b/w unique and primary key.

    DB:3.67:Diferneces B/W Unique And Primary Key mx

    The 3 differences between unique key and primary key are:

    1.) Unique key allows null values whereas primary key do not allow nulls.
    2.) Unique key can be changed where it is not allowed to change primary key once the table is created and constraints are defined.
    3.) There is only one primary key attached to a table where as there can be more than one unique key attached to a table.

  • RELEVANCY SCORE 3.66

    DB:3.66:Primary Key And Unique Key f3


    Why do I need to create primary key in table.
    Till now my understanding was using primary key is unique+ notnull and I can set the relationships amongst the table but
    same can be achieved using unique key.

    So under what scenarios we should go for primary key

    DB:3.66:Primary Key And Unique Key f3

    Why reply to an eight month old thread?

  • RELEVANCY SCORE 3.66

    DB:3.66:How Can I Define An Attribute As Primary Or Unique Key? ca


    How can I define an attribute as primary or unique key?I could not find it in the documentation nor in the Developer Studio.

    DB:3.66:How Can I Define An Attribute As Primary Or Unique Key? ca

    This is the default behavior. The settings in the data dictionary are NOT enforced by the server. The client application is responsible to comply with the restrictions.

  • RELEVANCY SCORE 3.65

    DB:3.65:Re: Difference Between Unique Key And Unique Index cs


    Surprisingly, my Index IX1 was automatically droppedThat is documentaed.

    DB:3.65:Re: Difference Between Unique Key And Unique Index cs

    For the purpose of this, that satisfies by index scaning or table full scaning.

    Well, it will always use an index (it requires one) but that index does not have to be unique.

  • RELEVANCY SCORE 3.65

    DB:3.65:Can Anay Body Let Me Know Exactly Difference B/W Surrogate Key, Unique Key And Primary Key 89



    what is exactly difference b/w surrogate key, unique Key and Primary Key

    DB:3.65:Can Anay Body Let Me Know Exactly Difference B/W Surrogate Key, Unique Key And Primary Key 89


    Hi Murali,

    Surrogate Key - Running Number without Null

    Unique Key- Distinct Value incuding 1 null

    Primary Key - Distinct Value without Null

    Thanks,

    Suresh

  • RELEVANCY SCORE 3.64

    DB:3.64:Unique Property Of Entity Attributes 9j


    How does the unique property of entity attributes work? If I check two attributes as "unique", does it assume that the combination of the two attributes is unique (i.e. equivalent to a database unique key with attr1, attr2) OR does it assume both are individually unique? If the later, how do I enforce the earlier constraint (i.e. a unique key with two attributes)?

    Thanks,
    Bill

    DB:3.64:Unique Property Of Entity Attributes 9j

    How does the unique property of entity attributes work? If I check two attributes as "unique", does it assume that the combination of the two attributes is unique (i.e. equivalent to a database unique key with attr1, attr2) OR does it assume both are individually unique? If the later, how do I enforce the earlier constraint (i.e. a unique key with two attributes)?
    Thanks,
    Bill BC4J does not "enforce" unique property on entity-attributes at runtime by default. It's used only for forward generation of database constraints in a table. However if PK attributes are to be unique, you can choose to enforce it in Bc4j by applying the Unique Key validator on an entity.

  • RELEVANCY SCORE 3.64

    DB:3.64:Primary Key And Unique jj


    If i already set a column as primary key, is there no need to apply unique again?

    If applying both primary key and unique, will it affect performance?

    Regards,
    Jimmy

  • RELEVANCY SCORE 3.64

    DB:3.64:Re: Primary Key And Unque Key xc


    A primary key cannot be null and there can be only one.

    we use a unique key to enforce unique data in a table? Yes we do.

    DB:3.64:Re: Primary Key And Unque Key xc

    william

    Actually i didnt reply to you it was to the USER but .....i didnt suggest anything