Duplicate Column Name: VIEW

Hi. Im writing a VIEW:
CREATE OR REPLACE VIEW viewexample AS
SELECT c.customer_id, c.details, o.order_id,
o.details, op.product_id, op.description
FROM customer c, order o, order_product op
(...more... )
Yet, i get this message:
duplicate column name
And its pointing to line 3. Any ideas?

A problem has arisen.
I have developed this View further but it seems im getting a Cartesian product.
I am not tip-top on joins, but i included some inner joins that i thought would not return a Cartesian.
Here is the code:
CREATE OR REPLACE VIEW myview AS
     SELECT      co.order_id,
          o.description o_d,
          co.customer_id,
          cp.product_description,
          c.name c_n
     FROM     customer_order co, order o, customer c,
          customer_product cp
     WHERE     cp.product_description BETWEEN
          '000' AND '010'
     AND      co.order_id = o.order_id
     AND     co.customer_id = c.customer_id;
with the select statment:
select * from myview;
I am expecting 10 selections, yet i recieve about 1000.
Any ideas?

Similar Messages

  • ORA-00957: duplicate column name

    When I am enableversioning of a table, I get following error messages:
    SQL> execute dbms_wm.enableversioning('transcript');
    BEGIN dbms_wm.enableversioning('transcript'); END;
    ERROR at line 1:
    ORA-00957: duplicate column name
    ORA-06512: at "SYS.LTDDL", line 399
    ORA-06512: at "SYS.LTDDL", line 1117
    ORA-06512: at "SYS.LT", line 7181
    ORA-06512: at line 1
    I checked the column name that will be add by dbms_wm package and did not see any column which would cause this problem.
    Could some one give me the list of reserved column names for dbms_wm package?
    Thanks
    Ashley

    Ashley
    These are some the reserved words used by OWM in its internal views. These can also conflict on enable versioning
    statements.
    RIDCHILD RIDBASE RIDPARENT CHILDSTATE PARENTSTATE BASEDS CHILDDS PARENTDS
    FIRSTCHILDVER CHILDVER PARENTVER POS RID VERSION NEXTVER DELSTATUS
    LTLOCK
    In the release after 9iR2, we have augmented reserved words with a prefix that will commonly not conflict with
    user schema column names.
    Let me know if you were able to identify the reserve word conflict.
    Arun
    [email protected]

  • Duplicate column name when inserting a batch to biztalk

    I wonder why I get the following error:
    The adapter failed to transmit message going to send port "SEND_PORT_TESTORCHESTRATION_00010" with URL "oracledb://OracleServer/?PollingId=TEST_ORCHESTRATION_ORACLE_00010". It will be retransmitted after the retry interval specified for
    this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.TargetSystemException: ORA-06550: line 2, column 290:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 2, column 1:
    PL/SQL: SQL Statement ignored ---> Oracle.DataAccess.Client.OracleException: ORA-06550: line 2, column 290:
    PL/SQL: ORA-00957: duplicate column name
    ORA-06550: line 2, column 1:
    PL/SQL: SQL Statement ignored
       at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
       at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, Boolean bCheck)
       at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
       at Microsoft.Adapters.OracleCommon.OracleCommonUtils.ExecuteNonQuery(OracleCommand command, OracleCommonExecutionHelper executionHelper)
       --- End of inner exception stack trace ---
    When I tried to pull a batch from sql server to insert to an oracle table. I have checked and none of the records were duplicate or had the same key. If I sent a batch of only 1 record, it went through fine and oracle database was updated.
    However, in either cases, no response from Oracle were received. I had a FILE port to save oracle response to file because the oracle port in the orchestration was 2 way (Send/Receive) port.
    Why was BizTalk not writing the response to file?
    Your hint/instruction to shed some light to this mystery is highly appreciated. Thanks!
    Note: When I tried to look the orchestration debugger, I saw the same message from sql being transmitted twice...why is BizTalk doing that?

    Hi BoatSeller,
    I think it may be something related to the map, I just do not know what. This is what I saw from the message part:
    <ns0:Insert xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/ORACLETABLE/Table/ROTATION_REQ">
    <ns0:RECORDSET>
    <ns0:ROTATION_REQRECORDINSERT>
    <ns0:RotationID>D4-2015-CO1</ns0:RotationID>
    <ns0:RotationID>D4-015-GL1</ns0:RotationID>
    <ns0:Year>2015</ns0:Year>
    <ns0:Year>2015</ns0:Year>
    <ns0:Class>D4</ns0:Class>
    <ns0:Class>D4</ns0:Class>
    <ns0:Rotation>CROSSOVER</ns0:Rotation>
    <ns0:Rotation>GOOCHLAND CLINIC</ns0:Rotation>
    <ns0:From>2014-08-06</ns0:From>
    <ns0:From>2014-05-20</ns0:From>
    <ns0:To>2015-03-05</ns0:To>
    <ns0:To>2015-03-05</ns0:To>
    <ns0:NumberOfConsecutiveSession>1</ns0:NumberOfConsecutiveSession>
    <ns0:NumberOfConsecutiveSession>1</ns0:NumberOfConsecutiveSession>
    <ns0:AmOrPM InlineValue="1"></ns0:AmOrPM>
    <ns0:AmOrPM InlineValue="2"></ns0:AmOrPM>
    <ns0:DayOfWeek>5</ns0:DayOfWeek>
    <ns0:DayOfWeek>4</ns0:DayOfWeek>
    </ns0:ROTATION_REQRECORDINSERT>
    </ns0:RECORDSET>
    </ns0:Insert>
    I thought that would be an issue because it looks like it was repeating the content, but if I understand you correctly, this is what the message content supposed to be? If not, what should I change in the map so that Oracle will get the following?
    <Record1> <field1>..</field1><field2>..</field2></Record1>
    <Record2> <field1>..</field1><field2>..</field2></Record2>
    This is the print screen of my orchestration debugger:
    If this is a problem, how should I fix this?
    And this is my mapping:
    Thanks,

  • Data subsetting [ORA-00957: duplicate column name]

    I want to select only rows with a certain id from a table.
    The code for the publication :
    SELECT * FROM ZOO.ANIMAL A, ZOO.TYPE_ANIMAL TA, ZOO.ANIMAL_EMPLOYE AE WHERE A.IDTYPEANIMAL = TA.IDTYPEANIMAL AND TA.IDTYPEANIMAL = AE.IDTYPEANIMAL AND AE.IDEMPLOYE = :employe
    When i publish with .jar, i have this error :
    ORA-00957: duplicate column name
    What is the problem ? The query works in iSQL*Plus !
    Thanks
    Message was edited by:
    user460585

    Hi,
    I guess that you are tired or something …
    01 update requisicoes set
    02 requisicao_num = '4321',
    03 requisicao_desc = 'dfgb',
    04 empresa_id = 3,
    05 posicao_id = 2, -- equals to 14
    06 solicitante = 'dfvsdfv',
    07 centrodecusto_solicitante = '5131',
    08 centrodecusto_executante = '5151',
    09 centrodecusto_aplicacao = '5141',
    10 data_saida = to_date('12/12/2004', 'dd/mm/yyyy'),
    11 data_desejada = to_date('12/12/2004', 'dd/mm/yyyy'),
    12 prioridade_id = 1,
    13 observacao = 'sgfbfdgbdfgb',
    14 posicao_id = 2
    15 where requisicao_id = 3
    Don’t you have:
    posicao_id = 2 in 5th line and in the 14th line ??
    Bye,
    Vitor

  • JPA -- Inheritance with duplicate column names

    Hi,
    I have the following problem:
    I have two tables. Let's call them BASE_TABLE and CHILD_TABLE. They are mapped through Join Inheritance in Java. In other words:
    @Inheritance(strategy=InheritanceType.JOINED)Let's say, the tables look like:
    BASE_TABLE (
        ID NUMBER(18),
        TYPE VARCHAR2(1),
        CODE NUMBER(5))
    CHILD_TABLE (
        ID NUMBER(18),
        CODE NUMBER(5),
        NAME VARCHAR2(50))Here's where the problem lies: I have duplicate column names. In my example, this is the CODE column. When mapping to Java classes, I can have something like:
    @Entity
    @Table(name="BASE_TABLE")
    @Inheritance(strategy=InheritanceType.JOINED)
    @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
    @DiscriminatorValue("0")
    class BaseEntity {
        @Column(name="CODE")
        private Integer code;
        public Integer getCode_Base() {
            return code;
        public setCode_Base(Integer code) {
            this.code = code;
    @Entity
    @Table(name="CHILD_TABLE")
    @DiscriminatorValue("1")
    @PrimaryKeyJoinColumn(name="ID")
    class ChildEntity extends BaseEntity {
        @Column(name="CODE")
        private Integer code;
        public Integer getCode() {
            return code;
        public setCode(Integer code) {
            this.code = code;
    }The trouble is, that TopLink only handles ONE of the CODE columns. When SELECTing, it only selects the CODE column from table BASE_TABLE. When generating DML statements, again it only uses the CODE column from table BASE_TABLE.
    I wasn't able to make it use BOTH columns.
    Please, help. The DB design cannot be changed at the moment. However, I must find a way to make TopLink Essentials use both CODE columns, not just the one from BASE_TABLE.
    Thank you in advance!
    Best regards,
    Bisser

    Hi Chris,
    I was under the impression, that since the attributes were private, they would be treated as two different attributes by TopLink Essentials.
    Java definitely treats them as two different attributes, and not as one overriding the other. I had made sure that I could set both of them with different values (via the differently named accessors) and, indeed, both values were there. I printed them both out on the console, just to make sure. They were printed out ok, the values were indeed different.
    But TopLink Essentials was ignoring one of them.
    Now that you told me that I should use different names for the attributes, I did just that. And lo and behold, it worked!!! I couldn't even imagine that it would matter to TopLink what the names were, given that they were in two different entities that were mapped to two different tables, inheritance or not.
    As I said, Java treats them as two completely different attributes, unlike TopLink Essentials. In future, I will know that even the attribute names matter. Thank you again.
    Best regards,
    Bisser

  • Generating Duplicate Columns Names in CMP's

    Hi,
    We are having trouble with the automatic key generation of the CMP beans. We are using java.lang.Object as primary key class and the autogenerated col is ejb_pk but still it doesnt work.
    The Generated Class files show the insert and update statements with duplicate column names.
    The exception trace is
    <i>
    Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed.
    The persistent object is com.ejb.PriorityCMP220Persistent.
    at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:106)
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:380)
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:343)
    at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletionTransactionContext.java:446)
    at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:230) ... 50
    more Caused by: java.sql.SQLException: [SAP_Portals][SQLServer JDBC Driver][SQLServer]Column name 'PRIORITY_ID' appears more than once in the result column list. </i>
    We are using p9 sqlserver driver . Is it something related to driver problem or some configuration issue.
    Please Suggest,
    Thanks,
    Mukul.
    Edited by: Mukul Mangla on Mar 25, 2009 2:03 PM

    As stated by Ken, the Organizer does not consider duplicate file names as duplicate files : the full path with folder hierarchy is taken into account. I have the same situation than you with my camera limited to 10 000 ... I am working with this fact since 1999, and I have no organization problem with that. Absolutely no necessity to rename in my case, but you may have other requirements ?
    If so, it's good to know that you can use the downloader to rename at the import stage (hence the questions of Ken about the way you import).
    You mentionned batch renaming : that can only be made from within the organizer, and I would seriously recommend thinking twice before deciding to do so, a full backup before that being a must.

  • Alias required in SELECT list of cursors to avoid duplicate column names

    I got some error messages while compiling the following.
    DECLARE
         alert_id                              NUMBER;
         CURSOR cur_search IS SELECT c.item_description,
         d.name modelname,
         SUM(b.quentaty),
         SUM(b.balence)
         FROM      item_procurement_history_dtl a,
                        item_procurement_history b,
                        item_master c,
                        model_master d
         WHERE a.item_code = b.item_code
         AND a.lot_no = b.lot_no
         AND a.item_code = c.item_code
         AND b.modelcode = d.modelcode
         AND (c.item_description LIKE '%'||:blk_stock_search_fields.item_name||'%' OR :blk_stock_search_fields.item_name IS NULL)
         AND (d.name LIKE '%'||:blk_stock_search_fields.modelname||'%' OR :blk_stock_search_fields.modelname IS NULL)
         AND (a.status = :blk_stock_search_fields.status OR :blk_stock_search_fields.status IS NULL)
         GROUP BY c.item_description, d.name
         ORDER BY c.item_description, d.name;
    BEGIN
         GO_BLOCK('blk_stock_search_fields');
         CLEAR_BLOCK(NO_VALIDATE);
         FOR i IN cur_search LOOP
         :blk_stock_search_data.item_name                := i.item_description;
              :blk_stock_search_data.modelname               := i.modelname;
              :blk_stock_search_data.tot_qty                    := i.tot_qty;
              :blk_stock_search_data.available_qty     := i.available_qty;
              NEXT_RECORD;
         END LOOP;
         FIRST_RECORD;
         GO_ITEM('blk_stock_search_fields.pb_search');
    END;
    The error is as follows :-
    Error 403 at line 23 column 2
    Alias required in SELECT list of cursors to avoid duplicate column names.
    What will be the solution for this error?
    Thanx and Regards,
    Vikas

    Vikas,
    The problem is that you are referencing a column name in your LOOP that does not exist in your CURSOR. Therefore, Oracle has interpreted this to its BEST guess Exception. This can be resolved as follows:
    DECLARE
       alert_id NUMBER;
       CURSOR cur_search IS
          SELECT c.item_description,
                 d.name modelname,
                 /* You need to ALIAS the product of the SUM() so you can reference it by name.*/
                 SUM(b.quentaty) AS tot_qty,
                 /* Same issue here, you must ALIAS the SUM() of Balance in order to reference it by a name.*/
                 SUM(b.balence) as available_qty
            FROM item_procurement_history_dtl a,
                 item_procurement_history b,
                 item_master c,
                 model_master d
           WHERE a.item_code = b.item_code
             AND a.lot_no = b.lot_no
             AND a.item_code = c.item_code
             AND b.modelcode = d.modelcode
             AND (c.item_description LIKE '%'||:blk_stock_search_fields.item_name||'%' OR :blk_stock_search_fields.item_name IS NULL)
             AND (d.name LIKE '%'||:blk_stock_search_fields.modelname||'%' OR :blk_stock_search_fields.modelname IS NULL)
             AND (a.status = :blk_stock_search_fields.status OR :blk_stock_search_fields.status IS NULL)
           GROUP BY c.item_description, d.name
           ORDER BY c.item_description, d.name;
    BEGIN
       GO_BLOCK('blk_stock_search_fields');
       CLEAR_BLOCK(NO_VALIDATE);
       FOR i IN cur_search LOOP
          :blk_stock_search_data.item_name := i.item_description;
          :blk_stock_search_data.modelname := i.modelname;
          :blk_stock_search_data.tot_qty := i.tot_qty;
          :blk_stock_search_data.available_qty := i.available_qty;
          NEXT_RECORD;
       END LOOP;
       FIRST_RECORD;
       GO_ITEM('blk_stock_search_fields.pb_search');
    END;Just an observation. Also, There are some misspellings in your cursor. Does this match your table?
    Hope this helps.
    Craig...

  • CREATE INDEX WITH DUPLICATE COLUMN NAME

    Hi,
    i need to interface our application with an Orale Bridge to CREATE INDEX with duplcate column Name.
    For Example
    CREATE index NLOT_FOURNLOT_idx ON NLOT(FOURNISSEUR ,NOLOT ,FOURNISSEUR ,NOBLFOUNISSEUR,NOLIGNEBL ,NOLOT ,QTECOLISRECUES ,CODENONQUALITE ,QTECOLISACCEPTE);
    CREATE table NLOT(
    FOURNISSEUR VARCHAR2(09)
    ,NOBLFOURNISSEUR VARCHAR2(13)
    ,NOLIGNEBL VARCHAR2(03)
    ,NOLOT VARCHAR2(20)
    ,QTECOLISRECUES VARCHAR2(10)
    ,CODENONQUALITE VARCHAR2(02)
    ,QTECOLISACCEPTE VARCHAR2(10)
    ,NOMBREDECOLISRE VARCHAR2(10)
    ,NOMBREDECOLISAC VARCHAR2(10)
    ,FILLER VARCHAR2(1)
    ,FILLE1 VARCHAR2(1)
    ,TYPEREFERENCE VARCHAR2(01)
    ,REFERENC1 VARCHAR2(15)
    ,CONTROLERECEPTI VARCHAR2(01)
    ,DATEDEPEREMPTIO VARCHAR2(8)
    ,CONTROLEPROCHAI VARCHAR2(1)
    Thanks
    Philippe

    Well, you can't do it. ORA-957 is one of those irrevocable errors for which the solution is to remove the duplicate name from the SQL statement.
    But, anyway, why do you want to do this? I would guess there's no performance benefit from having the same column indexed twice (of course it's impossible to test this, so it's just my opinion).
    Cheers, APC

  • ORA-00957: duplicate column name for multi-form page

    I have read numerous threads on this but I think I am missing something. I have two forms on one page, each based on a separate table. They each have one column in common which is why I believe I am getting this error. However, I do not understand why since each form has its own Automatic Row Processing, it is tripping over the column name. I have changed the name of the page item to be different, but I still get this error. TIA.

    Hi,
    Technically you can not use two forms in one page. Both table have the same column name which confuses the DML process. Try change the column name in one table and see if it works.
    Cheers,
    Tajuddin

  • SSIS column mappings when csv contain duplicate columns names

    What are the options/alternatives when you are mappings csv column headers and the csv file contains duplicate column headers(that's how I get it). Normally the SSIS will reject this since there are duplicate column headers. What other solutions might
    exist to map this?

    You can simply rename a duplicated column at the Flat File Connection Manager level which can import duplicated column and there will be no issue consuming it using Flat File Source:
    Arthur
    MyBlog
    Twitter

  • ORA-00957 Duplicate Column Name Materialized View  ( UPDATED: Not answered)

    Hello all.  I am getting this error when trying to create a Materialized View.  I have many other MV I created without problem, but I cannot find the catch up here, can anyone help?.  I cannot find any duplicates. The only duplicate I though was the Pipeline_Code column that was entered into the function and the one being being called out as a column. To check, I renamed the latter and still am getting this issue.
    Any help would be greatly appreciated.
    Thanks!
    The query is below:
    CREATE MATERIALIZED VIEW MV_TEST_STATION
    REFRESH COMPLETE
    START WITH TO_DATE('20-SEP-2013 00:00:00','dd-mon-yyyy hh24:mi:ss')
    NEXT (SYSDATE +12/24)
    AS
    SELECT T.TEST_STATION_ID,
           --(SELECT TEST_STATION_TYPE.DESCRIPTION
            --  FROM TEST_STATION_TYPE
           --  WHERE TEST_STATION.TEST_STATION_TYPE =
               --       TEST_STATION_TYPE.TEST_STATION_TYPE)
             --AS TEST_STATION_TYPE,
            TST.DESCRIPTION AS TEST_STATION_TYPE,
           T.SURVEY,
           T.STATUS,
           T.STATION,
           F_TRUESTATION2 (
              T.STATION,
              T.PIPELINE_CODE,
              F_REROUTE_CODE (T.STATION,
                                      T.PIPELINE_CODE))
              AS TRUE_STATION,
           T.REQUIRED,
          -- (SELECT PIPELINE_CODES.PIPELINE_CODE_DESCRIPTION
           --   FROM PIPELINE_CODES
            -- WHERE TEST_STATION.PIPELINE_CODE = PIPELINE_CODES.PIPELINE_CODE)
           --   AS PIPELINE_CODE,
           PC.PIPELINE_CODE_DESCRIPTION AS PC_PIPELINE_CODE,
           T.INSTALL_DATE,
           T.FUNCTIONAL COMMENTS,
           TSR.TEST_STATION_READING_ID,
           TSR.TEST_DATE,
           TSR.SURVEYOR,
           TSR.ON_VOLTS,
           TSR.ON_BG,
           TSR.ON_AG,
           TSR.METER_UTC,
           TSR.METER_ID,
           TSR.IO_BG,
           TSR.IO_AG,
           TSR.INSTANT_OFF_VOLTS,
           TSR.FUNCTIONAL_DAMAGE_OUT,
           TSR.FUNCTIONAL_DAMAGE_IN,
           TSR.COSEMETIC_DAMAGE_OUT,
           TSR.COSEMETIC_DAMAGE_IN,
           TSR.COMMENTS,
           TSR.CASING_ON,
           TSR.CASING_OFF,
           TSR.CASING,
           TSR.CALIBRATION_DUE_DATE,
           TSR.ANODE_AMPS_ON,
           TSR.ANODE_AMPS_OFF,
           TSR.ANODE
      FROM TEST_STATION T
    INNER JOIN TEST_STATION_TYPE TST ON T.TEST_STATION_TYPE = TST.TEST_STATION_TYPE
    INNER JOIN PIPELINE_CODES PC ON T.PIPELINE_CODE = PC.PIPELINE_CODE
      INNER JOIN TEST_STATION_READING TSR ON T.TEST_STATION_ID = TSR.TEST_STATION_ID
    WHERE T.TEST_STATION_ID = TSR.TEST_STATION_ID

    since we don't have your tables or data, we can not run, test, fix or  improve posted code
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002

  • Fldedit.aspx Duplicate Column Name bug?

    Hi,
    I encountered a strange behaviour after creating two custom Content Types having their unique set of Columns under a feature.
    Say you have two Content Types, Cars and Bicycles with the following columns:
    Cars Columns
    Car Make - Text 
    Car Model - Text
    Category - Choice (Sedan, Coupe, Truck)
    Bicycles Columns
    Bicycle Make - Text
    Bicycle Model - Text
    Category - Choice (Racing, Recreation, Two Riders)
    The Category field should be a Choice field and ensure the choices for the Bicycles category are different from those in the Cars category.
    Make sure the columns are in two sets of Groups (Cars Columns Group and Bicycles Columns Group)
    After deploying the feature, Open up the site's top level (site collection) settings.
    Site Actions -> Site Settings -> Site Columns
    Even though all fields have their unique GUIDs and all Content Types, if you click on the Category column (belonging to Bicycle) or click on the Category column (belonging to Cars), you would notice Change Site Column
    page displays the same field.
    This means you would only be able to modify just one column of the same name even if you have two or more other columns having that name in different Groups and having different Field IDs.

    Hi,
    I encountered a strange behaviour after creating two custom Content Types having their unique set of Columns under a feature.
    Say you have two Content Types, Cars and Bicycles with the following columns:
    Cars Columns
    Car Make - Text 
    Car Model - Text
    Category - Choice (Sedan, Coupe, Truck)
    Bicycles Columns
    Bicycle Make - Text
    Bicycle Model - Text
    Category - Choice (Racing, Recreation, Two Riders)
    The Category field should be a Choice field and ensure the choices for the Bicycles category are different from those in the Cars category.
    Make sure the columns are in two sets of Groups (Cars Columns Group and Bicycles Columns Group)
    After deploying the feature, Open up the site's top level (site collection) settings.
    Site Actions -> Site Settings -> Site Columns
    Even though all fields have their unique GUIDs and all Content Types, if you click on the Category column (belonging to Bicycle) or click on the Category column (belonging to Cars), you would notice Change Site Column
    page displays the same field.
    This means you would only be able to modify just one column of the same name even if you have two or more other columns having that name in different Groups and having different Field IDs.

  • 'duplicate column name'-Exception when using identical objects

    Hi all,
    we're currently experiencing problems when using one single object instance for two different members of a mapped class. Here is an excerpt from our ToplinkMapping.java which shows the relevant parts:
    public ClassDescriptor buildQuotationDefDescriptor() {
    RelationalDescriptor descriptor = new RelationalDescriptor();
    descriptor.descriptorIsAggregate();
    descriptor.setJavaClass(de.hvb.ha.data.QuotationDef.class);
    // Descriptor Properties.
    descriptor.setAlias("QuotationDef");
    AggregateObjectMapping commonQtyMapping = new AggregateObjectMapping();
    commonQtyMapping.setAttributeName("commonQty");
    commonQtyMapping.setReferenceClass(de.hvb.ha.data.type.VolumeDT.class);
    commonQtyMapping.setIsNullAllowed(false);
    commonQtyMapping.addFieldNameTranslation("commonQty_value->DIRECT", "value->DIRECT");
    descriptor.addMapping(commonQtyMapping);     
    AggregateObjectMapping wideningQtyMapping = new AggregateObjectMapping();
    wideningQtyMapping.setAttributeName("wideningQty");
    wideningQtyMapping.setReferenceClass(de.hvb.ha.data.type.VolumeDT.class);
    wideningQtyMapping.setIsNullAllowed(false);
    wideningQtyMapping.addFieldNameTranslation("wideningQty_value->DIRECT", "value->DIRECT");
    descriptor.addMapping(wideningQtyMapping);
    well, if we now assign one object-instance of VolumeDT to both members, i.e. like:
    VolumeDT vol = new VolumeDT();
    quotationDef.commonQty = vol;
    quotationDef.wideningQty = vol;
    we end up in the mentioned SQL-Exception, because toplink produces the following SQL-Statement:
    UPDATE T_QUOTATIONTARGET SET WIDENING_QUANTITY = 0.0, WIDENING_QUANTITY = 0.0 WHERE …
    but we've expected something like:
    UPDATE T_QUOTATIONTARGET SET COMMON_QUANTITY = 0.0, WIDENING_QUANTITY = 0.0 WHERE …
    Any idea we can prevent this behavior and still use one object-reference for both members??
    Appreciate any help!

    Thanks for the reply but unfortunately the mentioned change didn't fixed the problem. The sql-statement produced by toplink still looks like the one mentioned above. Moreover, the mentioned change couldn't be managed by the Workbench (which we use in the project to create the mappings), could it?
    We currently use TopLink Version 10.1.3.3.
    Since you've asked I post the relevant parts of the Parent-Mapping (and again its Parent), so sorry for the verbose post:
    public ClassDescriptor buildQuotationORMWrapperDescriptor() {
    RelationalDescriptor descriptor = new RelationalDescriptor();
    descriptor.setJavaClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationORMWrapper.class);
    descriptor.addTableName("T_QUOTATION");
    descriptor.addPrimaryKeyFieldName("T_QUOTATION.SEQ_KEY");
    // Descriptor Properties.
    descriptor.useSoftCacheWeakIdentityMap();
    descriptor.setIdentityMapSize(300);
    descriptor.useRemoteSoftCacheWeakIdentityMap();
    descriptor.setRemoteIdentityMapSize(300);
    descriptor.setSequenceNumberFieldName("T_QUOTATION.SEQ_KEY");
    descriptor.setSequenceNumberName("Quotation");
    descriptor.setAlias("QuotationORMWrapper");     
    // Query Manager.
    descriptor.getQueryManager().checkCacheForDoesExist();
    OneToManyMapping quotationDefsMapping = new OneToManyMapping();
    quotationDefsMapping.setAttributeName("quotationDefs");
    quotationDefsMapping.setReferenceClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationDefORMWrapper.class);
    quotationDefsMapping.dontUseIndirection();
    quotationDefsMapping.privateOwnedRelationship();
    quotationDefsMapping.useCollectionClass(java.util.ArrayList.class);
    quotationDefsMapping.addAscendingOrdering("orderBy");
    quotationDefsMapping.addTargetForeignKeyFieldName("T_QUOTATIONTARGET.SEQ_KEY", "T_QUOTATION.SEQ_KEY");
    descriptor.addMapping(quotationDefsMapping);
    and now the parent of QuotationORMWrapper:
    public ClassDescriptor buildPersistentInstrumentDescriptor() {
    RelationalDescriptor descriptor = new RelationalDescriptor();
    descriptor.setJavaClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.PersistentInstrument.class);
    descriptor.addTableName("T_INSTRUMENT");
    descriptor.addPrimaryKeyFieldName("T_INSTRUMENT.INSTR_ID");
    descriptor.addPrimaryKeyFieldName("T_INSTRUMENT.INSTR_KEYTYPE");     
    // Descriptor Properties.
    descriptor.useSoftCacheWeakIdentityMap();
    descriptor.setIdentityMapSize(300);
    descriptor.useRemoteSoftCacheWeakIdentityMap();
    descriptor.setRemoteIdentityMapSize(300);
    descriptor.setAlias("PersistentInstrument");
    OneToOneMapping quotationMapping = new OneToOneMapping();
    quotationMapping.setAttributeName("quotation");
    quotationMapping.setReferenceClass(de.hvb.ha.server.businessobjects.techapi.instrument.toplink.quotation.QuotationORMWrapper.class);
    quotationMapping.useBasicIndirection();
    quotationMapping.privateOwnedRelationship();
    quotationMapping.addTargetForeignKeyFieldName("T_QUOTATION.INSTR_ID", "T_INSTRUMENT.INSTR_ID");
    quotationMapping.addTargetForeignKeyFieldName("T_QUOTATION.INSTR_KEYTYPE", "T_INSTRUMENT.INSTR_KEYTYPE");
    descriptor.addMapping(quotationMapping)
    I hope I don't missed any relevant parts. By the way, where could I log a bug for this issue and can it be considered a bug?
    Thanks in advance!
    Message was edited by:
    user630939

  • How To Create Table View With Same Column name But Different Table?

    Hi All,
    I have the problem to create a tableview with same column name but in different table.
    The Table that i have:-
    Table - PAC051MPROFORMA
    Column - mrn,visitid
    Table - PAC051TPROFORMA
    Column - mrn,visitid
    Table - PAC052MTRANSBILL
    Column - mrn,visitid
    Then i want to create a table view to view that table. This is my SQL
    CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
    As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
    where
    *(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
    and
    *(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
    That SQL Return this error = ORA-00957: duplicate column name
    Then I modify that SQL to
    CREATE VIEW pacviewproforma (mrn,visitid)
    As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
    where
    *(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
    and
    *(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
    This time this error return = ORA-01730: invalid number of column names specified
    What should i do?
    Thanks...

    Hi,
    SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
    10  where
    11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
    12  and
    13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
    ERROR at line 1:
    ORA-00957: duplicate column namePlease give different names to each column.
    Something like this..
    SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
    _visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
    10  where
    11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
    12  and
    13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    View created.
    SQL> DESC  pacviewproforma;
    Name                                      Null?    Type
    MPROFORMA_MRN                                      NUMBER
    MPROFORMA_VISITID                                  NUMBER
    TPROFORMA_MRN                                      NUMBER
    TPROFORMA_VISITID                                  NUMBER
    MTRANSBILL_MRN                                     NUMBER
    MTRANSBILL_VISITID                                 NUMBER
    ORA-01730: invalid number of column names specifiedThe list of column nmae you specified during the CREATE VIEW should match with the SELECT list of the view.
    Twinkle

  • Duplicate columns created in attribute view

    Hi
    I created an attribute view as shown in the video Creating an attribute view | SAP HANA using the data given. After creating the attribute view as per the video, when I preview the data in the attribute view, I see that all the columns are created twice. For instance there is Company Name and Company Name 1, Contact_Name and Contact_Name1, ContactTitle and ContactTitle1 and so on. This has happened for all the fields.
    I checked the table in the schema to see if there are duplicate fields there. But the DIMSupplier table in the STS schema has no duplicate fields.
    What I want to know is how were these duplicate fields created in this attribute view and how do I remove them? I checked the output fields and there also there are no duplicate fields.
    When I right click on the attribute view and select data preview, and then under the tab "Distinct Values" I can see all these duplicate field names. I am trying to delete these duplicate field names but I am getting an error message that the field you are trying to delete is being used elsewhere hence it cannot be delete.
    Can anyone please advise how to fix this error.
    Thank you.
    Regards,
    Pavan.

    Hi Anjali,
    Thanks a lot for your reply. But in my data foundation STS_ATTRIBUTE_VIEW, I do not see any duplicate columns to remove them. Today I see a warning and also I am unable to right click on the attribute view.
    The warning is given below:
    Message :
      STS.STS_ATTRIBUTE_VIEW: one or more columns of Table: DIMSUPPLIER have invalid ABAP name
    But in the Data Foundation in the Output tab under Columns I do not have any duplicate columns listed.
    Also the attribute view is in grey color. Its not in green color even after clicking on Save and Validate and SAve and Activate.
    I select the attribute view and hit on the data preview button. There in the Analysis tab under Available objects under String folder I can see all these duplicate column names. I right click on the duplicate column names and I see the options "Distinct Values", "Add to labels", values, filters and "Properties". Having selected the column name I hit on the delete button on my keyboard but nothing happened.
    Is this because of the warning that I am getting. What does this warning mean?
    Please advise.
    Thank you.
    Regards,
    Pavan.

Maybe you are looking for

  • OSX System Wide Font Size?

    I just bought my first 27 inch iMac.. Although I'm lovin it, I do have it sitting at arms length away from me and am finding the font size vert small.. With this high res display the font is a bit tiny and am just wondering if its possible to change

  • Sort order of photos on iPhone messed up when photos stored on a NAS

    Sorting iPhone photos stored on a netfear readyNAS Duo under windows I have a set of photos taken with another camera which I sync to my iPhone 3 GS.  Previously I stored the photos on my windows pc and after syncing they were sorted on my iPhone  al

  • Photoshop files show as unix executable files

    Hi, I've have a back-up drive with all my old files (the past 15 years). After I copied them over I noticed that most of them showed up as unix executable files. The most of the Quark files I was able to repair by adding .qxp. When I add the appropri

  • Problem with win.8.1

    pc getting hangs after update win. 8 to win.8.1

  • Issues after waking up from sleep, macbook pro

    Macbook Pro, retina display, mid 2014, 2.6 GHz i5 Yosemite 10.10.1 This problem started about 4 days ago. If I let my computer sleep for a over about an hour, one start up I have lots of issues. It is hard to explain what it is, so I'll explain what