Propagate Properties option for Primary Keys?

Hi,
I have a physical model Oracle Database 11g created. I would like to change Using Index option from one value to another for most of primary keys in the model. Is there a way to do it? Additionally I would like to assign all primary key indexes to one tablespace.
Now, I have to:
1. Double click on one of the primary keys.
2. Change Using Index option on General tab.
3. Go to Using Index tab and select proper tablespace.
All these steps have to be repeated for each primary key.
Is there a way to do it once and propagate the change for all? There is similar option on indexes but I don't see it for primary keys.
Arek

Hi Arek,
unfortunately there is no "Propagate Properties" functionality for primary keys.
Philip

Similar Messages

  • Sql*loader and sequence() for primary keys

    I have a question regarding SQL*Loader with the sequence() function and using it for a primary key to load records in multiple tables from one input record. I am pulling data from a delimited file and populating several tables from each row. For the primary key, I am using the sequence function.
    For the first table (the parent), I use sequence(40000,1) for the key. Since the remaining inserts are based on the same logical record, I use sequence(40000,1) for those too (one record for each month). The problem comes in when a child record does not pass a WHEN clause (the amount is zero). Then it almost seems as if the parent record is not loaded and the child (or children) that does pass the WHEN clause are assigned to the next parent! Obviously, the sequence is getting out of sync between the children and the parent.
    I've looked in the documentation and tried several different ways to attack this problem. Is there a bug in SQLLDR (8.1.7) or is it just my coding.
    I will try to include the files below but they are very large.
    Thanks for your help.
    Dan
    ***CONTROL FILE***
    LOAD DATA
    INFILE 'rent.csv'
    INTO TABLE BUDGET_LINE
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER CHAR,
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    DEC_AMT          FILLER CHAR,
    DEC_CNT          FILLER CHAR,
    CUT               FILLER CHAR,
    NETMANGEN          FILLER CHAR,
    NETMAN_item          BOUNDFILLER CHAR,
    NETMAN_item_seq     BOUNDFILLER CHAR,
    NETMAN_location     BOUNDFILLER CHAR,
    UPDATED_ON          DATE "MM/DD/YYYY",
    NETMAN_com_desc     BOUNDFILLER CHAR,
    NETMAN_vendor          BOUNDFILLER CHAR,
    NETMAN_generation     BOUNDFILLER CHAR,
    CREATED_ON          SYSDATE,
    CREATED_BY          CONSTANT '0',
    UPDATED_BY          CONSTANT '0',
    ACTIVE          CONSTANT 'T',
    GL_CODE_COMBO_ID     CONSTANT '0',
    BUDGET_TYPE          CONSTANT 'B',
    AMOUNT_TYPE          CONSTANT 'D',
    source          constant 'N',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    DESCRIPTION          "(:NETMAN_item)||'-'||(:NETMAN_item_seq)||'; '||:NETMAN_com_desc||'; '||:NETMAN_vendor||' ('||:NETMAN_generation||')'"
    INTO TABLE GL_CODE_TEMP
    append
    WHEN TOT_AMT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    SPENDER          CHAR ,
    ACCT               CHAR ,
    TOT_AMT          FILLER CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '1',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '2',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '3',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '4',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '5',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '6',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '7',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '8',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '9',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '10',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '11',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    AMOUNT          CHAR
    INTO TABLE BUDGET_COST
    append
    WHEN AMOUNT != '0'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    NETMAN_ITEM_NO      FILLER POSITION(1) CHAR TERMINATED BY ',',
    BUDGET_LINE_ID     SEQUENCE(40000,1),
    PERIOD_ID          CONSTANT '12',
    SPEND               FILLER CHAR,
    ACCOUNT          FILLER CHAR,
    TOT_AMT          FILLER CHAR,
    JAN_AMT          FILLER CHAR,
    JAN_CNT          FILLER CHAR,
    FEB_AMT          FILLER CHAR,
    FEB_CNT          FILLER CHAR,
    MAR_AMT          FILLER CHAR,
    MAR_CNT          FILLER CHAR,
    APR_AMT          FILLER CHAR,
    APR_CNT          FILLER CHAR,
    MAY_AMT          FILLER CHAR,
    MAY_CNT          FILLER CHAR,
    JUN_AMT          FILLER CHAR,
    JUN_CNT          FILLER CHAR,
    JUL_AMT          FILLER CHAR,
    JUL_CNT          FILLER CHAR,
    AUG_AMT          FILLER CHAR,
    AUG_CNT          FILLER CHAR,
    SEP_AMT          FILLER CHAR,
    SEP_CNT          FILLER CHAR,
    OCT_AMT          FILLER CHAR,
    OCT_CNT          FILLER CHAR,
    NOV_AMT          FILLER CHAR,
    NOV_CNT          FILLER CHAR,
    AMOUNT          CHAR
    *** PIECE OF DATA FILE ***
    Item,Spender,Account,Total Amt,Jan Amt,Jan Count,Feb Amt,Feb Count,Mar Amt,Mar Count,Apr Amt,Apr Count,May Amt,May Count,Jun Amt,Jun Count,Jul Amt,Jul Count,Aug Amt,Aug Count,Sep Amt,Sep Count,Oct Amt,Oct Count,Nov Amt,Nov Count,Dec Amt,Dec Count,Status,Netman Gen,Netman Item,Netman Unit,Location,Last Update Date,Component Description,Vendor Description,Generation Process
    10110993,10993,8301-01,90134,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7480,0,7667,0,7667,0,0,+,LEASE PYMT,207,WIMOS,5/22/2002,LEASE PAYMENTS,"VIKING HOLDING, INC.",ACTUAL BUDGET
    10410993,10993,8301-04,15240,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,1270,0,0,+,JANITORIAL,58,WIMOS,5/22/2002,JANITORIAL,BUILDING ONE SVC SOLUTION,ACTUAL BUDGET
    10810993,10993,8301-08,2232,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,186,0,0,+,ELECTRIC,77,WIMOS,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",WISCONSIN PUBLIC SERVICE,AVGD 01 04 07 10 NOT WEIGHTED
    10910993,10993,8301-09,4220,26,0,348,0,609,0,383,0,348,0,371,0,348,0,371,0,360,0,348,0,360,0,348,0,0,+,FIRE EQUIP,51,WIMOS,5/22/2002,RENT CONTRACT SERVICES,"CENTRALCOM, INC.",ACTUAL EXPERIENCE
    11610993,10993,8301-16,1272,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,106,0,0,+,L/H MOSINE,1,WIMOS,5/22/2002,LEASEHOLD IMPROVEMENTS,ELLIS STONE,ACTUAL BUDGET
    10110994,10994,8301-01,69960,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,5830,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ACTUAL BUDGET
    10410994,10994,8301-04,840,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,70,0,0,+,JANITORIAL,69,WISTEWEL,5/22/2002,JANITORIAL,MARSDEN,ACTUAL BUDGET
    10710994,10994,8301-07,6067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6067,0,0,+,LEASE PYMT,228,WISTEWEL,5/22/2002,LEASE PAYMENTS,BJ INVESTMENTS LLC,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810994,10994,8301-08,2460,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,205,0,0,+,ELECTRIC,84,WISTEWEL,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",BJ INVESTMENTS LLC,AVGD 03 06 09 NOT WEIGHTED
    10910994,10994,8301-09,1050,70,0,70,0,105,0,105,0,70,0,105,0,35,0,140,0,35,0,70,0,210,0,35,0,0,+,SANITATION,12,WISTEWEL,5/22/2002,RENT CONTRACT SERVICES,WASTE MANAGEMENT OF WIS,ACTUAL EXPERIENCE
    11910994,10994,8301-19,1099,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,0,0,0,0,+,INSURANCE,6,WISTEWEL,5/22/2002,INSURANCE,BJ INVESTMENTS LLC,ACTUAL EXPERIENCE
    10110998,10998,8301-01,2440,2440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10410998,10998,8301-04,146,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ACTUAL BUDGET
    10610998,10998,8301-06,336,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,28,0,0,+,DRINK H2O,46,ILELG,5/22/2002,COOLER AND BOTTLED WATER,"HINCKLEY & SCHMITT, INC.",AVGD 01 02 03 04 05 06 07 08 09 10
    10710998,10998,8301-07,276,276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,+,LEASE PYMT,47,ILELG,5/22/2002,LEASE PAYMENTS,ELGIN AIRPORT BUSINESS PK,ASSUME 5% INCREASE OVER ACTUAL 2000 EXPENSES
    10810998,10998,8301-08,3108,433,0,315,0,234,0,173,0,181,0,292,0,320,0,337,0,316,0,153,0,183,0,171,0,0,+,ELECTRIC,20,ILELG,5/22/2002,"UTILITIES (GAS,ELEC.,ETC)",COMMONWEALTH EDISON,AVGD 01 02 03 04 05 06 07 08 09 10 WEIGHTED
    *** SCRIPT FOR TABLES LOADED ***
    CREATE TABLE BUDGET_LINE (
    BUDGET_LINE_ID NUMBER NOT NULL,
    BUDGET_TYPE CHAR (1) NOT NULL,
    GL_CODE_COMBO_ID NUMBER NOT NULL,
    AMOUNT_TYPE CHAR (1) NOT NULL,
    ACTIVE CHAR (1) DEFAULT 'T' NOT NULL,
    SOURCE CHAR (1),
    CUT CHAR (1),
    DESCRIPTION VARCHAR2 (180),
    CAP_ITEM_ID NUMBER,
    PBT_ID NUMBER,
    BILL_ID NUMBER,
    CREATED_ON DATE DEFAULT SYSDATE NOT NULL,
    CREATED_BY NUMBER NOT NULL,
    UPDATED_ON DATE DEFAULT SYSDATE NOT NULL,
    UPDATED_BY NUMBER NOT NULL,
    CHECK (ACTIVE IN ('T','F') ) ,
    CHECK (CUT IN ('C',NULL) ),
    CONSTRAINT BUDGET_LINE_PRI
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;
    CREATE TABLE BUDGET_COST (
    BUDGET_LINE_ID NUMBER NOT NULL,
    PERIOD_ID NUMBER NOT NULL,
    AMOUNT NUMBER (13,2),
    CONSTRAINT BUDGET_COST_PRI
    PRIMARY KEY ( BUDGET_LINE_ID, PERIOD_ID ) ) ;
    CREATE TABLE GL_CODE_TEMP (
    BUDGET_LINE_ID NUMBER NOT NULL,
    SPENDER CHAR (5),
    ACCT CHAR (7),
    GL_CODE_COMBO_ID NUMBER,
    CONSTRAINT GL_CODE_TEMP_BDGT_ID
    PRIMARY KEY ( BUDGET_LINE_ID ) ) ;

    Thanks for the reply .. user do have their user credentials but only for the application ... but all users use a common loader and control file once they log into the application. So irrespective of which user is logged in he selects the same control file and loads to the same table mentioned in the control file .. i instead want user to be able to load to the table in control file but into his schema like username.tablename instead of just the tablename mentioned in .ctl file.

  • Select-option/Parameter & Primary Key

    Dear Abaper,
        It this compulsory to have a Table fields define in Parameter/Select-option of Selection screen should be  Primary key of respective tables??
    and
      If we used two different tables having common fields and if common field of Table1  is primary key and Table2  is not a primary key can we used that common field in Parameter/Select-option of selection screen?
    Thanks & regards
    Mahendra

    Hi,
    Its not necessary to have fields in parameters/select options to be primary key. It just takes the datatype irrespective of the primary key.
    I have written a small example for you:
    PARAMETERS: a(18) type c,
                b type matnr, "data element
                c type mara-matnr. "table-fieldname
    These all are one and the same thing. a/b/c will have char 18 data type and length.
    Regards
    Purnand

  • How do I autogen a value for primary key on inserts

    I'm running 4.0. I am writing an app that maintains distributed database inventory information. All of my tables have surrogate numeric primary keys. I have created several report/form combinations. From the report, I can choose to create a new instance of an object; Server for instance. When I click the "Add Server >" button, the Detail page opens for me to create the new entry. On this page, I need to have the Server_ID autogenerated. I'm thinking something as simple as "Select (max(server_id)+1) from Server" should do. In fact, it looks like it is going to work because the field gets populated correctly. But, when I click the "Create" button on this page I get an error that says the Server_ID is null. Seems like the generated value isn't making it to the INSERT statement.
    On the Page Definition, I have Server_ID set as Display Only and in the Source section for the attribute I have "Only when current value in session state is null" selected and "SQL Query (return single value)" selected with "Select (max(server_id)+1) from Server" in the "Source value or expresssion" field.

    Hi Ken,
    From your description it appears you want the new server ID to be assigned and show on the page prior to collecting the rest of the information, rather than assigning it upon saving the new row. What you're doing will get the next available ID, but what happens if two or more people are entering new servers at once? There's a good chance they'll all get the same next ID.
    Tony's suggestion will ensure the uniqueness of the server ID because it'll get assigned upon saving the row, rather than on display of the page where a user could leave the screen sitting there while others "take" that next ID. You can return the value that the trigger assigns for display - if you're using an Automatic Row Processing process, see the Return Key into Item setting.
    If you're going to stick with your approach and just need to know how to make sure that field is included in the INSERT, you need to create a computation on that item and move your "select max..." there, and then for the server ID item change the Source Used to "Always...", Source Type to Database Column, and specify the column name from the table in the Source Value. The reason is hasn't been working is that field isn't currently mapped to the table column.
    Hope this helps,
    John

  • Editing or creating a record for primary Key of a table in FORM

    Hi,
    i have to create a form using 10columns out of a 25column table...
    one of the columns of this 10 is PRIMARY KEY.....
    in the process of creating the form ...it is asking me for a primary key....when i select a column(out of 10) as primary key , i am not getting that primary key in the form.....
    i am a newbie....please send some solutions to add primary key in a form so that it can be inserted or modified....
    Thanks
    raj

    Hi,
    When you create a form, you get a region and several items. If you look at your page definition, you will see these listed - the region will be called whatever name you gave it (eg, "Employee") and the items will be listed as Pnn_EMPNO, Pnn_NAME, Pnn_SALARY and Pnn_DEPT (nn = page number). The Pnn_EMPNO item will be shown as "Hidden and Protected". This means that the field is on the page but the user can not see it nor edit it.
    When you create a new record, this field will be empty. When you edit an existing record, this field will contain the EMPNO value for that record. When you save a new record, this field is given a primary key value based on whatever method you specified when you created the form.
    If you don't see the Pnn_EMPNO item, then the form has not been created correctly. Do you see this item on your page definition?
    Andy

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Usage of custom domains for primary keys

    Hi,
    I have a question regarding the possibility to use custom domains on primary key attributes: are there any special requirements/constraints in order to do this (like for example providing consistent equals() and hash() methods...)?
    Thanks,
    Dan

    Dan:
    Yes. Provide the correct equals() and hash() is the most important thing you need to do. There are other things you need to think about if the domain is NOT a scalar domain (single value). But, BC4J assumes that the PK is a scalar value, so your custom domain should be a scalar value value ==> equals and hash are two thing you'd need.
    Thanks.
    Sung

  • Autonumber for Primary Key in Z Table

    Hi,
      I want to use an auto generated number as primary key for a Z table that i want to create. Is there some exiting data element tht I can use, so that I dont have to explicitly enter the primary key everytime i enter a record in SM30

    Hi,
    There is no automatically way of generating number...
    But You can create a number range object in the transaction SNRO.
    Then use the FM NUMBER_GET_NEXT to get the next number....
    Then assign that number using the event 05 "new entries" which you can set in the view TVIMF.
    Thanks,
    Naren

  • Select statement for primary keys

    Hi
    What is the syntax to select a statement from a table with only primary keys. there are 4 primary keys i have to select all the 4 primary keys is there any syntax difference???

    Hi,
    do u want those primary keys in the internal table or else will u have a where condition based on those all the primary key fields
    if u use all the four primary keys u can write like this remember one thing first u write the field just like in the table created order it is not mandatory to do like that but it increases the performance of the so query
    select single * from ztable into table t_tab where (mention all the four primary keys here ) it increases the performance we are using this single because u r giving all the primary keys in the select query so obvously one record will be there so it increases the query performance..
    if wont give those primary keys then write like this select * from ztable into table t_tab.
    as normal as ordinary
    i hope u got cleared
    plzz reward if it is helpful..
    plzz dont forget to reward...

  • What is the best practice for creating primary key on fact table?

    what is the best practice for primary key on fact table?
    1. Using composite key
    2. Create a surrogate key
    3. No primary key
    In document, i can only find "From a modeling standpoint, the primary key of the fact table is usually a composite key that is made up of all of its foreign keys."
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/logical.htm#i1006423
    I also found a relevant thread states that primary key on fact table is necessary.
    Primary Key on Fact Table.
    But, if no business requires the uniqueness of the records and there is no materilized view, do we still need primary key? is there any other bad affect if there is no primary key on fact table? and any benifits from not creating primary key?

    Well, natural combination of dimensions connected to the fact would be a natural primary key and it would be composite.
    Having an artificial PK might simplify things a bit.
    Having no PK leads to a major mess. Fact should represent a business transaction, or some general event. If you're loading data you want to be able to identify the records that are processed. Also without PK if you forget to make an unique key the access to this fact table will be slow. Plus, having no PK will mean that if you want to used different tools, like Data Modeller in Jbuilder or OWB insert / update functionality it won't function, since there's no PK. Defining a PK for every table is a good practice. Not defining PK is asking for a load of problems, from performance to functionality and data quality.
    Edited by: Cortanamo on 16.12.2010 07:12

  • How shall we do validation for Unique Key and Multiple Primary Key?

    Hi,
    I have table created From EO in which one column is checked as Unique.
    How to do validation for column checked as Unique.
    I know how to do validation for column checked as primary key.
    Below is sample code for primary key validation
    if (getRvSize() != null)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "RvSize", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name
    if (value != null)
    OADBTransaction transaction = getOADBTransaction();
    Object[] rvKey = {value};
    EntityDefImpl rvDefinition = xxczVAGCSRVSizingEOImpl.getDefinitionObject();
    xxczVAGCSRVSizingEOImpl rv =
    (xxczVAGCSRVSizingEOImpl)rvDefinition.findByPrimaryKey(transaction, new Key(rvKey));
    if (rv != null)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "RvSize", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_UNIQUE"); // Message name
    What changes need to be done for above code in order to do the validation for Unique Key.
    I have one more Question
    How shall we do the Validation for Multiple Primary Key in a table?
    - Mithun

    1. If you just validate on one attribute like your unique key, then put your logic in the set<Your AttributeName) method
    2. If you want to do the cross validation ( like validating multiple attributes) then put your logic in the validateEntrity Method
    How to do that?
    1. Create a Validation View object.
    2. Associate your VVO to the VAM
    3. Create entity expert.
    4. Have method in entity expert for your validation (you would be calling AM and then VO execute the query and do the validation.
    5. You would be calling the Entity experty method from your EO either setMethods or validateEntity.
    I have given just the high level points.
    Hope this helps.
    Thanks,
    RK

  • Automatic primary key generation for pointbase

    Hello friends,
    I was wondering whether it is possible to automatically generate primary keys for a pointbase database. Just like the SQL Server pointbase also has a indentity property. I have used weblogic builder to specify automatic key generation. Through the pointbase console I can see that all the columns for all the tables are marked as nullable except the primary key columns. However when I try to insert data into the database using ejb. I get the exception :
    javax.ejb.EJBException: EJB Exception:: java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    ; nested exception is: java.sql.SQLException: Data exception -- null value not allowed. .
    java.sql.SQLException: Data exception -- null value not allowed. .
         at com.pointbase.net.netJDBCPrimitives.handleResponse(Unknown Source)
         at com.pointbase.net.netJDBCPrimitives.handlePrimitiveResponse(Unknown Source)
         at com.pointbase.net.netJDBCPreparedStatement.executeUpdate(Unknown Source)
         at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.__WL_create(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3177)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.ejbPostCreate(DirectoryItem_lh4yf1__WebLogic_CMP_RDBMS.java:3094)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.manager.DBManager.create(DBManager.java:1151)
         at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1100)
         at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
         at yellowpages.ejb.DirectoryItem.DirectoryItem_lh4yf1_LocalHomeImpl.create(DirectoryItem_lh4yf1_LocalHomeImpl.java:94)
         at yellowpages.web.controller.AddEntryAction.execute(Unknown Source)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    I am not sure whether I understand your question.
    The 'NamedSequenceTable' method is independent of data base type.
    <from-docs>
    Create a table named SEQUENCE to hold the current primary key value. The
    table consists of a single row with a single column, as defined by the
    following statement:
    CREATE table_name (SEQUENCE int)
    INSERT into table_name VALUES (0)
    </from-docs>
    Then, you can add the following in the DD -
    <automatic-key-generation>
    <generator-type>NamedSequenceTable</generator-type>
    <generator_name>table_name</generator-name>
    <key-cache-size>100</key-cache-size>
    </automatic-key-generation>
    The PK type should be set to java.lang.Integer or java.lang.Long
    --Sathish
    <Panduranga Swamy> wrote in message news:[email protected]..
    Hi,
    With named sequecne table,I am able to develop the application. What I
    wanted is Say Table 1 having Identity column as Primary key in the table
    Pointbase database.
    With Automatic primary key generation in Deployment descriptor, We
    generally specify SQL_SERVER or Named Sequencetable for Primary key
    generation.
    For pointbase database, I dont know how to configure this?
    Could you help me in this regard,
    Thanks,
    Pandu

  • Composite Primary Key Mapping error

    I have the following code:
    public class PreviousStepEJB3PK implements Serializable {
    private static final long serialVersionUID = 3024775815042084864L;
    public Long id;
    public Long previousId;
    public PreviousStepEJB3PK() {
    public PreviousStepEJB3PK(Long id, Long previousId) {
    this.id = id;
    this.previousId = previousId;
    public boolean equals(Object other) {
    if (other instanceof PreviousStepEJB3PK) {
    final PreviousStepEJB3PK otherPreviousStepPK = (PreviousStepEJB3PK) other;
    final boolean areEqual = (otherPreviousStepPK.id.equals(id) && otherPreviousStepPK.previousId.equals(previousId));
    return areEqual;
    return false;
    public int hashCode() {
    return super.hashCode();
    @Entity
    @Table(name = "OS_CURRENTSTEP_PREV")
    @NamedQuery(name = "findById",
         query = "select object(o) from PreviousCurrentStepEJB3 o where o.id = ?1")
    @IdClass(PreviousStepEJB3PK.class)
    public class PreviousCurrentStepEJB3 implements Serializable {
    private static final long serialVersionUID = 1717698904412346878L;
    @Id
    @Column(name = "ID", nullable = false)
    private Long id;
    @Id
    @Column(name = "PREVIOUS_ID", nullable = false)
    private Long previousId;
    public PreviousCurrentStepEJB3() {
    I´m using eclipse to deploy my application over an OC4J. When I launch the deploy I have the following error:
    07/07/05 11:42:47 Caused by: Exception [TOPLINK-7150] (Oracle TopLink Essentials - 2006.8 (Build 060829)): oracle.toplink.essentials.exceptions.ValidationException
    Exception Description: Invalid composite primary key specification. The names of the primary key fields or properties in the primary key class [ar.com.eds.mcd.fawkes.model.PreviousStepEJB3PK] and those of the entity bean class [class ar.com.eds.mcd.fawkes.model.PreviousCurrentStepEJB3] must correspond and their types must be the same. Also, ensure that you have specified id elements for the corresponding attributes in XML and/or an @Id on the corresponding fields or properties of the entity class.
    07/07/05 11:42:47      at oracle.toplink.essentials.exceptions.ValidationException.invalidCompositePKSpecification(ValidationException.java:995)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator.throwInvalidCompositePKSpecification(MetadataValidator.java:119)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.validatePrimaryKey(ClassAccessor.java:1463)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:463)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:196)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.processORMetadata(EntityManagerSetupImpl.java:993)
    07/07/05 11:42:47      at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:501)
    07/07/05 11:42:47      at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:152)

    I ran into a similar problem. I was able to work around it by putting the @Id annotations on the accessors for the primary key fields rather than on the fields themselves. This seems like a bug to me.

  • 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

  • Cluster DuplicateKeyExecption and primary key generation

    Hi
    I have 2 applications servers working in a cluster.
    I'm using for primary key generation The pattern "sequence blocks" taken from the book ejb design patterns.
    However when i have something like 5 threads that are trying to create new entities then i get DuplikateKeyException on the primary key. (with only 1 jboss server not in a cluster everything is fine).
    I was wondering if anybody could help me pin out the problem, following is my code:
    I estimated it might be an Isolation level problem, however i have updated the isolation level to be serializable in that way in mysql ds and the problem still happend...
    Code:
    <user-name>root</user-name>
    <password></password>
    <TransactionIsolation>TRANSACTION_SERIALIZABLE</TransactionIsolation>
    Sequence entity bean
    Code:
    import javax.ejb.*;
    abstract public class SequenceBean implements EntityBean {
    EntityContext entityContext;
    public java.lang.String ejbCreate(java.lang.String name) throws CreateException {
    setName(name);
    return null;
    public void ejbPostCreate(java.lang.String name) throws CreateException {
    setSIndex(ConfigContainer.getJMXPropertiesFacade().getSequenceSessionBeanStartIndex());
    public void ejbRemove() throws RemoveException {
    public abstract void setName(java.lang.String name);
    public abstract void setSIndex(int sIndex);
    public abstract java.lang.String getName();
    public abstract int getSIndex();
    public void ejbLoad() {
    public void ejbStore() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void unsetEntityContext() {
    this.entityContext = null;
    public void setEntityContext(EntityContext entityContext) {
    this.entityContext = entityContext;
    public int getValueAfterIncrementingBy(int blockSize) {
    this.setSIndex(this.getSIndex()+ blockSize);
    return this.getSIndex();
    sequence session bean
    Code:
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import org.apache.log4j.Category;
    public class SequenceSessionBean implements SessionBean {
    SessionContext sessionContext;
    private Category _log;
    private class Entry {
    Sequence sequence;
    int last;
    private java.util.HashMap _entries = new java.util.HashMap();
    private int _blockSize;
    private int _retryCount;
    private SequenceHome _sequenceHome;
    public void ejbCreate() throws CreateException {
    _log = Category.getInstance(getClass());
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
    Context namingContext = null;
    try {
    namingContext = new javax.naming.InitialContext();
    _blockSize = JMXPropertiesFacade.getInstance().getSequenceSessionBeanBlockSize();
    _retryCount = JMXPropertiesFacade.getInstance().getSequenceSessionBeanRetryCount();
    _sequenceHome = (SequenceHome) namingContext.lookup("SequenceLocalHome");
    catch (NamingException e) {
    _log.error(e.getMessage(), e);
    public void synch() throws InternalException {
    Connection connection = null;
    ResultSet resultSet = null;
    Statement statement = null;
    int maxObjectID = 0, maxUID = 0, maxShareID = 0;
    try {
    connection = MASConnectionManager.getInstance().createConnection();
    String sql = "select max(" + AlbumElementHome.FIELD_NAME_OBJECT_ID + ") maxObjectID from " + AlbumElementHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxObjectID = resultSet.getInt("maxObjectID");
    _log.debug(String.valueOf(maxObjectID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementHome.JNDINAME)).setSIndex(maxObjectID
    + 1);
    sql = "select max(" + UserHome.FIELD_UID + ") maxUID from " + UserHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxUID = resultSet.getInt("maxUID");
    _log.debug(String.valueOf(maxUID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(UserHome.JNDINAME)).setSIndex(maxUID + 1);
    sql = "select max(" + AlbumElementShareHome.FIELD_SHARE_ID + ") maxShareID from " + AlbumElementShareHome.TABLE_NAME;
    statement = connection.createStatement();
    _log.debug("SQL : " + sql);
    statement.execute(sql);
    resultSet = statement.getResultSet();
    if (resultSet.next()) {
    maxShareID = resultSet.getInt("maxShareID");
    _log.debug(String.valueOf(maxShareID));
    resultSet.close();
    statement.close();
    ((Sequence) sequenceHome.findByPrimaryKey(AlbumElementShareHome.JNDINAME)).setSIndex(maxShar
    eID + 1);
    } catch (SQLException e1) {
    _log.error(e1.getMessage(), e1);
    } catch (FinderException e) {
    throw new InternalException(e);
    } finally {
         try {
         if (connection != null && !connection.isClosed()) connection.close();
         } catch (SQLException e) {
         _log.error(e.getMessage(), e);
    public int getNextSequenceNumber(String name) {
    try
    Entry entry = (Entry) _entries.get(name);
    if (entry == null)
    // add an entry to the sequence table
    entry = new Entry();
    try
    entry.sequence = _sequenceHome.findByPrimaryKey(name);
    catch (javax.ejb.FinderException e)
    _log.info("can't find sequence: " + name + " trying to create it");
    // if we couldn't find it, then create it...
    entry.sequence = _sequenceHome.create(name);
    _log.info("sequence: " + name + " created");
    _entries.put(name, entry);
    if (entry.last % _blockSize == 0)
    for (int retry = 0; true; retry++)
    try
    entry.last = entry.sequence.getValueAfterIncrementingBy(_blockSize);
    break;
    catch (javax.ejb.TransactionRolledbackLocalException e)
    if (retry < _retryCount)
    // we hit a concurrency exception, so try again...
    _log.info("RETRYING");
    continue;
    else
    // we tried too many times, so fail...
    throw new javax.ejb.EJBException(e);
    return entry.last++;
    catch (javax.ejb.CreateException e)
    throw new javax.ejb.EJBException(e);
    from ejb-jar.xml
    Code:
    <container-transaction>
    <method>
    <description />
    <ejb-name>SequenceSession</ejb-name>
    <method-name>getNextSequenceNumber</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    jboss.xml
    Code:
    <container-configurations>
    <container-configuration>
    <container-name>Standard CMP 2.x EntityBean with cache invalidation</container-name>
              <commit-option>A</commit-option>
              <cache-invalidation>True</cache-invalidation>
    </container-configuration>
    </container-configurations>
    <entity>
    <ejb-name>Sequence</ejb-name>
    <local-jndi-name>SequenceLocalHome</local-jndi-name>
    <!-- no cache for this entity bean -->
    </entity>
    anybody can help with what the problem might be?
    did i update the isolation level correctly?

    _blocksize may be returning 0                                                                                                                                                                                                                                   

Maybe you are looking for

  • Tab in TLF !!!

    Hi I am trying to implement a sample of TLF with feature of Tab for paragraph like word document. If user click in paragraph and press 'Tab' then it should work like same as we experience in Word. Can any one guide me ? Bharat Patel

  • How to enable Portfolio Analysis Feature for Project Server 2010?

    Hi, We have a Project Server 2010 instance. We now want to Use the Portfolio Analysis on our server. How can we enable the feature on our existing environment without disturbing any current feature that we have ? If someone can provide with the detai

  • Data extraction using ODS objects

    Hello everybody, I am trying to extract CRM data into SAP BW. Found a standard ODS Object 0CRMBPKPI, which i think is relavent as i need to extract Business partner data from CRM. Does anybody know the procedure how to extract data using this ODS obj

  • Path towards creating a Timeline in Numbers '09

    Hi; i'm trying to figure out how to build a timeline in Numbers '09 with a graph. I'm trying to build say a one year graph with daily increments on the X Axis. The data looks like this: Date CC Store Item Category Price 2/1/08 AmEx xx379 TRADER JOE'S

  • What's the best way to migrate to a new machine in this situation?

    Hi I'm shortly going to get my macbook pro replaced due to an error with the machine and will need to transfer everything across, the thing is I won't have the two computers physically present at the same time. As I'll be handing my present one in, t