Database Adapter Merge with char/varchar primary key

Hi guys,
It seems as though merge statements in BPEL database adapters do not work if the primary key of the table contains a char/varchar. This is in Jdeveloper 10.1.3.4.0
If I create the table below:
create table test_merge (
  id        number primary key,
  text      varchar2(255)
);Then the merge operation will update and insert as expected. However, if I create the same table but with id as a char/varchar, then the merge statement will never update.
It seems like it never finds a record with the same id (if it is a char/varchar), and always attempts to insert, which results in unique key constraint errors for the primary key column.
Has anyone else encountered this issue and found a way to get the merge statement to work correctly? I can obviously perform the select myself, and then conditionally update/insert, but I would prefer the merge to work as expected.
Thanks

After investigating further, it seems that even a database adapter select is not working correctly. Consider the following table:
create table test_merge (
  id        varchar2(255) primary key,
  text      varchar2(255)
);And I have inserted a record with id = "1" and text="abc"
If I create a BPEL process and add a database adapter (with only the select checkbox ticked) with the following SQL:
SELECT ID, TEXT FROM TEST_MERGE WHERE (ID = #id)If I invoke this adapter, passing in "1" as the id, then a record is returned, with the correct text (i.e. "abc") BUT the id returned is "-9900000000000000000000000000"
Can anyone explain why this is happening?

Similar Messages

  • 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

  • JDeveloper 10g Creating a new record with trigger sequence primary key

    Hi there, I'm sorry to post this incredibly simple question and I'm sure that someone must have answered this on this forum before but the searching of this site is incredible slow and painful and after 30 mins I can't find help.
    I am using a struts Data Action to create a new record in the database and then being forwarded to an edit page where I can enter the new details. Then when the details are entered I am clicking an update button and returning to a browse screen where I can either commit the change to the database or rollback. Sounds pretty simple but I am really struggling with trying to get the trigger of the number sequence to work properly.
    Ideally I would like to click the create new record button and then the primary key/triggered sequence number is already displayed on the empty form...
    ... but if this is too tricky or not possible then I would like the user to either not enter any value in the key field (which currently causes error - JBO-27014: Attribute PoNo in PO_SYS_MODULE.PoSystemView1 is required) OR the user enters a number and the trigger overwrites this number with the next in the sequence.
    I can enter a new record if I look in the manager console and see the next number in the sequence and then create the record using this number and then click commit twice, as the first time I get the error: JBO-25019: Entity row of key oracle.jbo.Key[154 ] not found in PoSystem. Or if I enter a value 5 times greater than the next in the sequence I have to click the commit button 5 extra times to get the sequence to match the input.
    I hope that this lengthy explanation fills you in on my problem, there must be a simple solution to this and I will be VERY grateful to anyone who can help me.
    Many thanks
    Ben Sayers (clearly a newbie)

    Hi,
    ADF Business Components handles this for you - unless yo prefer doing this manually. In the Entity Object, set the PK attribute's type to DBSequence. Then create a database sequence and use a database trigger to add the sequence value on insert
    Frank

  • Creating entity beans with auto numbered primary key

    I have two entity bean with a CMR between them. I am successfully creating the first one but when I try and create the child entity bean I get a NullPointerException.
    Now I think this is because the gernerated code tries to get the primary key of the created entity bean and this is not set as it is set using a auto number in the database (An oracle sequence and trigger).
    Is there anyway i can get round this problem?
    Thanks in advance,
    Adrian

    This is the auto generated code:
         public dmd.sync.ejbs.entity.AppliancePackInfoLocal create_Local(dmd.sync.dataobjects.dto.AppliancePackInfoDTO appliancePackInfoDTO, dmd.sync.ejbs.entity.AmppLocal amppLocal) throws javax.ejb.CreateException, java.rmi.RemoteException {
              BeanO beanO = null;
              dmd.sync.ejbs.entity.AppliancePackInfoLocal result = null;
              boolean createFailed = false;
              boolean preCreateFlag = false;
              try {
                   beanO = super.createBeanO();
                   dmd.sync.ejbs.entity.AppliancePackInfoBean bean = (dmd.sync.ejbs.entity.AppliancePackInfoBean) beanO.getEnterpriseBean();
                   preCreateFlag = super.preEjbCreate(beanO);
                   bean.ejbCreate(appliancePackInfoDTO, amppLocal);
                   Object ejsKey = keyFromBean(bean);
                   result = (dmd.sync.ejbs.entity.AppliancePackInfoLocal) super.postCreate_Local(beanO, ejsKey, true);
                   bean.ejbPostCreate(appliancePackInfoDTO, amppLocal);
                   super.afterPostCreate(beanO, ejsKey);
    It must be falling over on the last line as it calls the ejbPostCreate fine.

  • Best practices with sequences and primary keys

    We have a table of system logs that has a column called created_date. We also have a UI that displays these logs ordered by created_date. Sometimes, two rows have the exact same created_date down to the millisecond and are displayed in the UI in the wrong order. The suggestion was to order by primary key instead since the application uses an oracle sequence to insert records so the order of the primary key will be chronological. I felt this may be a bad idea as a best practice since the primary key should not be used to guarantee chronological order although in this particular application's case, since it is not a multi-threaded environment, it will work so we are proceeding with it.
    The value for the created_date is NOT set at the database level (as sysdate) but rather by the application when it creates the object which is persisted by Hibernate. In a multi-threaded environment, thread A could create the object and then get blocked by thread B which is able to create the object and persist it with key N after which control returns to thread A it persists it with key N+1. In this scenario thread A has an earlier timestamp but a larger key so will be ordered before thread B which is in error.
    I like to think of primary keys as solely something to be used for referential purposes at the database level rather than inferring application level meaning (like the larger the key the more recent the record etc.). What do you guys think? Am I being too rigorous in my views here? Or perhaps I am even mistaken in how I interpret this?

    >
    I think the chronological order of records should be using a timestamp (i.e. "order by created_date desc" etc.)
    >
    Not that old MYTH again! That has been busted so many times it's hard to believe anyone still wants to try to do that.
    Times are in chronological order: t1 is earlier (SYSDATE-wise) than t2 which is earlier than t3, etc.
    1. at time t1 session 1 does an insert of ONE record and provides SYSDATE in the INSERT statement (or using a trigger).
    2. at time t3 session 2 does an insert of ONE record and provides SYSDATE
    (which now has a value LATER than the value used by session 1) in the INSERT statement.
    3. at time t5 session 2 COMMITs.
    4. at time t7 session 1 COMMITs.
    Tell us: which row was added FIRST?
    If you extract data at time t4 you won't see ANY of those rows above since none were committed.
    If you extract data at time t6 you will only see session 2 rows that were committed at time t5.
    For example if you extract data at 2:01pm for the period 1pm thru 1:59pm and session 1 does an INSERT at 1:55pm but does not COMMIT until 2:05pm your extract will NOT include that data.
    Even worse - your next extract wll pull data for 2pm thru 2:59pm and that extract will NOT include that data either since the SYSDATE value in the rows are 1:55pm.
    The crux of the problem is that the SYSDATE value stored in the row is determined BEFORE the row is committed but the only values that can be queried are the ones that exist AFTER the row is committed.
    About the best you, the user (i.e. not ORACLE the superuser), can do is to
    1. create the table with ROWDEPENDENCIES
    2. force delayed-block cleanout prior to selecting data
    3. use ORA_ROWSCN to determine the order that rows were inserted or modified
    As luck would have it there is a thread discussing just that in the Database - General forum here:
    ORA_ROWSCN keeps increasing without any DML

  • Problem with foreign and primary keys migration from SQL Server to Oracle

    Hi folks, i'm using SQL Developer to migrate from a SQL Server database to Oracle and i'm stuck with a couple issues:
    The worst of them so far is the fact that i can't migrate any of the PKs and FKs. After successfully capturing the SQL Server DB model and converting it to Oracle, when the tool generates the scripts, all ALTER TABLE queries that add the PKs and FKs have their target columns duplicated.
    for example: when i'm trying to migrate a simple table that contains an Id (PK) and Name columns, the tool generates the following scripts:
    PROMPT Creating Table TestTable...
    CREATE TABLE TestTable (
    Id NUMBER(10,0) NOT NULL,
    Name VARCHAR2 NOT NULL
    PROMPT Creating Primary Key Constraint PK_TestTable on table TestTable ...
    ALTER TABLE TestTable
    ADD CONSTRAINT PK_TestTable PRIMARY KEY
    Id,
    Id
    ENABLE
    As for the FKs, the tool duplicates the columns as well:
    ALTER TABLE SomeTable
    ADD CONSTRAINT FK_SomeTable_SomeTable2 FOREIGN KEY
    SomeTable2Id,
    SomeTable2Id
    REFERENCES SomeTable2
    Id,
    Id
    ENABLE
    Does anyone have a clue on how to solve these issues? I'd be greatly thankful for any answers!

    Hi Fernando,
    I was unable to replicate this issue. My primary / foreign keys where defined using unique columns.
    PROMPT Creating Primary Key Constraint PK_Suppliers on table Suppliers ...
    ALTER TABLE Suppliers
    ADD CONSTRAINT PK_Suppliers PRIMARY KEY
    SupplierID
    ENABLE
    I tried a few things like
    capturing twice and renaming both models the same
    renaming the converted models
    but with no luck.
    I think this issue is occuring either at the capture or convert phase.
    1) Are you performing the capture online or offline?
    2) Can you provide a the entire DDL for one of these tables and its indexes to see if I can replicate?
    3) Did the capture or convert fail or have to be redone at any stage ?
    I all else fails I would attempt a capture and convert again using a brand new repository (create a new schema in Oracle and associate the migration repository with it).
    Regards,
    Dermot
    SQL Developer Team
    Edited by: Dermot ONeill on Oct 22, 2009 12:18 PM

  • Master-detail with auto-generated primary key(master)

    Hello,
    I have the following master-detail setup:
    Master - block A primary key is: codeA
    Detail - block B
    codeA is genrated only at commit time and is obtained from a sequence.
    User needs to add detail records. This is easy to do since he has to click on the insert icon on the toolbar. At commit time, use commit_form.
    Prob: the requirements as asked by the client is to add a button (which we will label INSERT DETAIL). When the user click on the button, it opens a window where he can enter the detail info then click on save. This should bring him back to the master-detail form and the record in the detail block is inserted.
    What is the problem here ? since the detail block has the foreign key tied to the master primary key, the window-form (with the call_form) that we opened for the detail entry won't be able to save since at this point we still have not assigned a value for the primary key (and hence a value for the foreign key).
    Possible Suggestions:
    -Use a temp database table to hold the detail record from the second form and use it to transfer values to the detail record in the master-detail
    -Use a global record group
    -We can't use parameter list to pass back these values.
    So my question is:
    What would be the most efficient way to have an insert button on the detail block that would allow the user to have a pop up where he can insert his values and then be brought back to the master-detail.
    Thanks.

    Hello again,
    May be I was not clear enough.
    Scenario 1: We use the master-detail form as is with the default oolbar. In this case, the user can insert the detail records one by one without needing the primary-foreign key value since this is handled by default.
    Once we save the form (commit_form), I use the pre-insert trigger to get the master block primary key generated from the sequence and since the detail block key is copied from this value, both are saved correctly and it is the end of the story.
    Scenario 2: As explained in the initial post, the user will populate the detail records one by one by clicking on the -INSERT DETAIL- button and hence has a window where he can insert the detail info and then be brought back to the master-detail form every time he enters a new detail record.
    The problem here is that I can't generate the primary key for the master block since the client has the following requirement:
    The user can always change his mind and not complete, meaning save the form, his process
    As such, the key should be generated in the last step before Commit.

  • How to map a table with out a primary key with a pojo?

    hello
    Is it possible to map a pojo with a table, table don't have primary key. I m using hibernate,How to do that in hibernate.
    Thanks &Regards
    snimi

    Hello,
    EclipseLink has support for database object-relational datatypes, but they are not supported or exposed through JPA. Instead, you will need to leave it unmapped and then change the mapping, using a customizer to create the mapping described:
    http://wiki.eclipse.org/Introduction_to_Object-Relational_Data_Type_Mappings_(ELUG)#Object-Relational_Data_Type_Array_Mapping
    Best Regards,
    Chris

  • Master Detail Forms with 2 composite primary keys - Is there a workaround?

    Hello All,
    I have been searching for a workaround to the maximum 2 part primary key restriction on the multi-row updates, and master-detail forms, and am hoping that someone can help me. I am using HTMLDB v2.0.0.00.49 with IE 6 against a 9.2 DB.
    I successfully implemented the workaround of Fred Stoopendaal's (see Updata PK on HTML DB ) and it works fine for single page multi-record updateable forms, but alas I haven't been able to extend it to master detail forms (I think it is something to do with Oracle not allowing the "returning" clause on views).
    Here is what I tried:
    two tables, one with a 2 part composite primary key, which is the master table, and a detail table with 3 part composite primary key -
    --------- BEGIN SQL ---------
    create table master_table
    ( master_col1 number
    , master_col2 number
    , master_col3 varchar2(30)
    , constraint master_pk primary key (master_col1,master_col2));
    create table detail_table
    (detail_col1 number
    ,detail_col2 number
    ,detail_col3 number
    ,detail_col4 varchar2(30)
    , constraint detail_pk primary key(detail_col1,detail_col2,detail_col3)
    , constraint master_detail_fk foreign key (detail_col1,detail_col2) references master_table(master_col1,master_col2));
    create or replace view v_master_table as
    select rowid mata_rowid,mata.*
    from master_table mata;
    create or replace view v_detail_table as
    select rowid deta_rowid,
    (select rowid from master_table mata where mata.master_col1 = deta.detail_col1 and mata.master_col2 = deta.detail_col2) deta_mata_rowid
    , deta.*
    from detail_table deta;
    create or replace trigger mata_ins_upd_trg
    instead of insert or update on v_master_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into master_table (master_col1, master_col2, master_col3)
    values (:new.master_col1, :new.master_col2, :new.master_col3);
    end if;
    if updating then
    update master_table
    set master_col1 = :new.master_col1,
    master_col2 = :new.master_col2,
    master_col3 = :new.master_col3
    where rowid = :old.mata_rowid;
    end if;
    end;
    create or replace trigger deta_ins_upd_trg
    instead of insert or update on v_detail_table
    referencing new as new old as old
    for each row
    begin
    if inserting then
    insert into detail_table ( detail_col1, detail_col2, detail_col3, detail_col4)
    values (:new.detail_col1, :new.detail_col2, :new.detail_col3, :new.detail_col4);
    end if;
    if updating then
    update detail_table
    set detail_col1 = :new.detail_col1,
    detail_col2 = :new.detail_col2,
    detail_col3 = :new.detail_col3,
    detail_col4 = :new.detail_col4
    where rowid = :old.deta_rowid;
    end if;
    end;
    --------- END SQL ---------
    Then I created a master-detail form in Apex on the two views, using the mata_rowid and deta_rowid as primary keys, and mata_rowid=deta_mata_rowid as the link. I realise that using a function to fetch the master rowid within the detail view query is costly, but it was my intention to modify the record fetch queries to use the real FK columns once things were up and running.
    It seems to generate the pages ok, and I can insert/update master table records, but as soon as I modify records in the detail table things go a bit haywire. I can't find any documentation on how the inbuilt MRU/MRD logic works, so can't figure out the issue.
    Can anyone out there tell me what the problem is with the logic above, or if they have come up with a neat solution to this annoying limitation. I know that many will say that I should modify the data model to use surrogate primary keys, but many of the uses for HTMLDB are new interfaces for old schemas, so a workaround that doesn't involve wholesale data model changes would be preferable.
    Thanks in advance,
    Mike Cretan

    Hi, this is likely not the most elegant way...but perhaps the simplest -- and I didn't have much time to play.
    I used Wizard to create two separate Master Detail forms, each with a separate detail table. Thus I ended up with four pages:
    Page "A" - "Selector" page for Master (Report), with Edit link driving to Detail-1
    Page "B" - Editable Master/Detail-1 page (HTML / Report)
    Page "C" - "Selector" page for Master (Report), with Edit link driving to Detail-2
    Page "D" - Editable Master/Detail-2 page (HTML / Report)
    Then I selected the primary key column TWICE on the Report on Page A. Modified the second instance of this column to navigate to Page D (passing primary key) exactly the way the original instance of this column navigates to Page B. Then I deleted Page C.
    Since you can have only one Tabular Entry form per page, this seemed the best way to drive two separate detail tables from a common interface.

  • CMP with auto-increment primary key.Please help

    Hi all,
    I new with EJB technology so please bear with me.
    Env: 2k Server, SQL 2k Server
    Sun One(Forte EE) to develop and deploy CMP
    I got the servlet to load the data from CMP's business mehods
    is fine. Calling the findPrimaryKey is OK too. Even when I try to insert the row into DB is OK. At this time I make key PK is int AND NOT
    AUTO INCREMENT everything is OK. In the ejbCreate method
    I called setPK, setName ...It's fine.
    The problem comes when I try to make the PK(still int) to be auto-increment field.In ejbCreate not call setPK because of in SunOne IDE, under the J2EE RI tab of EJB Module property, the Auto generate SQL I set to false so that I can
    modify the SQL statement under SQL Deployment.createRow not taking the PK. I thought that will do it but it doesnot like it at all (I got Exception with transaction rollback)I just want to insert a single row with ID and name that's all.
    Then I changed the SQL statment take PK and changed the Auto Generate SQL to True and in ejbCreate the PK as one of the args and called setPK this time with null object. It doesn't like neither.(Exception Cannot set the primary key with null. That is reasonable.)
    I thought using EJB fast and clean technique would help developer to develop application with easiness.
    So I realy stuck with this, I wonder ejb 2.0 support for auto increment at all because I would like to take advantage of the auto increment feature of the DB without writing the PrimaryKeySequence generator at all.
    Am I missing something with this? May be just config thing to tell
    that my PK is auto-increment field so that when the ejbCreate called it knows not taking the PK or even not asking to call setPK in ejbCreate.
    Any help would appreciated.

    Check out this thread, there's a bunch of good info:
    http://www.theserverside.com/patterns/thread.jsp?thread_id=4976

  • Prob with Updation of Primary Key field '' SPRPS '' in PA2001. Plz HELP

    Can anyone please tell me how to update a primary key field in HR Tables (PA2001 and PA2002).
    I need to update sprps field in both the tables. I used HR_Infotype_Operation function module, but still it is not updating the field.
    Pls find the following code snippet for the table PA2001 and let me know if any discrepancies :
    TABLES: pa2001.
    DATA: it_pa2001 TYPE TABLE OF pa2001,
    wa_pa2001 LIKE LINE OF it_pa2001,
    DATA: date TYPE d.
    date = sy-datum - 100.
    SELECT pernr sprps begda endda FROM PA2001 INTO CORRESPONDING FIELDS OF TABLE it_pa2001
    WHERE begda BETWEEN date and sy-datum.
    WRITE:/.
    WRITE:/ 'PA 2001 Records'.
    if sy-subrc <> 0.
    WRITE:/ 'No Data Exists'.
    else.
    LOOP AT it_pa2001 INTO wa_pa2001.
    WRITE:/ wa_pa2001-pernr, wa_pa2001-sprps, wa_pa2001-begda, wa_pa2001-endda.
    ENDLOOP.
    endif.
    LOOP AT it_pa2001 INTO wa_pa2001.
    wa_pa2001-sprps = 'X'.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    infty = '2001'
    number = wa_pa2001-pernr
    SUBTYPE =
    OBJECTID =
    LOCKINDICATOR =
    VALIDITYEND =
    VALIDITYBEGIN =
    RECORDNUMBER =
    record = wa_pa2001
    operation = 'MOD'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    NOCOMMIT =
    VIEW_IDENTIFIER =
    SECONDARY_RECORD =
    IMPORTING
    RETURN =
    KEY =
    ENDLOOP.
    if sy-subrc = 0.
    write:/ 'SY-subrc is zero'.
    write:/ ' Rows modified = ', sy-dbcnt.
    else.
    write:/ 'No Record(s) updated'.
    endif.
    commit work.
    WRITE: / 'Updated Records in the Internal Table IT_PA2001'.
    SELECT pernr sprps begda endda FROM PA2001 INTO CORRESPONDING FIELDS OF TABLE it_pa2001
    WHERE begda BETWEEN date AND sy-datum..
    LOOP AT it_pa2001 INTO wa_pa2001.
    WRITE:/ wa_pa2001-pernr, wa_pa2001-sprps, wa_pa2001-begda, wa_pa2001-endda.
    ENDLOOP.

    Thanks Kiran.
    But I need to change this field as we need to lock the records, as soon as the employee fills his/her time sheets which will be sent for HR Payroll, later on.
    When I am updating directly the field the database table PA2001, its not updating but for table PA2002, only few records are being updated.
    Is there any other alternative for this problem?
    Pls reply.
    Thanks,
    Harish

  • Mapping Dimension with a composite primary key in AWM

    Hi, I have a dimension with 3 levels in a snowflake scheme. The Primary key (PK) of one of them is a composite pk.
    Let's say: table1 (code_t1 (pk), desc_t1), table2 (code_t2 (pk), code_t1 (pk+fk), desc_t2)) and table3 (code_t3 (pk), code_t2 (fk), code_t1 (fk), desc_t3), being table3 the base level table.
    I am using AWM 11.2.0.1.0A
    My questions are:
    1) can I have a level with a composite PK?
    2) if yes, how should I do the mappings using AWM? It seems like you only can have one filed for the source column in the Mapping pane.
    3) if no, is there any workaround?
    Thank you.

    I just tried this in AWM and it is clearly buggy in this area, in part because it is trying to change the underlying representation.
    If you export the dimension to XML you should find an entry that looks like this for each level
    <HierarchyLevelMap
    KeyExpression="..."
    Query="..."
    JoinCondition="...">
    </HierarchyLevelMap>
    The 'Query' is the name of the table you are selecting from. For example, your level2 should have
    Query="TABLE2"
    The 'KeyExpression' is the expression that defines the AW dimension member for that level. For example, your level2 should have
    KeyExpression= '(TABLE2.CODE_T2 || TABLE2.CODE_T1)'
    The 'JoinCondition' defines how to join the table for a child level to that of its parent. For example, your level3 would ideally look like this
    JoinCondition='(TABLE3.CODE_T2 = TABLE2.CODE_T2) AND (TABLE3.CODE_T1 = TABLE2.CODE_T1)'
    But in your case it must be something different, probably 'TABLE3.CODE_T2 = (TABLE2.CODE_T2 || TABLE2.CODE_T1)'.
    AWM must derive its Parent field from this JoinCondition in some way, and it appears to mess it up when you use concatenated key expressions. The workaround is to hand edit the XML to specify the JoinCondition correctly for your case and recreate the dimension from that XML. I would then avoid editing this particular mapping in AWM since it will mangle it.

  • Table with a composite primary key

    Intermedia Web agent/clipboard documentation has examples etc. on how to generate procedures and get/put data for tables having a single column as the primary key. Is it possible to use Web agent/clipboard to manipulate BLOB/ORDIMAGE data in a table which has 2 or more columns in Primary key. Has anyone done it? I will appreciate any code examples to do this.
    Thanks.

    It is possible, but you kind of need to come up with your own mechanism. Normally, when you try to retrieve a photo, for example, using 'id' as primary key, the URL would be something like:
    http://your_web_server/intermedia/mediaget/get_photo/23
    If you have a table with two columns, 'name' and 'id' as primary key, the URL would like something like:
    http://your_web_server/intermedia/mediaget/get_photo/james@23
    'james@23' will be passed to Web Agent as one string, but it is actually passing two values at once - 'james' for name and '23' for id. Here, '@' is used as a separater. In your get_photo procedure, you have to separate these two values by searching for '@'.
    You can use Clipboard Code Wizard for creating a basic procedure for a single column primary key. Then you would have to modify the code so that the procedure can handle multi-column primary key.
    I don't have any code examples for this. Sorry.

  • BC4J Custom API: Batch Validation with Sequence-based primary key

    Hi people,
    I am trying to create a BC4J Custom API using the Batch Validation feature of iSetup Framework. However, my entity object has a sequence-based primary key, and this key is carried to the View Object. This way, i have three attributes marked as key attributes in the VO: InvoiceTypeId (the sequence), OrganizationId and InvoiceTypeCode (The alternate, developer key). the primary key is marked AZ_EXPORTABLE=FALSE, because it must be rebuilt in the target using the alternate key.
    I was able to successfully extract a single row to XML using this API (i am testing locally). When i try to import this XML file containing a single row, i get the following exception. Is this feature supported in Batch Validation mode?
    Regards
    Thiago Souza
    ** Exception starts **
    Started import...
    An exception occurred in API 'CLL Invoice Types'.
    oracle.apps.fnd.framework.OAException: An exception occurred in API 'CLL Invoice Types'.
         at oracle.apps.az.fwk.BEUtil.wrapperException(BEUtil.java:395)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1927)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)
    ## Detail 0 ##
    oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06550: line 32, column 29:
    PL/SQL: ORA-00904: "KEY31": invalid identifier
    ORA-06550: linha 32, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 33, coluna 29:
    PL/SQL: ORA-00904: "KEY32": invalid identifier
    ORA-06550: linha 33, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 34, coluna 29:
    PL/SQL: ORA-00904: "KEY33": invalid identifier
    ORA-06550: linha 34, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 35, coluna 29:
    PL/SQL: ORA-00904: "KEY34": invalid identifier
    ORA-06550: linha 35, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 36, coluna 29:
    PL/SQL: ORA-00904: "KEY35": invalid identifier
    ORA-06550: linha 36, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 37, coluna 29:
    PL/SQL: ORA-00904: "KEY36": invalid identifier
    ORA-06550: linha 37, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 38, coluna 29:
    PL/SQL: ORA-00904: "KEY37": invalid identifier
    ORA-06550: linha 38, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 39, coluna 29:
    PL/SQL: ORA-00904: "KEY38": invalid identifier
    ORA-06550: linha 39, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 40, coluna 29:
    PL/SQL: ORA-00904: "KEY39": invalid identifier
    ORA-06550: linha 40, coluna 1:
    PL/SQL: SQL Statement ignored
    ORA-06550: linha 41, coluna 29:
    PL/SQL: ORA-00904: "KEY40": invalid identifier
    ORA-06550: linha 41, coluna 1:
    PL/SQL: SQL Statement ignored
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.executeSql(BEValidationXMLParser.java:288)
         at oracle.apps.az.fwk.server.BEValidationXMLParser.collectUKFKValues(BEValidationXMLParser.java:254)
         at oracle.apps.az.fwk.server.BEImport.populateTempTableForBatchValidation(BEImport.java:1897)
         at oracle.apps.az.fwk.server.BEImport.importXML(BEImport.java:371)
         at oracle.apps.az.fwk.server.BEApplicationModuleImpl.importFromXML(BEApplicationModuleImpl.java:404)
         at R12APITester.importFile(R12APITester.java:205)
         at R12APITester.importFile(R12APITester.java:180)
         at R12APITester.main(R12APITester.java:65)

    Hi Thiago,
    I would suggest to test your API first with row by row validation mode where you would be resolving the foreign and primary keys as specified in the framework. This would help you to understand the framework better and once it starts working for you and then you can try with batch validation mode.
    Thanks
    Mugunthan.

  • Create record with manual guid / primary key

    Hi All,
    Is this possible to create record in some entity in dynamics crm with set manual id / primary key / guid?
    like this:
    Entity entity = new Entity("new_test");
          entity.Attributes["new_testid"] = new Guid("688008C8-F95D-4158-BAB2-A3F695D7BEEF");
          entity.Attributes["trs_name"] = "AAAAA";
          organizationservice.Create(entity);
    is there any impact if I do that?
    please advise.
    thanks

    I have try it my development server, and it's work
    actually, this question for my requirement that need do integrate between another system to CRM, which the another system has guid as their PK (primary key) and they push their record to CRM using CRM web service and put their PK / guid value as Id in CRM's
    entity that they pushed.
    but, I have consult with microsoft support with this technique and I don't want get trouble in later time, and they said this is not recommended from microsoft, even it work as I said before.
    thanks.

Maybe you are looking for