Key in table

Is it advicable to make all the fields in a table as key? The case is to maintain a control table where 2 fields are required and it should be unique also. is there any thing wrong in doing it?

hi Rob,
I wanted to record whether a particular transaction has occured or not. If ocuured on the same date it should not be allowed once again. So the transaction and date are my only fields and only keys. Is there any SAP tables with all the fields as key.

Similar Messages

  • MDM API to read the Record Key Mapping table

    Hi,
    Does anybody know what class/method I can use to read the Record Key Mapping table?
    For the Business Partner table the Key Mapping table has this columns:
    <u>Default / MDM Partner ID / Remote System / Key</u>
    I have everything but the Key. How can I read it?
    Thanks in advance,
    Diego.

    GetKey Mapping is one of the available Web Services as of SP4.
    Else you could use the Java API to get the Key Mapping.
    <b>CatalogData class</b> has the following method
    <b>GetKeyMapping</b>
    public java.lang.String[][] GetKeyMapping(java.lang.String agency,
                                              java.lang.String table,
                                              int[] recordIDs,
                                              boolean isDefaultKeyOnly)
                                       throws StringExceptionRetrieves the key mapping for each record.
    Parameters:
    agency - the agency name.
    table - the table name.
    recordIDs - the list of records.
    isDefaultKeyOnly - True to retrieve only the default value, False to all key values.
    Returns: the key values for each record.

  • Error on activating the table "DB length of the key of table too large"

    Hi Experts,
    I am getting the error while activating my table PSM_REQ_BO_ELM_NAME.  Activation error log is as follows
    "DB length of the key of table PSM_REQ_BO_ELM_NAME is too large (>900)"..
    I have a table which has 4 filed as key one with char 6 and rest 3 with char 120 each.
    Could you please help me to get rid of this error.
    Thanks in advance.
    Regards,
    Pradeep

    When ever we create a table in Data dictionary, a corresponding database table will be created in Data base server. For the primary key we maintained in Data Dictionary, another data base table will be created seperately where as the table length should not exceed some limit set by the Administrator.
    So, Reduce the length of the primary key in the table by deleting the field as key field/ reducing the size of the field.
    In your case, maintain the primary key field length not more than 400.
    ***Length if the Primary key should not exceed 120. other wise performance will be low while fetching the data.

  • ORA-02266: unique/primary keys in table referenced by enabled foreign keys

    Hi,
    I am trying to delete data from a table by dropping a partition. I have identified all the child tables by running the following command.
    select 'select count(*) from '||table_name||' where employee_id = 100;'
    from dba_constraints
    where constraint_type='R'
    and r_constraint_name in
    (select constraint_name from dba_constraints
    where constraint_type in ('P','U') and table_name='EMPLOYEE);
    'SELECTCOUNT(*)FROM'||TABLE_NAME||'WHEREEMPLOYEE_ID_ID=100;'
    select count(*) from PT_ORDERS where employee_id = 100;
    select count(*) from PT_DEP where employee_id = 100;
    select count(*) from PT_SKILLSET where employee_id = 100;
    I dropped the partition for employee_id 100 in all of the child tables. The select count(*) returns 0 rows for each of the above.
    When I try to run the below command on the EMPLOYEE table, I get 'ORA-02266: unique/primary keys in table referenced by enabled foreign keys'.
    alter table EMPLOYEE drop partition EMP_ID_100;
    I cant see why I am unable to drop this partition now as there is now child data in any of the referenced tables. Any suggestions or help on this would be greatly appreciated.
    Thanks.
    Rgs,
    Rob

    You should disable foreign key constraints first and drop partition. Deletion of rows or dropping partitions in childs don't work in this case
    as you have the global dependency:
    <PRE>
    SQL> create table scott.t (x int primary key, y int)
    2 partition by list (y) (
    3 partition p_1 values(1), partition p_2 values(2))
    4 /
    Table created.
    SQL> create table scott.t_c (x int references scott.t(x), y int)
    2 partition by list (y) (
    3 partition p_1 values(1), partition p_2 values(2))
    4 /
    Table created.
    SQL> insert into scott.t values(1,1)
    2 /
    1 row created.
    SQL> insert into scott.t values(2,2)
    2 /
    1 row created.
    SQL> insert into scott.t_c values(1,1)
    2 /
    1 row created.
    SQL> insert into scott.t_c values(2,2)
    2 /
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> alter table scott.t_c drop partition p_2;
    Table altered.
    SQL> alter table scott.t drop partition p_2;
    alter table scott.t drop partition p_2
    ERROR at line 1:
    ORA-02266: unique/primary keys in table referenced by enabled foreign keys
    SQL> select constraint_name from dba_constraints
    2 where owner = 'SCOTT' and constraint_type = 'P'
    3 and table_name = 'T';
    CONSTRAINT_NAME
    SYS_C0011058
    SQL> select constraint_name from dba_constraints
    2 where owner = 'SCOTT' and constraint_type = 'R'
    3 and r_constraint_name = 'SYS_C0011058';
    CONSTRAINT_NAME
    SYS_C0011059
    SQL> alter table scott.t_c disable constraint SYS_C0011059;
    Table altered.
    SQL> alter table scott.t drop partition p_2;
    Table altered.
    SQL> alter table scott.t_c enable novalidate constraint SYS_C0011059;
    Table altered.
    </PRE>
    I guess you should consider such option as Referencial partitioning (with some restrictions).
    Best wishes,
    Dmitry.

  • Add a primary key to table.

    Hello everybody,
    I want to add a primary key to a table but it doesn't work.
    select count(*), count(id) from tableA;
    COUNT(*) COUNT(ID)
    830447 830447
    You see: The number of ids is equal to the number of rows. The ID is not marked as unique but it should be unique. I try to set id as the primary key:
    alter table tableA add constraint "pk_constraint" PRIMARY KEY (id);
    But I a get an error message: ORA-02437: cannot validate (pk_constraint) - primary key violated.
    What is the problem?
    I use Oracle 11g.

    user9206958 wrote:
    Hello everybody,
    I want to add a primary key to a table but it doesn't work.
    select count(*), count(id) from tableA;
    COUNT(*) COUNT(ID)
    830447 830447
    You see: The number of ids is equal to the number of rows. The ID is not marked as unique but it should be unique. I try to set id as the primary key:
    alter table tableA add constraint "pk_constraint" PRIMARY KEY (id);
    But I a get an error message: ORA-02437: cannot validate (pk_constraint) - primary key violated.
    What is the problem?
    I use Oracle 11g.Revisit your query... 11g can help much in this sql.... select count(*), count(id) from tableA;... to get what your desired output should be.
    Edited by: Z.K. on Mar 30, 2010 1:15 PM

  • Problem in updating fa_additions SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table

    Hi,
    After using sql loader to import informations in the table fa_mass_additions and after the functionnal uses a treatment to imputate this assets, it asks me to do an update on the table fa_additions to change the value of attribute1 but i get an error
    Error report:
    ORA-01779: cannot modify a column which maps to a non key-preserved table
    ORA-06512: at line 11
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which
               map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    please how can i do this update?

    Hi,
    The "fa_additions" is a view, not a table.
    You should update the base table "fa_additions_b".
    Regards,
    Bashar

  • Populate choice component  with   2 primary key  in table

    There are 2 primary key in table. When I create my uix with jheadstart, the UIXs don't populate choice component. How can I create automatically populate choice component, with 2 PK in table?

    A choice component can only have one value attribute. So if you have a composite primary key in the table you use to populate the choice, it will not work correctly, because based on this single attribute the choice cannot render the correct row as selected.
    Steven Davelaar,
    JHeadstart Team.

  • Issues while changing primary key in table

    Hi
    I have one table. In that two fields are primary key. I want to change the second PK as FK only. But when i am changing this field as FK. Its showing one error 'Primary Key Change not permitted for value Table ZCAUSECATMASTER' . How to avoid this error.
    Please help me.

    Hi.....
    Remove that primary key for the second field and assign your foregin key..table to that filed.....
    So when you give entries in that second filed it will be validated with its foregin key table......its nothing but check table...
    what all values in the foregin table only can given.....
    regards
    raja

  • ORA-01779: cannot modify a column which maps to a non key-preserved table

    define cusname='GEORGE';
    INSERT INTO (select s.prd_id, s.cus_id, s.qty_sold, s.price from sales s, customers c where s.cus_id=c.cus_id)
    VALUES (102,(select cus_id from customers where upper(c_name) like '%GEORGE%'),14,(select price from product where prd_id = 102)*14)
    I am getting the following error when I am trying to run the above query.
    SQL Error: ORA-01779: cannot modify a column which maps to a non key-preserved table
    01779. 00000 -  "cannot modify a column which maps to a non key-preserved table"
    *Cause:    An attempt was made to insert or update columns of a join view which map to a non-key-preserved table.
    *Action:   Modify the underlying base tables directly.
    CUSTOMERS TABLE
    Name   
    Null   
    Type        
    CUS_ID 
    NOT NULL
    NUMBER      
    C_NAME         
    VARCHAR2(50)
    C_LIMIT         
    NUMBER      
    CITY           
    VARCHAR2(20)
    PRODUCT TABLE
    Name 
    Null   
    Type        
    PRD_ID
    NOT NULL
    NUMBER      
    PRICE         
    NUMBER      
    COST           
    NUMBER      
    SALES TABLE
    Name   
    Null   
    Type  
    PRD_ID 
    NOT NULL
    NUMBER
    CUS_ID 
    NOT NULL
    NUMBER
    QTY_SOLD         
    NUMBER
    PRICE             
    NUMBER

    Hi,
    As the error message sugggested, INSERT directly into the sales table.  You can get the values from a sub-query that joins whatever tables are needed, including sales itself.  MERGE might be simpler and more efficient than INSERT.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Did elationship fields in entity bean with CMP same as foreign key in table

    did elationship fields in entity bean with CMP same as foreign key in table database.so we don't have to make some foreign key column in table database.
    did Container handle that both.
    I need some answer
    thank's

    Suppose you have Group and user entity. Relation is 1-m. One group many users. When you create user, you dont need to send group id, All you need is create user and add it in collection (cmr-field) in group(user belongs to). Container will add its group id in user entity as well as in db.

  • Posting rules defined in account key in table T007B

    Hello Expert,
    I am trying to post a document in FB60, however SAP generates below message
    'No posting rules have been defined for the account key in the tax table in table T007B.
    Change the tax table, enter an account key already defined for the transaction in question or define the posting rules for a new account key in table T007B'
    I have checked the Rules, Posting keys and Accounts for that Account key in transaction OB40, however the error continues to exist.
    Please help.
    Regards
    Sandip

    Hello,
    I checked FBKP & OBCN and it looks like the settings are correct. Is there any other reason fro this error?
    regards
    Sandip

  • Cannot select ROWID from a join view without a key-preserved table at OCI c

    Hi All,
    Can anybody help me..?
    When i am creating the request in the presentation services ..
    for some of the columns i am getting the following error..by removing those those columns it's working fine..
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1445, message: ORA-01445: cannot select ROWID from a join view without a key-preserved table at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    Please suggest me a solution..
    Thanks in Advance...

    Looks like you have a view that contains the ROWID of another table. Does the view work first from sqlplus? See whether it returns any data. Its a ORA- specific error. So, the error is related to your view rather than BI EE. Also, how many columns are you trying to pull in your report?
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • PRIMARY KEY-FOREIGN KEY 관계 찾기(MASTER TABLE CONSTRAINT 정보 찾는 SQL)

    제품 : ORACLE SERVER
    작성날짜 : 2003-06-19
    PRIMARY KEY-FOREIGN KEY 관계 찾기
    =================================
    PURPOSE
    이 자료는 MASTER TABLE CONSTRAINT 정보를 찾는 SQL이다.
    Explanation
    SCOTT의 EMP table의 Foreign Key와 부모 제약 조건을 찾으려면
    다음의 질의문을 사용하여 찾을 수 있다.
    SQL> alter table dept add constraint dept_pk primary key (deptno);
    Table altered.
    SQL> alter table emp add constraint emp_dept_fk foreign key(deptno)
    references dept(deptno);
    Table altered.
    SQL> select c.constraint_name as "foreign key",
    p.constraint_name as "referenced key",
    p.constraint_type,
    p.owner,
    p.table_name
    from dba_constraints c, dba_constraints p
    where c.owner = 'SCOTT'
    and c.table_name = 'EMP'
    and c.constraint_type = 'R'
    and c.r_owner = p.owner
    and c.r_constraint_name = p.constraint_name;
    foreign key referenced key C OWNER TABLE_NAME
    EMP_DEPT_FK DEPT_PK P SCOTT DEPT
    Example
    none
    Reference Documents
    <Note:1010844.6>

    I don't have intimate knowledge of SQL Server, but to me, your code seems reasonable. I guess there is some "fine point" (a bug?) to using self referenceing foreign keys in SQL Server. It doesn't seem plausible that the error originates with the driver, unless it's a very intelligent kind of driver.
    A "Gordian Knot" kind of solution to your problem is to ask whether you really need the foreign key constraint in the db schema. Is the table used by something other than your EJB? Anyway, putting logic responsible for the correct functioning of your EJB into the db schema is often a bad practice, as it makes the code harder to understand, maintain, port etc.

  • Records are getting duplicated on presing enter key in table control

    Hi All,
    I am using table control in module pool program.  The issue is records are getting duplicated on press of enter key.
    I cannot use sy-ucomm enter and do some validation thing in my code. As the record should get update in int_tab(internal table). Otherwise ZSTR_TAB(table control)will be blank after pressing enter key.
    I have gone through all the previous threads on this. Have implemented sol provided in one of threads. Now records are not getting duplicated but the next line is getting disabled. The code to avoid duplication is :
    MODULE read_table_control INPUT.
      data tc-lines type i.
      DESCRIBE TABLE int_tab LINES tc-lines.
      IF tc-lines GE control-current_line.
        MODIFY int_tab FROM zstr_tab INDEX control-current_line.
      ELSE.
        IF gcreate_code = 'CREATE'.
          zstr_tab-zemp_num = gemp_num.
          INSERT zstr_tab INTO int_tab INDEX control-current_line.
        ENDIF.
        IF gchange_code = 'CHANGE'.
          MODIFY int_tab FROM zstr_tab INDEX control-current_line.
        ENDIF.
      ENDIF.
    ENDMODULE.   
    This module is in PAI. Now how to make the lines in control input enabled??
    Any other sol for avoiding duplicate records on pressing enter key?
    Thanks,
    Seema

    Hi,
    Have you written any code in when Others of case...Endcase  ?
    If Yes then checkout if there is anything wrong over there, debug and check.
    If not then write delete adgecent duplicates from Int_tab comparing key fields.
    Also check in PBO, if you have written any query that selects data from particular table and appending the internal table irrespective of entry is already exist. So you should write select query in the if...Endif block as below,
    If int_tab[] is not initial.
    select * from ZSTR_TAB
    into table int_tab
    where .........
    endif.
    If above is not the case then debug and check where exactly entries are getting duplicated so that I can have idea what exactly is happening.
    Regards,
    Umang Mehta

  • ABAP Access Key for Table change mode MCVKUSR & MCVBAPUSR in SE11

    Dear All,
    I'm using SAP ECC6.0. I want to create a new database table in the dictionary to be used in my programs. I proceed in the following way:
    1.  I run the SE11 transaction
    2.  At the first entry I write the name of the table to be Change created ( Display mode Showing )
    3.  I click on the change button.
    4. It will ask for Access Key
    But then the system asks me an Access Key , where can I get this?
    I have SAP License Key.
    DB Table Name : MCVBAPUSR & MCVKUSR
    Please Let me know
    Thanks in advance,

    Dear ,
    I go to Service market Place site, from SSCR Tab then I have to select a object from the list is TABL.
    and enter the Particular Object & Table Name . Now I got it Access key for Particular Object.
    Thank you for your quick Response.
    Once again Thank u.
    Regards
    Thomas.T
    Edited by: thomas_raja on Jun 5, 2011 6:24 AM

  • Pressing tab key within table not scrolling to next input field

    Hi All,
    I have a table with editable and read only fields. I have more than 20 columns. When the tab Key is pressed it scrolls only to the editable fields that are in the visible screen. It does not scroll the table to the right to the next input field.
    However if I change the screen size so that the scroll bar is required for the browser then it will scroll across moving the browser scroll bar, moving the cursor to the input field that was not visible. Again it does not go further moving the scroll bar within the table to the next editable field to the right.
    The table has been set to scrollable with the scrollable column count set to 8.
    We are using explorer 8 on 7.01
    Is it possible to have the tab key move from input field to input field scrolling the table to the next input field if it is not visible yet?
    Thanks
    Bruce

    What you describe sounds like the correct functionality.  If you set a scrollable column count, only the visble rows are actually rendered on the client side.  When you use the horizontal scroll bar, you are triggering a server side event to retrive the next set of visible columns.  Therefore the browser doesn't actually know anything about non-visible columns and hence the tab can't go to them.
    When you increase the number of visible columns (or don't set anything for visible column) you render al the columns on the client side and use the browser scrolling.  Therefore the tab works.

Maybe you are looking for

  • HT201210 iphone could not be restored an unknown error occurred (1644)

    iphone could not be restored an unknown error occurred (1644)

  • Group by specific periods of time - group by 5 seconds

    I would like to group records for every 5 seconds The following query groups for every second select to_char(state_transition_dt, 'MM/DD HH24:MI:SS'), UPPER(item_type) Type, UPPER(sync_operation) operation, count(*) from sync_traffic_flow h group by

  • AssignmentCannotEditSummaryTask

    I have to update a custom field value (Project Server 2010) using PSI. To acheive this I check out a project, update the value and than check in the project using the service account from PSI using the QueueCheckInProject method. If a project has res

  • Suppression of table helptext in Headstart help.htm

    I am using a Headstart tool (I think version HSUSTART rev 6.5.3.3) to create an application-help.html file on the basis of help-items in the repository. The customer has provided me with new texts which they only want to see on the forms level. When

  • Terminal won't launch or open at all?

    When I click on the Terminal app, it doesn't launch at all. It doesn't even show up on my dock. The icon for it is the default application icon as well, and I have no idea what to do. I can't reinstall OS X since I left the disk for it in another cou