Problem with varchar2 primary key..

OWM version 10.1.0.8
When I am trying to add a column in a version enable table with varchar2 primary key, it fails.
If primary key is numeric it works.
See below the test case.
-- CASE 1. When primary key is number.
SQL> create table wmtab
( wmtab_id number,
price number,
title varchar2(80),
AUTHOR VARCHAR2(10)
Table created.
SQL> ALTER TABLE wmtab add (CONSTRAINT PK_kontakt PRIMARY KEY (wmtab_id));
Table altered.
SQL> EXECUTE DBMS_WM.EnableVersioning('WMTAB');
PL/SQL procedure successfully completed.
SQL> CALL DBMS_WM.BEGINDDL('WMTAB');
Call completed.
SQL> ALTER TABLE wmtab_lts add ( FREIGEGEBEN varchar2(1));
Table altered.
SQL> CALL DBMS_WM.commitDDL('WMTAB');
Call completed.
-- CASE 2. When primary key is varchar2.
SQL> create table wmtab
(wmtab_id varchar2(10) constraint wmtab_pk primary key,
price number,
title varchar2(80),
AUTHOR VARCHAR2(10)
Table created.
SQL> EXECUTE DBMS_WM.EnableVersioning('WMTAB');
PL/SQL procedure successfully completed.
SQL> CALL DBMS_WM.BEGINDDL('WMTAB');
Call completed.
SQL> ALTER TABLE wmtab_lts add ( FREIGEGEBEN varchar2(1));
Table altered.
SQL> call DBMS_WM.CommitDDL('wmtab');
call DBMS_WM.CommitDDL('wmtab')
ERROR at line 1:
ORA-20199: primary key columns cannot be added/dropped/modified/reordered for
version enabled tables
ORA-06512: at "SYS.OWM_DDL_PKG", line 6196
ORA-06512: at "SYS.LT", line 11930
ORA-06512: at line 1
Same problem is reprosucible on OWM 10.2.0.1.
But its working fine with varchar2 primary key On OWM 10.2.0.4.2/3
Is there any workaround or we can get patch for 10.1.x.x?

Hi,
I was unable to reproduce this behavior on OWM 10.1.0.8. It appears that you have a SR open for this issue, so I would suggest to continue with that process.
Regards,
Ben

Similar Messages

  • Problem with Sting Primary Key

    I have probleme with Sting Primary Key
    when i create new row
    System.out.println("is new:" + acct.getEntityState());
    show 1 - this row is not new
    why?

    Hi,
    I was unable to reproduce this behavior on OWM 10.1.0.8. It appears that you have a SR open for this issue, so I would suggest to continue with that process.
    Regards,
    Ben

  • Problem with a primary key when creating a new record in Forms

    My table has a field - MDD_KEY - that is a primary key. It is updated from a sequence with a before-insert database trigger. I know this works properly as the primary key was accurately populated when I inserted 1433 records.
    In Forms 6, I have a form based on that table. I have set the mdd_key as a hidden field because I assume it will be entered by the before-insert trigger. However, when I enter data into the table, and then try to save it, I get a FRM-40202: Field must be entered. - followed by - FRM-40222: Disabled item MDD_KEY failed validation.
    If I set DATA Required to no, when I try to save I get an FRM-40600: Record has already been inserted - but no such record exists in the database. I know this record is unique and does NOT exist because I deliberately made it up.
    In the property palatte, the attributes of the field are:
    DATA Data Type Number
    Required Yes
    DATABASE Database Item Yes
    Primary Key Yes
    Query Only No
    Query Allowed Yes
    Query Length 0
    Insert Allowed Yes
    Update Allowed Yes
    Update Only if Null No
    Lock Record No
    I assume that my problem is that with a new record, the form wants to see the MDD_KEY populated before it saves - but that isn't going to happen until the before insert trigger fires in the database. I assume I have to populate that field within forms, but how do I do that without messing up the database trigger/sequence? I will have to load more data directly into the database - so I need the database trigger in place.
    I have not used primary keys before so I am more than a little bit confused about how and when it should be populated when a new record is created in Forms.
    Any help would be appreciated as I cannot enter new data into my form (works well with existing data).
    Thanks
    Glenn

    hi
    if u have any problem using seq then try that statemetn ur block level in ur form
    PRE-INSERT trigger
    select nvl(max(nvl(srno,0)),0)+1 into :srno from tablename;
    Rizwan

  • Problem with the primary key

    Hi All,
    I have a table with the same data repeating 2 times. I mean the rows are depating twice. so now I am creating primary key to the table. It is throwing me an error saying primary key voilation. I will provide the clear scenario.
    create table Employee(
    ID VARCHAR2(4 BYTE) NOT NULL,
    First_Name VARCHAR2(10 BYTE),
    Last_Name VARCHAR2(10 BYTE),
    Start_Date DATE,
    End_Date DATE,
    Salary Number(8,2),
    City VARCHAR2(10 BYTE),
    Description VARCHAR2(15 BYTE)
    insert into employee values ('01','Jason', 'Martin', to_date('19960725','YYYYMMDD'), to_date('20060725','YYYYMMDD'), 1234.56, 'Toronto', 'Programmer');
    insert into employee values ('02','Alison', 'Mathews', to_date('19760321','YYYYMMDD'), to_date('19860221','YYYYMMDD'), 6661.78, 'Vancouver','Tester');
    insert into employee values ('03','James', 'Smith', to_date('19781212','YYYYMMDD'), to_date('19900315','YYYYMMDD'), 6544.78, 'Vancouver','Tester');
    insert into employee values ('04','Celia', 'Rice', to_date('19821024','YYYYMMDD'), to_date('19990421','YYYYMMDD'), 2344.78, 'Vancouver','Manager');
    insert into employee values ('05','Robert', 'Black', to_date('19840115','YYYYMMDD'), to_date('19980808','YYYYMMDD'), 2334.78, 'Vancouver','Tester');
    insert into employee values ('07','David', 'Larry', to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78,'New York', 'Manager');
    insert into employee values ('06','Linda', 'Green', to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78,'New York', 'Tester');
    insert into employee values ('08','James', 'Cat', to_date('19960917','YYYYMMDD'), to_date('20020415','YYYYMMDD'), 1232.78,'Vancouver', 'Tester')
    insert into employee values ('07','David', 'Larry', to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78,'New York', 'Manager');
    insert into employee values ('06','Linda', 'Green', to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78,'New York', 'Tester');
    Now the table is with 10 columns
    ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
    01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer
    02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester
    03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester
    04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager
    05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester
    06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester
    07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager
    08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver ester
    Creating Primary key to the table
    "ALTER TABLE employee PRIMARY KEY ( ID, First_Name, Last_Name, Start_Date, End_Date,
    Salary, City, Description );"
    I am getting primary key voilation error
    IS THERE ANY WAY TO CREATE PRIMARY KEY ON THE TABLE WITH OUT DELETING THE DATA?
    iS IT POSSIBLE CREATING PRIMARY KEY BY USING 'GROUP BY' FUNCTION OR ANY OTHER FUNCTIONS?
    Edited by: user11872870 on Sep 23, 2010 5:41 PM

    user11872870 wrote:
    Actually there is a small mistake in the question. The table is having the data as
    ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
    01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer
    02 Alison Mathews 21-MAR-76 21-FEB-86 6661.78 Vancouver Tester
    03 James Smith 12-DEC-78 15-MAR-90 6544.78 Vancouver Tester
    04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager
    05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester
    06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York Tester
    07 David Larry 31-DEC-90 12-FEB-98 7897.78 New York Manager
    08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver ester
    05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver "NULL"
    06 Linda Green 30-JUL-87 04-JAN-96 4322.78 New York "NULL"
    There is a null in the duplicate data.....
    As there is NULL in the data It is not allowing me to add the primary key to the table.....
    I am just looking if there is any other way to create primary key with the same data....the reason for the null not allowing you to have unique records is because null means "unknown". I could go into this in more depth but....
    ...again - we need to ask, why do you have linda green and robert black in there twice.
    if you really do need those two extra rows, then create another column with a unique ID using a sequence and make that the primary key. a primary key uniquely identifies a row. for this data I don't see any reason whatsoever to create a composite key like you are attempting.
    by trying to make the entire row a primary key it is clear your understanding is severely lacking.

  • Problem With Compound Primary Key

    Hello Experts,
      i am facing some probelm with copound primarykey.
      the Probelm is
    i have data base table which has compound primary key  for that one i have created the entity bean(CMP) and primary key of type compound.using this i am able to insert record into databse but for updation i am using
    <b>findbyPrimarykey()</b> method ,for that methos i am passing
    primary key object with compound key values.
    when i am executing this methos it is throwing <b>nosuchobject exception.</b>
    what might be the problem
    any help will be appriciated
    thanks in advance
    With Regds
    Naidu

    Hi,
    Is ur compound primarykey class is something like this?
    public class PrimaryKey implements java.io.Serializable {
          public String id = "";
          public int no = 0;
          //a default constructor is required:
          public PrimaryKey() { }
          // optional constructor fo clients:
          public PrimaryKey(String id, int no) {
               this.id = smsId;
               this.no = no;
          public String toString() {
               return id + "" + no;
         public boolean equals(Object obj) {
              if (obj == null || !(obj instanceof PrimaryKey))
                      return false;
                   else if ((((PrimaryKey)obj).no == no) && (((PrimaryKey)obj).id.equals(id)))
                      return true;
                   else
                      return false;     
          public int hashCode() {
                return id.hashCode() + no ;

  • Problems with concatenated primary key

    Hi all,
    I am trying to create cache groups of single tables. When I create a cache group (using the browser based cache admin tool) for a table that has a single row primary key, there are no problems. After creating the cache group I can go to TTISQL and issue a select statement of that table to see all the rows.
    However if I create a Cache group in the same way for a table that has a concatenated primary key (using two columns), TimesTen does indeed says that the cache group is created, but then when I issue a SELECT statement for that table in TTISQL, I get "0 rows returned".
    What could be going wrong ? Please advice.
    Thanks in advance

    if you describe the cache group in ttIsql (just enter 'cachegroups;' and hit return) what do you see?
    What message do you get back if you load the cache group in ttIsql:
    load cache group <cgname> commit every 100 rows;

  • Problem with capturing Primary Key Index

    Hi
    I am capturing certain tables and in the mean process i observed that all the indexes are getting captured except the primary key index.
    Any Suggestions on this?
    Thanx,
    Suji

    Hi,
    I was unable to reproduce this behavior on OWM 10.1.0.8. It appears that you have a SR open for this issue, so I would suggest to continue with that process.
    Regards,
    Ben

  • Insert values of form on a table with compound primary keys in APEX

    Good evening,
    I have a table with compoud primay keys. On ER model I had a many to many relation and when I coverted to relational model I've got a table with the primary keys of the two entities.
    My problem now is that I am trying to build an APEX application with a Form/Report and I want to insert a tuple both on the "entity" and on the table with two primary keys.
    I created a trigger with
    CREATE OR REPLACE TRIGGER ins_key_elem
    INSTEAD OF INSERT
    ON v_key_elem
    REFERENCING NEW AS NEW
    FOR EACH ROW
    BEGIN
    INSERT INTO elem_type (elem_key, type_key)
    VALUES (:NEW.elem_key, :NEW.type_key);
    INSERT INTO elem(elem_key, name)
    VALUES (:NEW.elem_key, :NEW.name);
    END;
    Is that ok? If it is, now how I can use that trigger to do what I need? i.e. insert the tuple on the two tables when I use the create button of the form
    Edited by: 934530 on May 15, 2012 2:36 PM

    Nevermind...figured it out. Was able to set the value on the Report Attributes page.

  • Updating a table with no Primary key

    What I am trying to find out is if you can uniquely update a single record in a table that has no primary key. I see no way to reference the record I want, other than specifying all the field values in a where clause. This is a problem though, because if I have another record with the same field values, that will get updated too. (I know its a bad database design, but some people do it and I need to work around it!!!), there are some situations where you would have identical records as far as a where clause is concerned, for example, you cant use a blob in a where clause so that might be where your records differ...
    In SQLServer 2000, Enterprise manager throws an error if you have a table with no primary key and duplicate records that you try to update through the GUI. EM uses stored procedures to execute updates, and it rolls back ones which result in more than one update result.
    Im not too familiar with Cursors in SQL, only that they are quite slow and not implemented on all DB products. But I think that they might be able to solve the problem (but I dont logically see how).
    Can anybody explain this to me?

    another record with the same field valuesIf you have two records and all the field values are the same then the records are logically the same anyways, so it shouldn't matter if you update both (one would question why there are two records in the first place.) In other words there is no way, either computationally or manually to tell them apart.
    I suspect that that is rather rare. Instead what is more likely is that you are only using some of the fields. So just keep adding fields until it is unique.

  • How to Work with Composite Primary Key

    Hi All,
    I'm working with Toplink JPA. Here I have A problem with inserting into database table which have composite Primary Key.
    What I'm doing is, I have two tables. to maintain many to many relation between these two tables I created another intermediate table which consists of foreign Keys (reference) of above two tables.
    Now these two foreign Keys in the Intermediate table made as composite Primary Keys.
    When I'm trying to the data in the Intermediate table I'm getting the foreign Keys values are null..
    could anyone suggest me how to work with composite Primary Keys
    Thanks,
    Satish

    I have the same problem, I have 3 tables with a join table joining them all. I have created an intermediate table entity. When I go to create a an entry, it says that I cannot enter null into "ID". Here is the SQl toplink generates:
    INSERT INTO Z_AUTH_USER_AUTHORIZATION (CONTEXT_ID, AUTHORIZATION_ID, USER_ID) VALUES (?, ?, ?)
    bind => [null, null, null]
    Here are the classes:
    -----------------------Join Table-----------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER_AUTHORIZATION")
    public class AuthUserAuthorization implements Serializable{
    @EmbeddedId
    private AuthUserAuthorizationPK compId;
    // bi-directional many-to-one association to AuthAuthorization
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "AUTHORIZATION_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthAuthorization authAuthorization;
    // bi-directional many-to-one association to AuthContext
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "CONTEXT_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthContext authContext;
    // bi-directional many-to-one association to AuthUser
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "USER_ID", referencedColumnName = "ID", nullable = false, insertable = false, updatable = false)
    private AuthUser authUser;
    ---------------------------------------User table--------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_USER")
    public class AuthUser implements Serializable, IUser{
    @Id()
    @SequenceGenerator(name = "AUTH_USER_ID_SEQ", sequenceName = "Z_AUTH_USER_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_USER_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 10)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authUser", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    -----------------------------------Context table-----------------------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_CONTEXT")
    public class AuthContext implements Serializable, IContext{
    @Id()
    @SequenceGenerator(name = "AUTH_CONTEXT_ID_SEQ", sequenceName = "Z_AUTH_CONTEXT_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_CONTEXT_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authContext", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    ----------------------------Authorization table-------------------------------------------------
    @Entity()
    @Table(name = "Z_AUTH_AUTHORIZATION")
    public class AuthAuthorization implements Serializable, IAuthorization{
    @Id()
    @SequenceGenerator(name = "AUTH_AUTHORIZATION_ID_SEQ", sequenceName = "Z_AUTH_AUTHORIZATION_ID_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "AUTH_AUTHORIZATION_ID_SEQ")
    @Column(name = "ID", unique = true, nullable = false, precision = 8)
    private Integer id;
    // bi-directional many-to-one association to AuthUserAuthorization
    @OneToMany(mappedBy = "authAuthorization", fetch = FetchType.EAGER)
    private java.util.Set<AuthUserAuthorization> authUserAuthorizations;
    I have tried to create the new entity several ways. I have tried to create one with the default constructor then set this entity on each of the other entities, I have also tried to pass in the entities to the join entity and set them there, but this doesn't work. Any help would be very appreciated!
    Thanks,
    Bill

  • Problem with the volume keys on my keyboard.

    Hey everybody,
    I have a problem with the volume keys on my keyboard. This started a couple days ago and I can't seem to figure out how to fix it. When I press the volume up or down buttons, the graphic appears on the screen as it normally would, but has no effect on the volume of the sound coming out of my speakers.  Therefore, the only way to change the volume of music or whatever I am listening to is to use the volume control within the program/website itself (itunes, youtube, etc.) Even changing the volume on the volume icon at the menu bar on top of the screen does nothing.  If anyone has an idea of how to go about solving this issue, I would greatly appreciate it. Thanks!

    First look into the Preference > Sound > Outpur whether internal Speakers are choosen.
    The only Preference to delete I can discover is com.apple.systempreferences.plist in your home Library folder. You can try to move it out to the desktop for example, not to loose all your settings. Restart and see whether the problem still persists. If you don't know how to do this here some Terminal (Applications > Utilities) commands. Enter them by copy and paste followed by <enter>
    mv ~/Library/Preferences/com.apple.systempreferences.plist ~/Desktop/
    restart
    to get it back:
    mv ~/Desktop/com.apple.systempreferences.plist  ~/Library/Preferences/
    confirm with "y" if you are asked to replace this file.
    marek

  • I have a new hard drive and itunes and my computer (windows XP) no longer recognise my ipod. I also had the problem with the registry keys not being present but this has now been fixed. However i can no longer link my ipod up with itunes.

    When I first tried itunes with my new hard drive there was the problem with the registry keys but something also flagged up about needing a signed driver. Is this anything to do with why Itunes and my computer no longer recognises when my ipod is linked up? Whatever i try under 'devices' my ipod is never available to sync up. If anyone can help I would be most grateful.

    Thanks for your reply. Unfortunately this has not worked. I didn't have quicktime to begin with so I don't know if that makes a difference? After following the instructions, I get the "registry keys missing" problem appear again (which I've subsequently fixed again) and then when I connected the ipod I got the following message - 'Device driver software was not successfully installed'.
    I've tried windows update but this doesn't do anything as '...the service is not running'.
    Any suggestions?

  • Duplicate record with same primary key in Fact table

    Hi all,
       Can the fact table have duplicate record with same primary key . When i checked a cube i could see records with same primary key combination but the key figure values are different. My cube has 6 dimentions (Including Time,Unit and DP) and 2 key figures. So 6 fields combined to form the composite primary key of the fact table. When i checked the records in se16 i could see duplicate records with same primary key. Ther are no parallel loading happening for the cube.
    BW system version is 3.1
    Data base is : Oracle 10.2
    I am not sure how is this possible.
    Regards,
    PM

    Hi Krish,
       I checked the datapacket dimention also. Both the record have same dimention id (141). Except the Keyfigure value there is no other change in the Fact table record.  I know this is against the basic DBMS primary key rule. But i have records like this in the cube.
    Can this situation arise when same records is there in different data packet of same request.
    Thx,
    PM
    null

  • DBMS_CDC find only the columns that are changed along with the primary key in the table

    Hello,
    We are having a requirement to find the change data in the production environment.
    We are planning to use the DBMS_CDC utility.
    But for  example in the create change table 1 picked emp_id,ename, address, salary,dob.
    I have a sample data of
    empid
    ename
    address
    salary
    DOB
    1
    test1
    24 test street
    2000
    20-Jan-98
    2
    test2
    25 test street
    2500
    15-Aug-97
    if ename for empid 1 is changed to test1_test3 from test1.
    My CDC is capturing  the values in the old and new values in the 5 columns.
    But i need to get only the empid (primary key of the source table) and the ename column as only that's been updated not the rest of the 3 columns.
    Can i accomplish this.
    Please advice.

    Hello,
    Thanks for the information.
    but if i change the change table  then i will miss the other columns right?
    I want to get the columns( empid and ename) only if ename is changed. i.e when ever any column in emp table changes i need to get all the columns where the data is changed along with the primary key columns empid.
    Is there any way i can tweak the parameters so that i can achieve this or is there any other way using the cdc i can get this data.
    Thanks

  • 2 tables with same primary key

    Hi,
    2 tables with same primary key is possible,but when is wise to go for such ?
    is that a bad desisn ?
    eg:
    Personal_details_employee
    Official_details_employee
    these 2 tables have same Primary key emp_id.
    plz. reply me at [email protected] also
    thanx
    vikram

    hi Vikram,
    In this case u can have then in one table itself and why do want to have two tables.
    - Suresh.A

Maybe you are looking for

  • FaceTime doesn't work right after updating IOS 8.1.1

    I updated  my iPad with IOS 8.1.1 and now my FaceTime app doesn't work.  Will there be a fix for this soon?

  • CD-ROM works for installer but disappears on boot

    I'm having a strange issue. I got a Lenovo IdeaPad yesterday and promptly wiped vista off and installed Arch. The install went swimmingly, but for some strange reason, the cdrom drive is not detected when I boot into Arch. I installed Arch from the C

  • Memory leak in jvm? totalMemory differs real memory usage

    I working on a server application under linux with java 1.4.1_02. The problem is that the OS reports after approx. 2 days a memory usage of about 200 MB while the JVM's totalMemory method says, that only about 20 MB are allocated and more than 10 MB

  • LAG/Slowness with iOS7?

    my ipad mini was slow with typing in words on safari and imessage after downloading iOS7. i called iOS support and they just told me to go into Settings>General>(at the bottom)reset settings>reset all settings this will erase your personal settings o

  • How to stop storing messages from my device to my PC

    I am trying to stop my device from storing sent messages on my PC and my PC from storing sent messages on my device.  I have tried to follow the directions in the help section on my device. When I get to email settings, it doesnt show "save copy in s