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.

Similar Messages

  • 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

  • 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?

  • 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]

  • 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

  • '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 can i export the data to excel which has 2 tables with same number of columns & column names?

    Hi everyone, again landed up with a problem.
    After trying a lot to do it myself, finally decided to post here..
    I have created a form in form builder 6i, in which on clicking a button the data gets exported to excel sheet.
    It is working fine with a single table. The problem now is that i am unable to do the same with 2 tables.
    Because both the tables have same number of columns & column names.
    Below are 2 tables with column names:
    Table-1 (MONTHLY_PART_1)
    Table-2 (MONTHLY_PART_2)
    SL_NO
    SL_NO
    COMP
    COMP
    DUE_DATE
    DUE_DATE
    U-1
    U-1
    U-2
    U-2
    U-4
    U-4
    U-20
    U-20
    U-25
    U-25
    Since both the tables have same column names, I'm getting the following error :
    Error 402 at line 103, column 4
      alias required in SELECT list of cursor to avoid duplicate column names.
    So How can i export the data to excel which has 2 tables with same number of columns & column names?
    Should i paste the code? Should i post this query in 'SQL and PL/SQL' Forum?
    Help me with this please.
    Thank You.

    You'll have to *alias* your columns, not prefix it with the table names:
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id, b.id, a.val1, b.val1, a.val2, b.val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
      for rData in cData loop
    ERROR at line 18:
    ORA-06550: line 18, column 3:
    PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
    ORA-06550: line 18, column 3:
    PL/SQL: Statement ignored
    $[CHE_TEST@asterix1_impl] r
      1  declare
      2    cursor cData is
      3      with data as (
      4        select 1 id, 'test1' val1, 'a' val2 from dual
      5        union all
      6        select 1 id, '1test' val1, 'b' val2 from dual
      7        union all
      8        select 2 id, 'test2' val1, 'a' val2 from dual
      9        union all
    10        select 2 id, '2test' val1, 'b' val2 from dual
    11      )
    12      select a.id a_id, b.id b_id, a.val1 a_val1, b.val1 b_val1, a.val2 a_val2, b.val2 b_val2
    13      from data a, data b
    14      where a.id = b.id
    15      and a.val2 = 'a'
    16      and b.val2 = 'b';
    17  begin
    18    for rData in cData loop
    19      null;
    20    end loop;
    21* end;
    PL/SQL procedure successfully completed.
    cheers

  • 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

Maybe you are looking for