<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Duplicate entries for same primary key in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763047#M330091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidya,&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  Strictly speaking we cannot do that. That is the concept of primary key to have only one unique key. Is that standard table ? if it is so then check whether it has secondary keys along with the primary key which is calle das composite key, If this is the case then the database table will check for the entire composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know whether you understood this or not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran I&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Dec 2006 11:20:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-15T11:20:14Z</dc:date>
    <item>
      <title>Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763046#M330090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing problem to insert 2 or more than 2 entries for same PRIMARY KEY in the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I know that we can&amp;#146;t do that. But Client has given me the XL sheet which contains 2 entries for same primary key. How can it be done? Please let me know how can I insert 2 data for same primary key in database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for your answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prasanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 11:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763046#M330090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T11:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763047#M330091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidya,&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  Strictly speaking we cannot do that. That is the concept of primary key to have only one unique key. Is that standard table ? if it is so then check whether it has secondary keys along with the primary key which is calle das composite key, If this is the case then the database table will check for the entire composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know whether you understood this or not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran I&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 11:20:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763047#M330091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T11:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763048#M330092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt;  This is not possible , beacuse it ruins the basic purpose of having a primary key if we can have multiple entries with the same primary key.&lt;/P&gt;&lt;P&gt;Discuss the same with the client , may be this can be an error in the excel file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 11:40:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763048#M330092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T11:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763049#M330093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There may be 2 primary keys in that table , though one of them is duplicated the other one may be ubique&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Primary key1  Primary key2

  111                  abc
  222                  abc&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 11:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763049#M330093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T11:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763050#M330094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't rely on the spreadsheet supplied by the customer. You have to look at the data (SE11 or SE16).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Dec 2006 14:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763050#M330094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-15T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763051#M330095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Just make one more unique field as a part of primary key. That will solve your problem. (If you can do that?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Example&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Table1 &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;   F1(pk) -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;    F2(pk)------      F3 -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;     F4      &lt;/P&gt;&lt;P&gt;   1  -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;     1 -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;    1 -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; A&lt;/P&gt;&lt;P&gt;   1  -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;     1 -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;    2 -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   You can make field F3 also part of the primary key (If that&amp;#146;s possible). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Or &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   Data may be wrong. Primary keys in RDBMS are based on set theory. By definition set is a collection of unique elements. So it cannot be possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 06:51:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763051#M330095</guid>
      <dc:creator>VinayPrasad_PM</dc:creator>
      <dc:date>2006-12-17T06:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763052#M330096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You can achieve this .... All you have to do is to add a new field (a Sequence Number ) to the table. This number will be incremented for each duplicate primary keys. For example....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the excel file has duplicate entries 3 primary keys. Now you add a new field named Sequence Number in your DB Table.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you load the data into Database...then the records will look like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key1     Key2    Key3    Seq&lt;/P&gt;&lt;P&gt;A          B          C           1&lt;/P&gt;&lt;P&gt;A          B          C           2&lt;/P&gt;&lt;P&gt;A          B          D           1&lt;/P&gt;&lt;P&gt;A          B          D           2&lt;/P&gt;&lt;P&gt;A          C          D           1&lt;/P&gt;&lt;P&gt;A          C          E           1&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  and so on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this solves your purpose.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever there are duplicate entries, such as the one mentioned in your scenario, then a new field can be added in Database. This field acts like a count or sequence number.... Thus you can maintain unique records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 07:07:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763052#M330096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-17T07:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate entries for same primary key</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763053#M330097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vidya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without adding additional fields into the DB Table, this would not be possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramki.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 12:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/duplicate-entries-for-same-primary-key/m-p/1763053#M330097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-17T12:36:03Z</dc:date>
    </item>
  </channel>
</rss>

