Table that store primary key info of each SAP table

Hi,
I am wondering if anyone can tell me which table in SAP that stores primary key for each SAP tables. I would appreciate if anyone can help me with this.
Sunny

Hi,
Try this function module.
DDIF_FIELDINFO_GET
Description: Interface to Read Text on Tables or Types
You can try with table DD03L.
If you  find my answer sutiable please give me sutiable points.
Regards,
Irfan Hussain

Similar Messages

  • How to find Primary Key for a particular SAP Databse Table?

    Hi Guys,
                  How to find Primary Key and foreign key  for Particular SAP Databse table ?for Ex : EKKO , EKPO , EKKN , EKBE , EKBEH  , EKET and EKETH.
    Thanks,
    Srinivas.

    Use transaction SE11 to display the table. Put the cursor on the field you want to display the check table and click 'Foreign key' push button (a key with an bottom point arrow), then it will show the check table of the foreign of a field.
    Or by just simple double click on the field, a pop-up window of all the attribute (including the foreign key and the check table if exists) will show too.
    <i><b>Please reward point for helpful answer.</b></i>
    Minami

  • Since upgrading to iOs7 I seem to have lost an item from my notes app and it was the one that had really key info in it?

    One of my notes has disappeared from my list of notes in notes app since I upgraded. Is thee any way of recovering this? It wasn't done through the iCloud email so it's not saved in there. Is was in my Yahoo account

    Is it still present on Yahoo.com?
    If so,
    Settings > Mail, Contacts, Calendars > Select the yahoo account > turn off notes then turn them back on

  • Null value in detail table's primary key

    I use Business Components Data Form to define a master-detail java panel.
    I don't display the primary key column in the detail grid control.
    Then I click on "+" to add a row, enter a value (the 2nd part of the detail table's primary key) and click commit.
    I get an error saying that the primary key column that's not displayed is null and the row cann't be committed.
    How do I fix this error?

    My fields are varchar2's.
    -- simplified to protect the guilty:
    -- (made up from memory, so sql keywords may --be misspelled, but you get the idea)
    create table proj (
    proj varchar2(10) not null,
    constraint proj_pk
    primary key(proj)
    insert into proj values ('abc');
    commit;
    -- this table has legal values for -- the master.legal field.
    -- in master, legal was changed to a -- ComboBoxControl control from -- TextFieldControl that the wizard -- generated.
    create table legal_values (
    proj varchar2(10) not null,
    legal varchar2(10) not null,
    display_order integer not null,
    constraint legal_values_pk
    primary key (proj, legal)
    insert into legal_values
    values ('abc', 'one', 1);
    insert into legal_values
    values ('abc', 'two', 2);
    insert into legal_values
    values ('abc', 'three', 3);
    commit;
    create table master (
    proj varchar2(10) not null,
    masterKey varchar2(15) not null,
    legal varchar2(10) not null,
    constraint master_pk
    primary key (proj, masterKey)
    create table detail (
    proj varchar(10) not null,
    masterKey varchar(15) not null,
    detailkey varchar(10) not null,
    display_order integer not null,
    status varchar2(12) not null, -- user can only update this field
    constraint detail_pk
    primary key(proj, masterkey, detailkey)
    -- legal rows for detail table
    create table detail_values (
    proj varchar2(10) not null,
    detailkey varchar2(10) not null,
    display_order integer not null,
    constraint detail_values_pk
    primary key(proj, detailkey)
    insert into detail_values values
    ('abc', 'status a', 1);
    insert into detail_values values
    ('abc', 'status b', 2);
    commit;
    -- if their is a foriegn key on details back
    -- to master, then you get the
    -- "mutating table" error when trigger
    -- occurs.
    create or replace trigger master_tr
    after insert on master
    for each row
    begin
    insert into detail
    (masterKey, detailKey, status, display_order, status)
    select :new.masterkey, detail_key, display_order, ' '
    from detail_values;
    end;
    -- detail.status is a comboboxControl getting --its values of of another db table too.
    -- there's also "after update" triggers on master and detail tables that copy the record to master_history and "detail_history" tables if the corresponding table is modified. Thus we have a history of the changes made to the records. The 2 history tables have 2 additional fields than their parents, "modified_date date default sysdate not null" and "modified_by varchar2(30) default user not null" that record when and who made the change. There's also a change type field that records where the change is an insert, delete or update (there 3 triggers per table , so we can correctly record change type as being insert, delete or update into the change_type field).
    If you want to make it more real to life, the status value is initially blank, then can be changed to a legal status value (complete or not complete), but can not be changed back to blank.
    ***P.S. I have to have this ready for production by monday.****
    P.P.S After you reply and change to ComboBoxControls in 2 places, try changing the table names and/or the column names (say to follow the DBA's naming convention) or add another field to the composite primary key (and unstated foriegn key) (using drop table/create table). Now try getting the existing code to run. No writing down the old/new table (or column) name pair names. Just run the code and try to fix the code based on the error messages. Are the error messages giving you adequate information to find the problem?

  • Can we have more than one primary key constraint to a Oracle Table?

    Hi,
    Can we have more than one primary keys to a single table in oracle? ( Not the composite key)
    Please somebody answer..
    Regards,
    Alaka

    811935 wrote:
    Can we have more than one primary keys to a single table in oracle? ( Not the composite key)
    In principle a table can have multiple keys if you need them. It is a very strong convention that just one of those keys is designated to be "primary" but that's just a convention and it doesn't stop you implementing other keys as well.
    Oracle provides two uniqueness constraints for creating keys: the PRIMARY KEY constraint and the UNIQUE constraint. The PRIMARY KEY constraint can only be used once per table whereas the UNIQUE constraint can be used multiple times. Other than that the PRIMARY KEY and UNIQUE constraints serve the same function (always assuming the column(s) they are applied to are NOT NULL).

  • Error While Deploying A CMP Entity Bean With A Composite Primary Key

    Hello all,
    I have a problem deploying CMP Entity beans with composite primary keys. I have a CMP Entity Bean, which contains a composite primary key composed of two local stubs. If you know more about this please respond to my post on the EJB forum (subject: CMP Bean Local Stub as a Field of a Primary Key Class).
    In the mean time, can you please tell me what following error message means and how to resolve it? From what I understand it might be a problem with Sun ONE AS 7, but I would like to make sure it's not me doing something wrong.
    [05/Jan/2005:12:49:03] WARNING ( 1896):      Validation error in bean CustomerSubscription: The type of non-static field customer of the key class
    test.subscription.CustomerSubscriptionCMP_1530383317_JDOState$Oid must be primitive or must implement java.io.Serializable.
         Update the type of the key class field.
         Warning: All primary key columns in primary table CustomerSubscription of the bean corresponding to the generated class test.subscription.CustomerSubscriptionCMP_1530383317_JDOState must be mapped to key fields.
         Map the following primary key columns to key fields: CustomerSubscription.CustomerEmail,CustomerSubscription.SubscriptionType. If you already have fields mapped to these columns, verify that they are key fields.Is it enough that a primary key class be serializable or all fields have to implement Serializable or be a primitive?
    Please let me know if you need more information to answer my question.
    Thanks.
    Nikola

    Hi Nikola,
    There are several problems with your CMP bean.
    1. Fields of a Primary Key Class must be a subset of CMP fields, so yes, they must be either a primitive or a Serializable type.
    2. Sun Application Server does not support Primary Key fields of an arbitrary Serializable type (i.e. those that will be stored
    as BLOB in the database), but only primitives, Java wrappers, String, and Date/Time types.
    Do you try to use stubs instead of relationships or for some other reason?
    If it's the former - look at the CMR fields.
    If it's the latter, I suggest to store these fields as regular CMP fields and use some other value as the PK. If you prefer that
    the CMP container generates the PK values, use the Unknown
    PrimaryKey feature.
    Regards,
    -marina

  • Database Deferred Primary Key generation

    Does anyone know how to configure 9iAS J2EE/OC4J to defer the creation of the Primary to the Database? For example, I have a table that is mapped to a CMP bean and the primary key is generated by a trigger in the database. I want the bean to use this database generated value but I can't figure out how to make it happen. I have tried setting the <prim-key-class> to java.lang.Object but that doesn't appear to be enough to get 9iAS to figure out that the primary key field is to come from the database.
    Regards,
    Nigel

    you should set in your entity object the attribute as DBSequence and then create a before insert trigger in the db table to get the pk from a sequence or so, something like:
    CREATE OR REPLACE TRIGGER trigger_name
    BEFORE INSERT
    ON table_name
    FOR EACH ROW
    begin
    select seq_name.nextval into :new.pk_id from dual;
    end;

  • Unable to understand the concept of Primary Key in EJB

    hi,
    please help me in understanding the concept of Primary Key.
    For each and every entity bean represents a data base row. i think it is correct. if multiple users are accessing the same data base row, there will be different primary key for each and every client. is it correct or not. can we say this as "concurrency"?. if all the clients are manipulating the bean, who manages it either application server or data base server?. why does we must implement both hashCode() and equals() methods?. Provide me the links where i can find the answers.

    if multiple users are
    accessing the same data base row, there will be
    different primary key for each and every client.This is incorrect: the PrimaryKey is the unique identifier for each database row. It has nothing to do with users. In order for CMP to work, the container must be able to operate with a single row in the database and be able to distinquish between them.
    If your CMP->database table already has one column that's unique, then you declare that CMP field to be <primary-key-field>. If you have more than one column that makes a row unique, you must make your own primary key object. The way the container can tell the difference between these primary key objects is to compare them, therefore the hashCode and equals methods.
    Provide me the links where i can find the
    answers.This is all discusssed in the J2EE Tutorial.

  • Missing primary keys after import

    Hi,
    We receive a .dmp file from another company each night. The process changed when they started to obfuscate some sensitive data. But since then we are finding all the tables are missing their primary keys.
    I really would like to eliminate our import process as the cause.
    Has anyone ever heard of this kind of problem before? What was the cause/scenario.
    Your help is greatly appreciated.
    Brian

    If you are not getting any errors during the import process, it is pretty unlikely that the import process is at fault assuming that hasn't changed. Make sure that INDEXES=Y and CONSTRAINTS=Y are specified (which is the default).
    You can use the SHOW=Y parameter to have the import utility write the DDL contained in the dump file to a text file where you can manually verify that the primary key constraints you were expecting are indeed missing.
    Justin
    Edited by: Justin Cave on Nov 10, 2008 3:44 PM
    typo

  • Checking for duplicate primary keys on row inserts

    Checking for duplicate primary keys on row inserts
    I have a situation where I will be making bulk table inserts knowing that the primary key value will in some cases already exist. In this is the case I simply want to ignore the duplicate inserts.
    Should I be performing a sub-query on the table and using a statement like:
    where not exist in
    Or is there a cleaner way of discarding or checking for duplicates on insert.
    My concerns were mainly one of performance, as my routine will be inserting a few thousand rows in its operation.

    The MERGE commnad is a good option when a large percentage of the data will exist in the target because it is much more efficient to attempt to update then insert when the update affects zero rows than capture an error and convert it to an update.
    However, since in this case it would appear that only a few rows will alreadys exist and we want to ignore the duplicates when they exist then
    begin
    insert
    exception
    when dup_value_in_index then null;
    end
    would be the way to code this one. The bulk insert version has in 9.2 the ability to store the errors so that they can all be handled at once which means the rest of the array insert can work.
    HTH -- Mark D Powell --

  • Read-Only Primary Key

    Hi All,
    I am trying to figure out a way to keep my primary keys from being edited. I created a primary key constraint but did not know how to set it as read-only.
    Each time I create a new record, commit, and change its primary key, Oracle allows me.
    Can someone please shed a light to this?
    THanks!

    I was actually thinking of that update trigger but I thought maybe there was a direct declaration or attribute that I could simply set to my primary key constraint as read-only. No there is nothing like that as far as i know.
    In regards to allowing update on primary key, that is my issue I don't know how to set it to read-only. I don't allow it. It's default. If I go to my table and start typing on the primary field, it'll replace it without throwing an exception. Its not a rule of thumb that the primary key should not be updated. And hence such a thing is not set by oracle. But as far as best practice is concern its good not to update a primary key.
    I just thought maybe there was a direct solution. I guess I have to just apply another step to my process. Thanks! The best way is to Design your application in such a way that it does not allow any updation on the primary key.

  • Dbtable without a primary key

    hi!
    is it possible to create a db-table without a primary key? if there is a possbility, how can i do this?
    greetings
    stefan

    Hello,
    The link i provided contains all your answers. Its oracle 8i documentation release. It contains everything that you want to know about oracle 8i release.
    What Are Index-Organized Tables?
    Index-organized tables are tables with data rows grouped according to the primary key. This clustering is achieved using a B-tree index. B-tree indexes are special types of index trees that differ from regular table B-tree indexes in that they store both the primary key and non-key columns. The attributes of index-organized tables are stored entirely within the physical data structures for the index.
    Why Use Index-Organized Tables?
    Index-organized tables provide fast key-based access to table data for queries involving exact match and range searches. Changes to the table data (such as adding new rows, updating rows, or deleting rows) result only in updating the index structure (because there is no separate table storage area).
    Also, storage requirements are reduced because key columns are not duplicated in the table and index. The remaining non-key columns are stored in the index structure.
    Index-organized tables are particularly useful when you are using applications that must retrieve data based on a primary key. Also, index-organized tables are suitable for modeling application-specific index structures. For example, content-based information retrieval applications containing text, image and audio data require inverted indexes that can be effectively modeled using index-organized tables.
    See Also: For more details about index-organized tables, see Oracle8i Concepts.
    Differences Between Index-Organized and Regular Tables
    Index-organized tables are like regular tables with a primary key index on one or more of its columns. However, instead of maintaining two separate storage spaces for the table and Btree index, an index-organized table only maintains a single Btree index containing the primary key of the table and other column values.
    Index-organized tables are suitable for accessing data by way of primary key or any key that is a valid prefix of the primary key. Also, there is no duplication of key values because a separate index structure containing the key values and ROWID is not created. Table 14-1 summarizes the difference between an index-organized table and a regular table.
    Table 14-1 Comparison of Index-Organized Table with a Regular Table
    Regular Table  Index-Organized Table 
    ROWID uniquely identifies a row; primary key can be optionally specified 
    Primary key uniquely identifies a row; primary key must be specified 
    ROWID pseudo-column refers to physical block address 
    ROWID pseudocolumn refers to primary key-based logical ROWID 
    Secondary indexes store physical data 
    Secondary indexes store primary key-based logical ROWID 
    Can be stored in a hash or index cluster 
    Cannot be stored in a hash or index cluster 
    Regards,
    Shekhar Kulkarni

  • Locking Down a Primary Key Value

    What is the best way to guarantee that a primary key field value cannot be changed? Should I use a trigger to prevent such attempts? If so, what would the trigger script look like? This is a problem because the primary key will be used as a foreign key in other tables, and its value should never change once set. Thanks in advance.
    Evan

    If foreign key constraints are in place, Oracle won't allow you to change a primary key in the parent table if there is a record in the child table that depends on that value.
    Depending on the application design, you may be able to do things such as not grant UPDATE privileges on the primary key column to the users.
    You could also write a trigger that would prevent modifications, though that would tend to be a bit of overkill. Something like
    CREATE OR REPLACE TRIGGER no_change_primary_key
      BEFORE UPDATE OF <<primary key column>> ON <<table>>
      FOR EACH ROW
    BEGIN
      RAISE_APPLICATION_ERROR( -20001, 'Dude.  You cannot change the primary key!' );
    END;
      1  CREATE OR REPLACE TRIGGER no_change_primary_key
      2    BEFORE UPDATE OF empno ON emp
      3    FOR EACH ROW
      4  BEGIN
      5    RAISE_APPLICATION_ERROR( -20001, 'Dude.  You cannot change the primary key!' );
      6* END;
    SCOTT @ HP92 Local> /
    Trigger created.
    SCOTT @ HP92 Local> update emp set empno = 1 + empno;
    update emp set empno = 1 + empno
    ERROR at line 1:
    ORA-20001: Dude.  You cannot change the primary key!
    ORA-06512: at "SCOTT.NO_CHANGE_PRIMARY_KEY", line 2
    ORA-04088: error during execution of trigger 'SCOTT.NO_CHANGE_PRIMARY_KEY'Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Primary Key definition does not copy over to alias

    I imported a db table in physical layer and defined the key on it.
    When I create an alias of this table, the key definition is not copied over to alias. Is this standard behavior? Do I need to create primary key definition for each alias separately or am I missing something?

    Yes its standard behavior.
    Since key are generated based on joins for that object and can may not be duplicated
    Appreciate if you mark as correct
    Edited by: Veeravalli on Nov 29, 2012 1:14 PM

  • Primary Keys and Triggers

    I am developing a web application for the agency I work for and would like to use toplink (10g, aka 9.0.4). The agency has hade a policy since about Oracle 6 that all primary keys will be generated by a standard trigger returning a 32 character string. This policy is unlikely to change.
    Can toplink be used in this scenario? It does not appear that this is possible. I have seen the "return policy" example which appears to be a solution, but this is for a prototype version of 10g that is not yet released. At least, that is my interpretation.
    Can toplink 10g (9.0.4) insert records into tables where the primary key is generated by a trigger?
    Can this be configured in the Workbench or is this configured manually (if at all)?
    Thanks,
    Brad Smith

    Really it's an impedence mismatch issue.
    With or without TopLink, no matter what you do you're going to always have to do two round trips to get new data in the database (once to Insert it and once to read the PK for use in the cache).
    The question I usually ask is -- is this generated PK relevant to your business model? If it's not relevant, then don't map it, and create and use your own PK that can be managed in the mid-tier, use native sequencing, or some other O-R friendly approach. Go ahead and let the database trigger-generate keys, as long as you have some other unique value for the object, then it doesn't matter if the DB trigger generates one for it's own purposes.
    If you do at some point need this tigger generated value, you can make use of events. Pre/post insert/update/delete/write, whatever, events can be used to get/manage the trigger generated data on the database through JDBC calls.
    Bottom line is that impedence mis-match is your enemy in this situation, and TopLink has the event framework at your disposal to work with this mismatch.
    - Don

Maybe you are looking for

  • Macbook pro with 10.9.4 running slow / slow startup

    Hey guys - I hope that you will be able to help me Lately my macbook pro has been running generally slow - the spinning circle is often appering, programs are starting up slowly, and the startup takes more than 1,5 min and around 3 min before it can

  • Why does my computer randomly play advertisements with no prompting?

    At random times our computer will just play an advertisement. We could be sitting in the same room watching TV and all of a sudden our computer is talking to us. We could be tucked in bed and our computer starts talking to us. I could be typing this

  • No columns in table error when committing via CachedRowSetDataProvider

    Okay, another issue that's had me scratching what's left of my hair over the past couple of days. I've got a CachedRowSetDataProvider tied to a CachedRowSetXImpl. This rowset pulls all data back from a table (command = select all FIRST_NAME, LAST_NAM

  • Can I repartition my MB 10.5.8 to dualboot Snow Leopard on the same int.HD?

    I want to repartition my MacBook HD currently running Leopard and install Snow Leopard in a dual boot system. Is Snow Leopard compatible with my early '08 MB? Are there any steps I need to perform or pay particular attention to? My original Leopard i

  • Sun Ultra 5 hung at ok prompt.

    Hi All, I installed a fresh copy of solaris 8 on the ultra5, everything is working properly until, i wanted to boot without keyboard, i went to the ok prompt and type 'setenv input-device ttyl' thing started going wrong from here. 1. The system start