ESB DbAdapter primary key question

Hi,
I have an ESB process that pushes data from a legacy table into the GL_INTERFACE table in Oracle E-Business Suite.
The DbAdapter for reading from the legacy table had two primary keys defined. We've recently learned that these two fields do not always uniquely identify a record. If I had two records with the same data in these two fields, they would both be inserted into the destination table, but the data inserted for both records would be the same as that of the first record (seemingly ignoring the second record). I solved this problem by defining a third primary key relationship in the DbAdapter, and that worked fine.
My question is this: why did both records inserted into the destination table contain the same data?
Any ideas?
Thanks in advance.

The the table in the database doesn't have a primary key defined, but, of course, Oracle's DBAdapter requries primary keys defined. There were actually two records in the database, with the same information in the columns that I defined as primary keys, but other information was different for the two records. It seems as though the ESB used the data from the first record when it encountered the second. Am I correct that this is what happened?

Similar Messages

  • Primary key question with PHPmysql database

    I know that updating the primary key is taboo, but I have a a newsletter subscription form set up that works perfectly, but I can't figure out how to create the primary key.  I tried using the subscriber email address (because its unique, but in trying to add an update function I realize that the email address may need to be updated.
    My question is how do I get a primary key that will work when I'm relying on a form variable to create the record and therefore have no control over assigning one?
    Is there a way to have one automatically assigned when a subscriber hits the submit button?

    Bingo.
    I wrote:
    ALTER TABLE email_list  ADD (      id MEDIUMINT NOT NULL AUTO_INCREMENT,      name CHAR(30) NOT NULL,      PRIMARY KEY (id)  )
    I got my primary key column.  thank you so much!!!

  • Composite Primary Key question

    I have a new question regarding composite primary keys on another table I have created.
    I have the following table with the following definition:
    CREATE TABLE "APSOM"."CPULIST"
    ( "CPU_ID" VARCHAR2(10 BYTE),
    "SERVER_ID" VARCHAR2(10 BYTE),
    "CREATED_DATETIME" TIMESTAMP (6),
    "UPDATED_DATETIME" TIMESTAMP (6)
    with the following composite PK definition:
    ALTER TABLE "APSOM"."CPULIST" ADD CONSTRAINT "CPULIST_PK" PRIMARY KEY ("CPU_ID", "SERVER_ID")
    Then, I inserted data in the following way:
    insert into CPULIST
    values ('CPU1', 'P1', SYSDATE, SYSDATE);
    with following CPU ID values from 'CPU1' to 'CPU16' for SERVER ID value 'P1' also inserted as well.
    Now, I am trying to insert values for SERVER ID value 'P2'
    insert into CPULIST
    values ('CPU1', 'P2', SYSDATE, SYSDATE);
    and I am getting the following error message:
    Error starting at line 1 in command:
    insert into CPULIST
    values ('CPU1', 'P2', SYSDATE, SYSDATE)
    Error report:
    SQL Error: ORA-00001: unique constraint (APSOM.XPKCPULIST) violated
    00001. 00000 - "unique constraint (%s.%s) violated"
    *Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action: Either remove the unique restriction or do not insert the key.
    Using the following SQL command:
    select column_name from all_cons_columns
    where constraint_name = 'CPULIST_PK'
    and owner = 'APSOM';
    I get the following records
    1. CPU_ID
    2. SERVER_ID
    This error does not make sense to me. Any help would be appreciated.
    Thanks,
    Patrick Quinn
    Operations
    Turning Point Global Solutions

    So, if there is a hidden unique constraint XPKCPULIST that cannot be pulled the all_cons_column table and I drop the XPXCPULIST constraint with the following SQL:
    alter table CPULIST drop constraint XPKCPULIST;
    Error starting at line 1 in command:
    alter table CPULIST drop constraint XPKCPULIST
    Error report:
    SQL Error: ORA-02443: Cannot drop constraint - nonexistent constraint
    02443. 00000 - "Cannot drop constraint - nonexistent constraint"
    *Cause:    alter table drop constraint <constraint_name>
    *Action:   make sure you supply correct constraint name.
    What can I do to get past this so I can perform the following insert and receive this error message??
    insert into CPULIST
    values ('CPU1', 'P2', SYSTIMESTAMP, SYSTIMESTAMP);
    Error starting at line 1 in command:
    insert into CPULIST
    values ('CPU1', 'P2', SYSTIMESTAMP, SYSTIMESTAMP)
    Error report:
    SQL Error: ORA-00001: unique constraint (APSOM.XPKCPULIST) violated
    00001. 00000 - "unique constraint (%s.%s) violated"
    *Cause:    An UPDATE or INSERT statement attempted to insert a duplicate key.
    For Trusted Oracle configured in DBMS MAC mode, you may see
    this message if a duplicate entry exists at a different level.
    *Action:   Either remove the unique restriction or do not insert the key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Primary Key Question

    Probably a silly question - I'm fairly new to APEX and trying to design a small system. I come from a FORMS background, and would always have had my support tables with character keys e.g. Clubs - Club_code, varchar2(3), Club_name varchar2(30) with values like "ABC" and "CDE" as mnemonic primary keys. APEX seems to want a sequential PK on the tables used - is it feasible to use character PK fields, or better to go with the default functionality?
    Thanks
    Malcolm

    Hi Mal,
    like you I'm not a fan of sequence generated keys on everything, I think this was a design choice made by the Apex team in the early days of Apex (HTMLDB) when the intention was that Apex would be intended primarily for non-technical users. To me its an implementation choice and has nothing to do with relational design theory, and when working with new interfaces to existing systems, it may be a choice the developer does not have. I think it would just be simpler if the Apex developer had that choice when using the wizards.
    For ordinary forms it is not too difficult.
    1. Create a new page as a "Form on a Table with Report". Identify the PK field and set this as populated from an existing trigger.
    2. Edit the form page that was created. Edit the item created for the PK field. Set the "Display As" property under "Name" to "text field".
    3. Set the "Read Only Condition Type" property under "Read Only" to "Value of Item in Expression 1 is NOT NULL". Enter the name of the item in "Expression 1".
    Now when you run the report page, depending whether the table is empty you may see some rows. Regardless, you can click on the create button and it will take you to the form page with the PK text field enterable. You can enter a row of data and click create and you are taken back to the report page. Now when you click the edit link for a row in the report you will see that you are taken to the form page with the PK field is now Read Only. (Correct behaviour as PKs should not be updateable)
    Depending how you specified the link in the report page, you may also want to change the PK column to show the value of the column rather than an edit graphic. This can be done by editing the report page and then editing the Report Attributes of the report region. Edit the PK column from the list of columns and set the Link Text in the Column Link to the column name surrounded by # character. ie #P30_COL_NAME#. This can be quickly achieved by clicking the column name quick link just below.
    Unfortunately there is easy fix with the tabular forms wizard. You either have to create new Multi Row Update processes or possibly use the updateable views and instead of triggers method.
    Regards
    Andre

  • Composite Primary key & Primary key questions

    Background:
    1.5 TB data warehouse. All tables use at least a 3 column composite Primary key. Most use 3. col1||col2||col3 to achieve uniqueness.
    col1= very low cardinality. 99% of the values are '0'
    col2 = high cardinality. (SSN's, loaded monthly)
    col3 = low cardinality. (monthly sequence number used for partitioning)
    From what I've read, the first column used in a composite primary key also receives its own index. If that is correct, then the primary key being used is losing its effectiveness by putting a very low cardinality column as the first column of the Primary key. By moving col2 to the first position of the composite key, I would be obtaining an index on SSN which would be much more useful. (Please correct me if I'm wrong) Or since the index would be so large anyway, the CBO would just do full table scans which is what I'm trying to get away from.
    This Primary key is used to ensure uniqueness during loads. Other than that, it really has no purpose and is never queried by the user. (WHERE col1||col2||col3 = xxxxxxxxx)
    As a DBA, I see this massive tablespace for holding the primary keys now reaching in excess of 157 GB and it seems like such a waste of space. The problem I'm running across is how to ensure uniqueness during the loads w/o having to store the unique values. (the 157 GB) If I drop the PK's, then create unique indexes just for the loads, then the unique index would be generated against the entire table, which would take forever.
    If you create a local index (what I want in the end) it still has to create the index for all previous partitions (250+ partitions). You can't create a specific 'local' index on a partition. You create a local index on the table and when a new partition is added, the index is then added as well. That's what I want to do with some of my fields like SSN but for loading purposes, this isn't going to help me.
    I need a way to ensure uniqueness during a monthly load of a new partition (col1||col2||col3) but w/o having to store these values for eternity. Right now it's the primary key, so it has to be stored. I hope I'm making sense here. Any ideas?

    I think you need some clarification about the index supporting the primary key.
    The primary key is unique - the database will enforce this for you.
    All of the columns in the primary key are in the index that enforces the key (not just the first column).
    Usually this index is a unique index, but you can have a non-unique index supporting a primary key.
    I'm a little confused with some of your other statements
    how to ensure uniqueness during the loads w/o having to store the unique valuesIf you don't store the value how do you know it is unique?
    Did you mean that you don't want to store the key values in both the table and the index?
    You may want to consider making col3 (the partition key) the leading column of the index, so you can create a local (instead of global) PK index.
    I wouldn't worry too much about col1 (the column full of mostly zeros) - numbers are stored variable length. A NUMBER(38) that holds a zero takes no more space than a NUMBER(1) that holds a zero.

  • Database Primary Key Question - Best Practices

    I posted this in the ADDT forum, but I imagine I'll get more
    responses here:
    All you database developers - how do you deal with primary
    keys? Do you
    ALWAYS use an AutoIncrement/AutoNumber? Or only sometimes? Is
    there an
    argument to NOT use AutoIncrement? I know how I create
    databases and how
    I usually do things. I know how a few of my colleagues work.
    But how
    about the rest of the world? (Research for a MS Access book I
    am
    involved with.)
    Alec
    Adobe Community Expert

    .oO(Alec)
    >I posted this in the ADDT forum, but I imagine I'll get
    more responses here:
    >All you database developers - how do you deal with
    primary keys? Do you
    >ALWAYS use an AutoIncrement/AutoNumber?
    No.
    >Or only sometimes? Is there an
    >argument to NOT use AutoIncrement?
    AUTO_INCREMENT is a proprietary MySQL feature. For some
    people this
    might be an argument against it, but doesn't have to. Every
    DBMS has its
    own special features. You just have to decide whether you
    want to keep
    your code/queries as portable as possible or want to get the
    most out of
    your DB. Usually I prefer performance/features over
    portability, simply
    because for me and my projects it's very unlikely that I have
    to change
    the DBMS. I've chosen MySQL for good reasons and will stay
    with it for
    quite a while.
    >I know how I create databases and how
    >I usually do things. I know how a few of my colleagues
    work. But how
    >about the rest of the world? (Research for a MS Access
    book I am
    >involved with.)
    It always depends on the table itself, what data it contains,
    what I
    want to do with it and also some personal preferences. In n:m
    tables for
    example there's no need for an extra numeric PK, since the
    entire record
    already is the PK, built from two or more FKs.
    But if I need a numeric PK, I usually use sequences. Some
    DBMS support
    them natively, in MySQL they can be emulated with an extra
    table. It
    simply means, that the used PK number is generated _before_
    the record
    itself is inserted. For me and my framework this has some
    advantages
    (makes the internal work a bit easier), but of course in
    other cases an
    AUTO_INCREMENT might be more appropriate.
    So IMHO there's no general solution. If an AUTO_INCREMENT or
    something
    similar fits your needs, you should use it. I don't see a
    real problem
    with that.
    Micha

  • Compsite Primary Key question

    Hi guys,
    First of all, I am really newbie in DB deals.
    There are "best practices" about the order/position of the columns of a composite primary key?...
    By instance, I have a table named STOCK:
    CODE ISSUE STATUS etc...
    1020 2007 OK
    1030 2007 OK
    1040 2007 OK
    1020 2008 OK
    1030 2008 NA
    If I want to add a composite key with the columns CODE and ISSUE, it is the same (CODE, ISSUE) than (ISSUE, CODE) key ?... thera are a rule to consider the order of the columns in the composite primary key in big tables?...
    Thanks a lot for you comments...

    Assuming that a composite primary key is appropriate, it shouldn't matter what order you list them unless you have queries that select data based on only one of the two columns.
    I am generally suspicious of self-described newbie's that are creating composite primary keys, though. From a data modeling perspective, that means that any child tables are going to have to have both CODE and ISSUE columns. You have to remember to join on both columns every time. The columns CODE and ISSUE also don't sound like the sort of immutable columns that you would want for a primary key-- writing code to do cascading updates if you ever have to change a primary key value is a pain.
    Justin

  • Urgent - ESB: DB Adapter with composite primary keys no returning any data

    I have a DB Adapter in the ESB that inserts/updates/selects data to/from a table with 2 columns as primary keys, but table has several columns.
    1. Initially, the db table had constraints for the composite primary key, The DB adapter had valid data coming in, but no result data.
    2. Then I removed the db constraints on the composite primary key, and selected the 2 columns in the DB adapter wizard. Still, valid data is going in, since I am outputing to a file prior to call this node, but no result data is appearing. The result XML is empty.
    Do I need to do something in Toplink for this?
    The table spec is below. the ACCT_FIELD and ACCT_CODE columns make up the composite primary key.
    CREATE TABLE AFF_DATA_SYNC
    ACCT_FIELD NUMBER NOT NULL,
    ACCT_CODE VARCHAR2(16) NOT NULL,
    ACCT_EXISTS_FLAG VARCHAR2(1),
    SAVE_ACCT_SEG_XML CLOB,
    LAST_UPDATE_DATE DATE
    The following xml is the request to the DB adapter:
    <top:AffDataSyncReadDBAdapterSelect_accountField_accountCodeInputParameters xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AffDataSyncReadDBAdapter">
    <top:accountField>8</top:accountField>
    <top:accountCode>0003888</top:accountCode>
    </top:AffDataSyncReadDBAdapterSelect_accountField_accountCodeInputParameters>
    Log output:
    JCA: esb:///ESB_Projects/STRIPES-AFF-Data-Intg_AFF-Data-Integration/AffDataSyncReadDBAdapter.wsdl [ AffDataSyncReadDBAdapter_ptt::AffDataSyncReadDBAdapterSelect_accountField_accountCode(AffDataSyncReadDBAdapterSelect_accountField_accountCode_inparameters,Af
    DataSyncWipCollection) ] - No XMLRecord headers provided
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Executing query with arguments [8, 0003917]
    JCA: <oracle.tip.adapter.db.TopLinkLogger log> SELECT ACCT_FIELD, ACCT_CODE, ACCT_EXISTS_FLAG, SAVE_ACCT_SEG_XML, LAST_UPDATE_DATE FROM
    AFF_DATA_SYNC_WIP WHERE ((ACCT_FIELD = ?) AND (ACCT_CODE = ?))
    bind => [8, 0003888]
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Read the following objects: []
    Message was edited by:
    user589357
    Message was edited by:
    user589357
    Message was edited by:
    user589357
    Message was edited by:
    user589357

    The Toplink has no errors. Now I changed my table with only a single primary key, but for some reason, I am still getting no data.
    JDeveloper 10.1.3.3 / SOA Suite (only using ESB) 10.1.3.3 with Oracle DB 10g 10.2.0.3.
    1. What does No XMLRecord headers found mean?
    2. Notice the last log item; Read ... []
    Here are the log contents:
    Invoking next service "AffDataSyncReadDBAdapterSelect_recordId" with payload :
    <top:AffDataSyncReadDBAdapterSelect_recordIdInputParameters xmlns:top="http://xmlns.oracle.com/pcbpel/adapter/db/top/AffDataSyncReadDBAdapter">
    <top:recordId>80003888</top:recordId>
    </top:AffDataSyncReadDBAdapterSelect_recordIdInputParameters>
    JCA: esb:///ESB_Projects/STRIPES-AFF-Data-Intg_AFF-Data-Integration/AffDataSyncReadDBAdapter.wsdl [ AffDataSyncReadDBAdapter_ptt::AffDataSyncReadDBAdapterSelect_recordId(AffDataSyncReadDBAdapterSelect_recordId_inparameters,AffDataSyncWipCollection)
    ] - No XMLRecord headers provided
    JCA: esb:///ESB_Projects/STRIPES-AFF-Data-Intg_AFF-Data-Integration/AffDataSyncReadDBAdapter.wsdl [ AffDataSyncReadDBAdapter_ptt::AffDataSyncReadDBAdapterSelect_recordId(AffDataSyncReadDBAdapterSelect_recordId_inparameters,AffDataSyncWipCollection)
    ] - Starting JCA LocalTransaction
    JCA: esb:///ESB_Projects/STRIPES-AFF-Data-Intg_AFF-Data-Integration/AffDataSyncReadDBAdapter.wsdl [ AffDataSyncReadDBAdapter_ptt::AffDataSyncReadDBAdapterSelect_recordId(AffDataSyncReadDBAdapterSelect_recordId_inparameters,AffDataSyncWipCollection)
    ] - Invoking JCA Outbound Interaction
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> executing the NamedQuery: AffDataSyncReadDBAdapter.AffDataSyncWip.AffDataSyncReadDBAdapterSelect
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Parsing header record element.
    JCA: <oracle.tip.adapter.db.TopLinkLogger log> client acquired
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Executing query with arguments [80003888]
    JCA: <oracle.tip.adapter.db.TopLinkLogger log> SELECT RECORD_ID, ACCT_FIELD, ACCT_CODE, ACCT_EXISTS_FLAG, SAVE_ACCT_SEG_XML, LAST_UPDATE_DATE
    FROM AFF_DATA_SYNC_WIP WHERE (RECORD_ID = ?)
    bind => [80003888]
    JCA: <oracle.tip.adapter.db.DBInteraction executeOutboundRead> Read the following objects: []
    Message was edited by:
    user589357
    Message was edited by:
    user589357

  • Question about Primary Key

    HI
    I'm going to build a Database to automate center in my university
    The Database version is Oracle 10g v2
    Which data type of primary key should I user?
    I used number in past but I heard there is more efficient data type for this purpose
    Thanks

    BINARY_FLOAT and BINARY_DOUBLE are designed to store floating point numbers. If you are generating synthetic primary keys using a sequence, you are generating integers. It makes no sense from a data modeling perspective to store integer data in floating point fields. And it is exceptionally dangerous if a value gets rounded unexpectedly (floating point numbers lose precision for the trailing bits)
    You'll have to clarify for me what "more helpful for indexing" means. As far as storage space goes, there may be some space savings using a BINARY_FLOAT or BINARY_DOUBLE if you have very large primary key values, but there will be a space penalty for most "normal" sequence-generated values, i.e.
    SQL> create table x (
      2    col1 number,
      3    col2 binary_float,
      4    col3 binary_double
      5  );
    Table created.
    SQL> insert into x values( 1, 2, 3 );
    1 row created.
    SQL> select length(col1), length(col2), length(col3) from x;
    LENGTH(COL1) LENGTH(COL2) LENGTH(COL3)
               1            8            8
    SQL> insert into x values (1e20, 1e20, 1e20 );
    1 row created.
    SQL> select length(col1), length(col2), length(col3) from x;
    LENGTH(COL1) LENGTH(COL2) LENGTH(COL3)
               1            8            8
              21           15            8
    SQL> select * from x;
          COL1       COL2       COL3
             1   2.0E+000   3.0E+000
    1.0000E+20   1.0E+020   1.0E+020So it takes 8 times the storage to store a 1 in a BINARY_FLOAT or BINARY_DOUBLE than it does to store that in a NUMBER column. But it takes less space if you're storing values like 1e20 (a 1 with 20 0's). If you're storing values large enough to get the space benefit, however, you're going to have rounding issues that will cause the application not to function as you'd expect which is presumably a much greater problem than a bit of wasted disk space.
    Justin

  • 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

  • What is the diffrence between Row id and primary key ?

    dear all
    my question is about creating materialized views parameters (With Rowid and
    With Primary kry)
    my master table contains a primary key
    and i created my materialized view as follow:
    CREATE MATERIALIZED VIEW LV_BULLETIN_MV
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    REFRESH FAST ON DEMAND
    WITH PRIMARY KEY
    AS
    SELECT
    BCODE ID, BTYPE BTYPE_ID,
    BDATE THE_DATE,SYMBOL_CODE STOCK_CODE,
    BHEAD DESC_E, BHEADARB DESC_A,
    BMSG TEXT_E, BMSGARB TEXT_A,
    BURL URL, BTIME THE_TIME
    FROM BULLETIN@egid_sefit;
    I need to know is there a diffrence between using (with row id) and (with primary key) on the performance of the query?

    Hi again,
    fast refreshing complex views based on rowids, according to the previous subject.
    (You're example shows that) are not possible.
    Complex remote (replication) snapshots cannot be based on Rowid too.
    for 10.1
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm#sthref5054
    for 10.2
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#sthref6873
    So I guess (didn't check it) that this applies ONLY to replication snapshots.
    This is not documented clearly though (documentation bug ?!)
    Documentation states that the following is generally not possible with Rowid MVIEWS:
    Distinct or aggregate functions
    GROUP BY or CONNECT BY clauses
    Subqueries
    Joins
    Set operations
    Rowid materialized views are not eligible for fast refresh after a master table reorganization until a complete refresh has been performed.
    The main purpose of my statements was to try to give a few tips how to avoid common problems with this complex subject, like for example: being able to CREATE an MVIEW with fast refresh clause does not really guarantee that it will refresh fast in the long run (reorganisation, partition changes) if ROWID based, further the rowid mviews have limitations according to the documentation (no group by, no connect by, link see above) plus fast refresh means only to use filter columnns of the mview logs, plus for aggregates you need additional count (*) pseudo columns.
    kind regards
    Karsten

  • Primary key index not working in a select  statment

    Hi ,
    I'm doing a :
    select *
    from my_table
    where B = v1 and
    A = v2 ;
    where A and B are the primary key of the table, in that table the primary key index is there and the order of the primary key definition is A first and then B.
    While testing this statment in my database the Explain Plan shows that it is using the index ok but when
    runninng in client database it is not using it becasue of the order (i think), is this something configurable that I need to ask to my DBA ?
    The solution I found was to do the select with a hint wich fix the problem , but I'm curious about why is working in my dadabase and not in the client database
    thanks in advance .
    oracle version 11g

    This is the forum for SQL Developer (Not for general SQL/PLSQL questions). Your question would be better asked in the SQL and PL/SQL forum.
    Short answer: The execution plan used will depend on optimizer settings and table/index statistics. For example if the table has very few rows it may not bother using the index.

  • How can I be able to create a primary key in a Form on a Table with Report?

    When I click the "Create" button, a form appears allowing me type in data for those columns. But primary key is not there. I really need to specify my primary key here also. Because the primary key for this table is a Serial Number, not just a sequence number.
    I noticed that when I created this page earlier, the primary key was ruled out by default. I wish there is a way to accomplish this. Thanks!

    Hello,
    >> a pk field is not null implicit …
    I’m not sure I understand your statement. Every item, including the one holds the primary key, is null for a new form. The question is, when you are filling the form, how to populate this field. The APEX wizard assumes this field will be populated by the system, hence it hides it from the user, however it’s a valid situation where the primary field is filled by the user.
    As primary field should not be changed, hence the productive advice by Martin. If the form displays an existing record, the primary field item should be set to Read Only.
    Regards,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • Problem with JPA Implementations and SQL BIGINT in primary keys

    I have a general Question about the mapping of the SQL datatype BIGINT. I discovered, that there are some different behaviour depending on the JPA implementation. I tested with TopLink Essentials (working) and with Hibernate (not working).
    Here is the case:
    Table definition:
    /*==============================================================*/
    /* Table: CmdQueueIn */
    /*==============================================================*/
    create table MTRACKER.CmdQueueIn
    CmdQueueInId bigint not null global autoincrement,
    Type int,
    Cmd varchar(2048),
    CmdState int,
    MLUser bigint not null,
    ExecutionTime timestamp,
    FinishTime timestamp,
    ExecutionServer varchar(64),
    ScheduleString varchar(64),
    RetryCount int,
    ResultMessage varchar(256),
    RecordState int not null default 1,
    CDate timestamp not null default current timestamp,
    MDate timestamp not null default current timestamp,
    constraint PK_CMDQUEUEIN primary key (CmdQueueInId)
    The java class for this table has the following annotation for the primary key field:
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "CmdQueueInId", nullable = false)
    private BigInteger cmdQueueInId;
    When using hibernate 3.2.1 as JPA provider I get the following exception:
    avax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)
    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:585)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:176)
    at $Proxy16.persist(Unknown Source)
    at com.trixpert.dao.CmdQueueInDAO.save(CmdQueueInDAO.java:46)
    at com.trixpert.test.dao.CmdQueueInDAOTest.testCreateNewCmd(CmdQueueInDAOTest.java:50)
    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:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at
    Caused by: org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short or string
    at org.hibernate.id.IdentifierGeneratorFactory.get(IdentifierGeneratorFactory.java:59)
    at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:35)
    at org.hibernate.id.IdentityGenerator$BasicDelegate.getResult(IdentityGenerator.java:157)
    at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
    at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
    at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
    at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
    at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
    at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
    at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
    at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
    at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:212)
    ... 34 more
    This means, that their ID generator does not support java.math.BigInteger as datatype.
    But the code works if I take TopLink essentials as JPA Provider.
    Looking at the spec shows the following:
    In chapter 2.1.4 "If generated primary keys are used, only integral types will be portable." Integral datatypes are byte, short, int, long and char. This would mean, that the Hibernate implementation fits the spec but there seem to be a problem in general with BIGINT datatypes.
    I use a SYBASE database. There it is possible to declare a UNSIGNED BIGINT. The range of numbers is therefore 0 - 2^64 - 1. Since in Java a long is always signed it would mean its range is from -2^63 -1 to 2^63 -1. So a mapping of BIGINT to java.lang.long could result in an overflow.
    The interesting thing is, that I used NetBeans to reverse engineer an existing database schema. It generated for all Primary Keys of Type BIGINT automatically a java.math.BigInteger. But for other fields (not being keys) it mapped BIGINTs to java.lang.long.
    It looks like there are some problems with either the spec itself or the implementation of it. While TopLink seems to handle the problem correctly, Hibernate doesn't. But Hibernate seems to fulfill the spec.
    Is anybody familiar with the Spec reading this and can elaborate a little about this situation?
    Many thanks for your input and feedback.
    Tom

    Not sure if I clearly understand your issue, would be good if you can explain it a bit more clearly.
    "I select a value from LOV and this value don't refresh in the view"
    If you mean ViewObject, check if autoSubmit property is set to true.
    Amit

  • 1-1 mapping Primary Key association problem

    Hi, I have two tables Indiv (Id, col1, col2 ) and IndivExt(Id, col3)....where "Id" is the PKey in both the tables.
    In TopLink, I have mapped
    Indiv table --> IndivClass
    IndivExt table --> IndivExtClass
    class IndivClass{
    Integer Id;
    Integer col1;
    Integer col2;
    class IndivExtClass{
    IndivClass oIndiv; // relation - one-to-one
    Integer col3;
    While running the app, there is an Integrity TopLink exception that says that IndivClass descriptor doesnt have IndivExt table in it.
    So, I used advanced feature of multi-table info and created the Primary Key association between these two descriptors.
    If I am right, This association assumes that there is a row in IndivExt for every row in Indiv...correct me if im wrong. I assume this coz of the kinda sql query it creates when im trying to read a IndivClass object. The sql query uses a join on both the tables.
    But...For every row in Indiv table there MIGHT or MIGHT NOT be a row in IndivExt table.
    So the sql that is formed will not return the required Indiv rows (in case there are no corresponding IndivExt rows).
    How do I resolve this.
    Thanks,
    Krishna

    Hi James,
    Thanx for that update.
    So just for clarification...
    Im going to remove the multi-table info.
    And use normal foreign key reference,
    and apply the patch...then the Integrity error
    should not occur.
    Right ?
    One more question... If I also want to refer IndivExt from the Indiv object...then I would change my classes
    to be like...
    class IndivClass{
    Integer Id;
    Integer col1;
    Integer col2;
    IndivExt oIndivExt; //relation - one-to-one (rel2)
    class IndivExtClass{
    IndivClass oIndiv; // relation - one-to-one (rel1)
    Integer col3;
    and the mapping (for rel2) in IndivClass descriptor will use the same reference that was used by rel1...ie., a normal foreign key ref. Is that right ?
    And also...Is there a bug number related to this issue and how do I get the patch ? Where can I download it from?
    Thanks,
    Krishna

Maybe you are looking for