How to genarate Primary Key for each record in XI  Mapping

Hi,
I need to genarate primary key for each record in the paylod in mapping..
Eg: if i have a 10 reacords i need to have a primary key for each record..starting with the
Record      Primary key
First            001
Secound      002
Tenth         010
If i need to write any user defined funtion... can any one provide the code for it.
Thanks
Amaresh

Hi Bavesh,
I will explain with the example:
XML:
<Record 1>
<Primary key>
<value1>
<value2>
</Record 1>
<Record 2>
<Primary Key>
</Record 2>
like above i will be getting n number of recored and in each record i need  to genarate primary key in XI.and the key sould be in sequence...
like for the first record 1 secound 2 like that primary key should add to the privous Primary key.
and this is for each payload.
Thanks
Amaresh

Similar Messages

  • How to set primary key for a date column

    hello experts .,
    i need to set primary key for a column consists of the datatype date. how to solve this..?

    1008318 wrote:
    its my personal need..then it is a very bad personal need. DATE is not an appropriate type to be using for a primary key, as it cannot be guaranteed to be unique, especially when inserting multiple rows at once.
    You would be better working to business needs and implementing correct technical solutions to those needs, than to just do things based on your personal needs.

  • How to find Primary Key for a particular SAP Databse Table?

    Hi Guys,
                  How to find Primary Key and foreign key  for Particular SAP Databse table ?for Ex : EKKO , EKPO , EKKN , EKBE , EKBEH  , EKET and EKETH.
    Thanks,
    Srinivas.

    Use transaction SE11 to display the table. Put the cursor on the field you want to display the check table and click 'Foreign key' push button (a key with an bottom point arrow), then it will show the check table of the foreign of a field.
    Or by just simple double click on the field, a pop-up window of all the attribute (including the foreign key and the check table if exists) will show too.
    <i><b>Please reward point for helpful answer.</b></i>
    Minami

  • How to create one primary key for each vendor

    Hi all
    i am doing IDOC to jdbc scenario
    i am triggering idoc from R/3 and the data is going into DB table vendor through XI.
    structures are as follows:
    sender side: ZVendorIdoc (this is a customized IDOC , if i triger IDOC for multiple vendors then it triggers only 1 idoc with multiple segment )
    Receiver side:
    DT_testVendor
        Table
            tblVendor
                action UPDATE_INSERT
                access                     1:unbounded
                    cVendorName         1
                    cVendorCode        1
                    fromdate                1
                    todate                    1
                 Key1
                    cVendorName         1
    if i trigger idoc for multiple vendors ,for example vendor 2005,2006 and 2010 . then i can see that the only key comes from the very first field (2005) and the whole record for vendor 2005,2006 and 2010  goes into the table with this(2005) as a primary key
    now again if i send data for these three vendor 2005, 2006 , 2010, in which record for the vendor 2005 is same and for 2006 and 2010 are different than it takes 2005 as a primary key and it does not update the data in the table.
    my requirement is like this:   for each vendor there should be one unique key assigned.
                                              for above said example there should come three keys one for each vendor .
    could you please help me how to do this???????????

    Hi,
      In Mapping Make the statement is 0-unbounded.For each vendor create a statement.This will solve your problem.
    Regards,
    Prakasu.M

  • How to add primary key for table with existing data?

    The table is occupied data already. There was no primary key before, so for every column, there are some duplicate values.
    I want to add a new column, which should be of the datatype integer, and can automatically increment, starting from 001. I tried this in Oracle SQL Developer, but it says "ORA-01758: table must be empty to add mandatory (NOT NULL) column". How can I do it? Thanks!

    Hello, don't call the column ID, that could be an ID relating to anything. Perhaps be a little more specific like emp_id .
    Then to update it:
    UPDATE Employee emp
      SET emp_id = (
      SELECT row_num
        FROM (
      SELECT ROWID,
                 ROW_NUMBER() OVER (ORDER BY ROWID) row_num
        FROM Employee emp2) emp2
      WHERE emp.ROWID = emp2.ROWID);That will assign a new EMP_ID for each, beginning at 1.
    Then:
    ALTER TABLE Employee MODIFY emp_id NOT NULL;
    ALTER TABLE Employee ADD CONSTRAINT EMP_PK PRIMARY KEY (EMP_ID);Then create a sequence for future population of the Employee table:
    CREATE SEQUENCE emp_seq START WITH <maximum value of emp_id + 1>;

  • How to have a unique value for each record??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.??

    could any 1 help me out in this...
    I want to have a column name 'Order No' which should be unique.
    How to generate a unique value for each record.?? If you are using SQL PLUS to create the table try something like
    this:
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8) NOT NULL PRIMARY KEY,
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES
    CUSTOMER (CUSTID),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    -- or a simpler table example
    DROP TABLE ORDER_TEST;
    CREATE TABLE ORDER_TEST (
    ORD_NO NUMBER (8),
    ORDERDATE DATE,
    CUSTID NUMBER (8) NOT NULL,
    SHIPDATE DATE,
    TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
    (TOTAL >= 0),
    CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
    note: ORD_NO can also be a primary key
    If you are doing the INSERT during runtime from a form first
    create a sequence in SQL PLUS to handle the ORD_NO value:
    Create SEQUENCE ORDERNO_UNIQUEVAL_sqnc
    START WITH 000001
    NOMAXVALUE
    NOCACHE;
    and reference it as the ORD_NO parameter in your INSERT
    statement:
    ORDERNO_UNIQUEVAL_sqnc.NEXTVAL
    note: to maintain data integrity you must use the sequence
    everytime you insert a new order to table. To start a new
    sequence drop the sequence and re-create it with whatever "START
    WITH" value you want.
    Hope this helps
    Kevin

  • How to append parameter with URL for each record in table control?

    Hi,
    I have one table control which contains 5 columns.
    (tripno, startdate, destination, reason, activities)
    In 5th column, i need to display URL for each record.
    for ex:
    www.abc.com/test?tripno=1
    www.abc.com/test?tripno=2
    www.abc.com/test?tripno=3
    when user clicks a particular hyperlink, it navigates to another page/component thru URL with one key field(tripno) to retrieve related records in next page.
    1) i am not able to assign tripno to each record. when i assign tripno, its taking the last value which i assigned. ie. tripno=3 only.
    How to assign URL to Reference field of LINK_TO_URL element at run time?
    OR
    2) we can do like this.
    Simply assign url to reach record without key field.
    www.abc.com/test
    www.abc.com/test
    www.abc.com/test
    when user clicks a particular link, we can assign corresponding key field to the URL.
    Where should i write this event? Bcoz, LINK_TO_URL doesnot have event.
    how to do?

    Hi MOg.
    Not sure whether I understand you .. but in the 5th column you want to have the reference URL. Is this the activities columen from you example?
    Nevertheless, you need a attribute (String) in your context node which contains the URL. Bind this to the reference filed of linktourl. If you can not extend the structure you can create a sub node (cardinality 1:1)  which contains the refernce attribute.
    Then loop over all elements and concatenate www.abc.com/test?tripno= with the tripno of the current element into the reference field.
    Hope tis helps,
    Sascha.
    Bind the

  • Where can I find the user key precedence hierarchy for each record type?

    Example: I want to update contact records through the CRMOD web service API.
    So I'm looking at the "Oracle Web Services On Demand Guide, Version 6.0 (released August 2010)", page 316, and it lists 3 user keys for Contact.wsdl v2.0 in the following order:
    1. FirstName and LastName
    2. Id
    3. ExternalSystemId
    From what I can see, this order does not seem to reflect the precedence hierarchy of these 3 user keys.
    I've send in a test update where I supplied a FN, LN, and EUID, ... and the contact that matched the EUID got updated.
    (I'm glad it did, because EUID really needs to take precedence over FN+LN, otherwise you could never change a contact's last name without knowing the contact's Row Id.)
    Does anyone know where I can find the precedence hierarchy for each record type's user keys (other than doing the obvious and time consuming "try+error")?

    Hi,
    we experienced similar problems with the account object and asked the oracle support about this. This was their answer:
    "[...] thank you for contacting CRM On Demand Customer Care. Regarding your question, please note the below: when perfoming a query, the user key fields are looked for in this order: - Row id - External System Id - AccountName and Location. Basically, the search will be performed by AccountName and Location only when the other fields are missing. This is an expected behavior because, the Row Id is the strongest filter as it is always unique. The external system Id comes second, as it is supposed to be unique in another system."
    So, I guess the order is always
    1) Row Id
    2) External System Id
    3) specific field combinations...
    kind regards
    Kai
    Edited by: Kai Hartmann on 28.04.2011 07:10

  • How do I store images uploaded by end users for each record?

    I am writing an application which requires end users to upload an image for each record they add. There could be thousands of images, and they are exclusive to this app. I use a File Browse item in order to let the user choose an image file to upload.
    But all I have managed to achieve at the moment is storing the full pathname of where the image is on the users machine, which means they can see the images they upload but no-one else can! Obviously not practical. I haven't figured out how to actually upload the images to the server and achieve multi-user access from there.
    My questions are, where is the best place to store these images, in the database or in a folder on the server? And what setups do I, or the DBA, need to do for both of these scenarios in order to save the uploaded images and display them.
    Hopefully someone can give advice, or point me to some documentation explaining this procedure. Thanks in anticipation.
    Rick.

    Hi
    The file you upload can be found in APEX_APPLICATION_FILES view. If you are want to store the file as BLOB in your table you can use the code similar to:
                 SELECT BLOB_CONTENT, FILENAME, MIME_TYPE
                 INTO    v_blob, v_actual_name, V_MIME_TYPE
                 FROM   APEX_APPLICATION_FILES
                 WHERE name = :P216_FILE;Or directly insert in your table using
                 INSERT INTO ......... (.....)
                 (SELECT BLOB_CONTENT, FILENAME, MIME_TYPE
                 FROM   APEX_APPLICATION_FILES
                 WHERE name = :P216_FILE);-----
    Zulqarnain
    http://www.maxapex.com
    Low Cost, High Quality Hosting for Oracle Apex

  • How to call webservice for each record in a table using ODI

    Hi
    I am new to ODI and Webservice. I want to invoke a scenario in ODI using web service. I hava a weblogic application server with axis 2 deployed.
    But I want call webservice for each record in a table
    For eg: "EMP" table have 50 records, for each record web service should invoke
    Can any one help me on it.
    Thanks,
    phani
    Edited by: user12774166 on Jun 6, 2010 11:16 PM

    If your goal is "call" a web service, Jason's Straub's [flex-ws-api|https://flex-ws-api.samplecode.oracle.com/] is by far the best I've seen. You might want read more about it on [his blog|http://jastraub.blogspot.com/search?q=+flex_ws_api+].
    Tyler Muth
    http://tylermuth.wordpress.com
    [Applied Oracle Security: Developing Secure Database and Middleware Environments|http://sn.im/aos.book]

  • Sending emails for each record from tabular form

    I currently have a requirements management tabular form that used to update or set job requirements inactive and/or covered.
    We're a staffing agency and have salesmen across the country that will use this tabular form to quickly manage their requirements to mark them as covered or inactive if the position has been filled.
    The multi-row update works fine since the form was built using the wizard, but I need to be able to send out an email for each record that's been marked as covered in the tabular form.
    How can this be accomplished?
    I'm running Oracle 12c and Apex 4.2.0 on a windows 2008 R2 server.
    Thanks again.

    Greg,
    I took a different approach from what I originally suggested.  Since the tabular form is displaying only reqs that eligible to be covered, I chose to construct a process that would read the database after the reqs table was updated.  The code should find recent reqs covered by the salesman and then send out an email for each covered req.
    Since I cannot see the data structure of your reqs table, I guessed the data type and size for the local variables in the DECLARE section, you many need to adjust these.
    Give this code a shot and let's see where we get.  By the way, the naming conventions of your database are in need of naming standards.
    The process needs to occur After Submit and after the Automatic Row Processing (DML) process that is updating the reqs table.  Make sure that the process sequence number is greater than the Automatic Row Processing (DML) sequence number.
    DECLARE
       l_id           NUMBER;
       l_index        NUMBER;
       l_vc_arr2      apex_application_global.vc_arr2;
       lc_message     VARCHAR2 (4000);
       l_pkey         NUMBER;
       l_date_wrote   DATE;
       l_sales        VARCHAR2 (100);
       l_client       VARCHAR2 (100);
       l_job          VARCHAR2 (100);
       l_1or2         VARCHAR2 (100);
       l_rate         NUMBER;
       l_notes        VARCHAR2 (4000);
    BEGIN
       FOR c1
          -- Retrieve reqs primary key that have been covered
          -- in the last 2 seconds by the salesman
       IN (SELECT pkey
             INTO l_pkey
             FROM reqs
            WHERE     SYSDATE < (date_wrote + 1 / 46200)
                  AND active = 'Active'
                  AND reqs.sales = :p12_sales
                  AND covered IS NOT NULL)
       -- Send an email for each req that has been covered
       LOOP
          SELECT c1.date_wrote,
                 c1.sales,
                 c1.client,
                 c1.job,
                 c1.notes,
                 c1.who,
                 c1.1or2,
                 c1.rate
            INTO l_date_wrote,
                 l_sales,
                 l_client,
                 l_job,
                 l_notes,
                 l_who,
                 l_1or2,
                 l_rate
            FROM reqs
           WHERE pkey = l_pkey;
          lc_message := 'Date Written   :' || l_date_wrote || CHR (10);
          lc_message := lc_message || 'Sales          :' || l_sales || CHR (10);
          lc_message := lc_message || 'Client         :' || l_client || CHR (10);
          lc_message := lc_message || 'Position       :' || l_job || CHR (10);
          lc_message := lc_message || '#1 or #2       :' || l_1or2 || CHR (10);
          lc_message := lc_message || 'Rate           :' || l_rate || CHR (10);
          lc_message := lc_message || 'Notes      :' || l_notes || CHR (10);
          l_id :=
             apex_mail.send (
                p_to     => '[email protected]',
                p_from   => 'DO_NOT_REPLY@REQS',
                p_subj   =>    ''
                            || l_who
                            || ' Has Covered '
                            || l_job
                            || ' at '
                            || l_client
                            || CHR (10),
                p_body   => lc_message);
          COMMIT;
          apex_mail.push_queue ();
       END LOOP;
    END;
    Jeff

  • Graphical mapping question - need to create 2 nodes for each record

    The mapping is from flat to nested, i.e. flat file to FIDCC2 idoc. Each record has to go to 2 repeated IDoc segments, each one with different posting key. Right now, I have it working for each record to a segment(for one segment) by using splitByValue (value change). How can I repeat the creation of another but with slightly different constant.
    Also, how do I add line numbers? I remember seeing a posting on this a while ago - cannot locate it.
    Will be Rewarded WELL.
    Thanks,
    Pam

    Hi, Pam
    Using the following example to store it as global variable
    SetParameter from GloabalContainer:
    container.getGlobalContainer ().setParameter ("COUNTER", "0");
    GetParameter from GloabalContainer:
    String myCounter = (String) container.getGlobalContainer().getParameter ("COUNTER");
    When you map to your constant, store it in global variable, then you map other field, get current global variable, check its value, based on the value, you do proper mapping.
    Hope it helps
    Liang

  • How to use primary key in sql combined from 2 columns

    table1
    primary key = orderid+custname
    orderid custname address
    8889 Adrian london
    8867 Clara manchester
    2229 Peter warwick
    table2
    primary key = orderid+custname
    orderid custname qty price
    8889 Adrian 10 2500
    8865 Adrian 20 9483
    8867 Clara 30 3993
    5869 Clara 15 1828
    2290 Peter 10 2102
    2298 Peter 13 3839
    then how do i query ?
    SQL> select t1.orderid, t1.custname, t1.address, t2.qty, t2.price from
    table1 t1, table2 where ? = ?
    what's the "?" should be ????
    it doesn't work if i enter the primary constraint key for each table.
    thanks.

    thanks, it works ;)
    btw, do you know how about the date field ?
    what if one of the field in table1 is 12/12/2005 14:30
    and table2 is 15/12/2005
    table1
    orderid orderdate
    1234 12/12/2005 14:30
    2234 15/12/2005 13:45
    table2
    orderid orderdate
    1234 12/12/2005
    2234 15/12/2005
    so the query
    select t1.orderid as t1 t1.orderdate , t2.orderid as t2, t2.orderdate from
    table1 t1, table2 t2 where t1.orderid = t2.orderid
    and to_char(to_date(t1.orderdate, 'dd/mm/yyyy hh24:mi'), 'dd/mm/yyyy') = t2.orderdate
    thanks.

  • How to set primary key of the VO.

    I have a problem with the master detail search. The search works fine on the first search, all details can be seen fine, but in the second search I get this error.
    The number of displayed records, 1, exceeds the actual number of records, 0, in view object EgoItemAdvancedSearchAM.MYACCESSOR001_MYLINK001_DetailsOrderLinesVO. Some of the displayed records may have been deleted.
    Somwhere in another thread, someone had the same problem and the soultion was to set primary key of the master VO. I am not sure how to set primary key of a VO. In my case the master VO is dynamic. Is there a way I can set PK of a dynamic VO.
    Any help greatly appreciated.

    Hi
    Thanks for your reply...
    am seting the primary key to VO attribute in my controller(PR)...but its not mapping to the VO attribute..
    OAAttachmentImageBean Ibean = (OAAttachmentImageBean)webBean.findChildRecursive("OpAttachments");
    String[] pkvaule = {"ResAttribute15"};
    Ibean.setPkColumns(pkvaule);
    Regards
    Harrrry

  • Primary key for an column consisting duplicates

    hi,
    ------->i have created a table and
    -------> i have a column consisting of 1000 records (but where i have duplicates)
    and now i want to create a primary key for the column
    how can i do it....

    Hi,
    You can find records which contains duplicate values for the table column using Oracle exceptions table. Please see a small demonstration:-
    SQL> create table test1(id number);
    Table created.
    SQL> insert into test1 values(&id);
    Enter value for id: 1
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(1)
    1 row created.
    SQL> /
    Enter value for id: 2
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(2)
    1 row created.
    SQL> /
    Enter value for id: 3
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(3)
    1 row created.
    SQL> /
    Enter value for id: 1
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(1)
    1 row created.
    SQL> /
    Enter value for id: 3
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(3)
    1 row created.
    SQL> /
    Enter value for id: 4
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(4)
    1 row created.
    SQL> /
    Enter value for id: 5
    old 1: insert into test1 values(&id)
    new 1: insert into test1 values(5)
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> alter table test1 add constraint id_pk primary key(id);
    alter table test1 add constraint id_pk primary key(id)
    ERROR at line 1:
    ORA-02437: cannot validate (SYS.ID_PK) - primary key violated
    SQL> alter table test1 add constraint id_pk primary key(id) exceptions into exceptions;
    alter table test1 add constraint id_pk primary key(id) exceptions into exceptions
    ERROR at line 1:
    ORA-02445: Exceptions table not found
    SQL> @?/rdbms/admin/utlexcpt
    Table created.
    SQL> alter table test1 add constraint id_pk primary key(id) exceptions into exceptions;
    alter table test1 add constraint id_pk primary key(id) exceptions into exceptions
    ERROR at line 1:
    ORA-02437: cannot validate (SYS.ID_PK) - primary key violated
    SQL> desc exceptions
    Name Null? Type
    ROW_ID ROWID
    OWNER VARCHAR2(30)
    TABLE_NAME VARCHAR2(30)
    CONSTRAINT VARCHAR2(30)
    SQL> select * from exceptions;
    ROW_ID OWNER TABLE_NAME CONSTRAINT
    AAAc95AABAAA9EpAAD SYS TEST1 ID_PK
    AAAc95AABAAA9EpAAA SYS TEST1 ID_PK
    AAAc95AABAAA9EpAAE SYS TEST1 ID_PK
    AAAc95AABAAA9EpAAC SYS TEST1 ID_PK
    SQL> select * from test1 where rowid in(select row_id from exceptions);
    ID
    3
    1
    1
    3
    Thanks
    Edited by: rarain on May 28, 2013 12:10 PM

Maybe you are looking for

  • How to execute exact match & contains text search simultaneoulsy in Oracle 10g

    Hi, We have scenario where there are more than 50 million rows in a table with description column length as 1000 character. We have a web interface from where we generate a rule of comma separated keywords like "Standard", Single, Cancel, "deal"    &

  • Show in playlist keyboard shortcut

    Is there any way to create a keyborad shortcut to show  in which playlist the current song belongs to? Currently I can only do so by right-clicking on the song with the mouse

  • Elements 5.02 - Attempt to access invalid address

    When I try to launch Photoshop 5.02 the welcome screen is displayed and I can open the Organizer, but when I attempt to open the Quick Fix or the other editor programs I get a dialogue box "Attempt to access invalid address" This problem is on my pro

  • Regarding reversing a SAP note

    Hi all , I implemented SAP note 921164 ( for MB51 performance improvement) .System suggested few other notes to be implemented as a prerequisite and I did the same. Right now , I want to cancel all the SAP notes implemented and implement only 921164

  • Use Publisher as primary IPMA Server

    Dear Expert, I would like to khnow if the fact of using my publisher (on a cluster of three nodes) as a primary IPMA server is a deviation of the best practice of Cisco or it can implémented without any issue. Thank you in advance. Nizar Houichi