Every table need primary key in toplink mapping to fetch the data

Hi everyone,
we are working on toplink mapping , it neccessary every table needs primary key. if yes, gave me example.

Hi everyone,
Alterations in database will not be automatically reflected in toplink so, there is any alternative
with regards
abusufian

Similar Messages

  • How to fetch the data from databse table and get the required output

    Hi,
    I have made a project that connects CEP to database table but i m getting some problem in fetching the data from database.
    From the following code :
    If the where condition is removed then the application runs fine but i am still not able to fetch the data from the table because it is not showing any output.
    Can anyone please suggest me that how to write WHERE statement correctly and how i will be able to see the output.
    Following is the config.xml for processor:
    ======================================
    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
         xmlns:jdbc="http://www.oracle.com/ns/ocep/config/jdbc">
         <processor>
              <name>JDBC_Processor</name>
              <rules>
                   <query id="q1"><![CDATA[
                             SELECT STOCK.SYMBOL as symbol, STOCK.EXCHANGE as exchange
                             FROM ExchangeStream [Now] as datastream, STOCK
                             WHERE datastream.SYMBOL = datastream.SYMBOL ]]></query>
              </rules>
         </processor>
         <jms-adapter>
              <name>JMS_IN_Adapter</name>
              <jndi-provider-url>t3://CHDSEZ135400D:7001</jndi-provider-url>
              <destination-jndi-name>jms.TestKanikaQueue</destination-jndi-name>
              <user>weblogic</user>
              <password>welcome1</password>
         </jms-adapter>
    </wlevs:config>
    Following is the assembly file:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
         xmlns:wlevs="http://www.bea.com/ns/wlevs/spring" xmlns:jdbc="http://www.oracle.com/ns/ocep/jdbc"
         xmlns:spatial="http://www.oracle.com/ns/ocep/spatial"
         xsi:schemaLocation="
              http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans.xsd
              http://www.springframework.org/schema/osgi
              http://www.springframework.org/schema/osgi/spring-osgi.xsd
              http://www.bea.com/ns/wlevs/spring
              http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd
              http://www.oracle.com/ns/ocep/jdbc
              http://www.oracle.com/ns/ocep/jdbc/ocep-jdbc.xsd
              http://www.oracle.com/ns/ocep/spatial
              http://www.oracle.com/ns/ocep/spatial/ocep-spatial.xsd">
         <wlevs:event-type-repository>
              <wlevs:event-type type-name="StockEvent">
                   <wlevs:properties>
                        <wlevs:property name="SYMBOL" type="byte[]" length="16" />
                        <wlevs:property name="EXCHANGE" type="byte[]" length="16" />
                   </wlevs:properties>
              </wlevs:event-type>
              <wlevs:event-type type-name="ExchangeEvent">
                   <wlevs:class>com.bea.wlevs.event.example.JDBC_CEP.ExchangeEvent</wlevs:class>
              </wlevs:event-type>
              <wlevs:event-type type-name="StockExchangeEvent">
                   <wlevs:properties>
                        <wlevs:property name="symbol" type="byte[]" length="16" />
                        <wlevs:property name="price" type="byte[]" length="16" />
                        <wlevs:property name="exchange" type="byte[]" length="16" />
                   </wlevs:properties>
              </wlevs:event-type>
         </wlevs:event-type-repository>
         <bean id="readConverter" class="com.bea.wlevs.adapter.example.JDBC_CEP.Adapter_JDBC" />
         <bean id="outputJDBCBean" class="com.bea.wlevs.bean.example.JDBC_CEP.OutputBean_JDBC">
         </bean>
         <wlevs:adapter id="JMS_IN_Adapter" provider="jms-inbound">
              <wlevs:listener ref="ExchangeStream" />
              <wlevs:instance-property name="converterBean"
                   ref="readConverter" />
         </wlevs:adapter>
         <wlevs:processor id="JDBC_Processor" advertise="true">
              <wlevs:listener ref="OutputChannel" />
              <wlevs:table-source ref="STOCK" />
         </wlevs:processor>
         <wlevs:channel id="ExchangeStream" event-type="ExchangeEvent" advertise="true">
              <wlevs:listener ref="JDBC_Processor" />
         </wlevs:channel>
         <wlevs:channel id="OutputChannel" event-type="StockExchangeEvent"
              advertise="true">
              <wlevs:listener ref="outputJDBCBean" />
         </wlevs:channel>
         <wlevs:table id="STOCK" event-type="StockEvent"
              data-source="StockDs" table-name="STOCK" />
         <wlevs:table id="STOCK_EXCHANGE" event-type="StockExchangeEvent"
              data-source="StockDs" table-name="STOCK_EXCHANGE" />
    </beans>
    ExchangeEvent.java:
    package com.bea.wlevs.event.example.JDBC_CEP;
    public class ExchangeEvent {
         public String SYMBOL;
         public String symbol;
         public String exchange;
         public ExchangeEvent() {
         public String getSYMBOL() {
              return SYMBOL;
         public void setSYMBOL(String sYMBOL) {
              SYMBOL = sYMBOL;
         public String getSymbol() {
              return symbol;
         public void setSymbol(String symbol) {
              this.symbol = symbol;
         public String getExchange() {
              return exchange;
         public void setExchange(String price) {
              this.exchange = price;
    Adapter Class:
    package com.bea.wlevs.adapter.example.JDBC_CEP;
    import com.bea.wlevs.adapter.example.JDBC_CEP.MyLogger;
    import com.bea.wlevs.adapters.jms.api.InboundMessageConverter;
    import java.text.DateFormat;
    import java.util.Date;
    import com.bea.wlevs.adapters.jms.api.MessageConverterException;
    import com.bea.wlevs.event.example.JDBC_CEP.ExchangeEvent;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.TextMessage;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;
         public class Adapter_JDBC implements InboundMessageConverter{
         @SuppressWarnings("unchecked")
         public List convert(Message message) throws MessageConverterException, JMSException {
              Random rand = new Random();
              int unique_id = rand.nextInt();
              DateFormat dateFormat;
              dateFormat = DateFormat.getTimeInstance();
              dateFormat.format(new Date());
              MyLogger.info(unique_id + " CEP Start Time is: " + dateFormat.format(new Date()));
              System.out.println("Message from the Queue is :"+ message);
              TextMessage textMessage = (TextMessage) message;
              String stringMessage = textMessage.getText().toString();
              System.out.println("Message after getting converted into String is :"+ stringMessage);
                   String[] results = stringMessage.split(",\\s*"); // split on commas
                   ExchangeEvent event1 = new ExchangeEvent();
                   event1.setSYMBOL(results[0]);
         List events = new ArrayList(2);
         events.add(event1);
         return events;
    Output Bean Class :
    package com.bea.wlevs.bean.example.JDBC_CEP;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.event.example.JDBC_CEP.ExchangeEvent;
    import com.bea.core.datasource.DataSourceService;
    public class OutputBean_JDBC implements StreamSink{
         public void onInsertEvent(Object event) {
         if (event instanceof ExchangeEvent) {
              ExchangeEvent cacheEvent = (ExchangeEvent) event;
         System.out.println("Symbol is: " + cacheEvent.getSymbol());
         System.out.println("Exchange is: " + cacheEvent.getExchange());
         System.out.println(DataSourceService.class.getClass());
    Kindly let me know if you need further info.

    Do you have StockDs configured in your server config.xml?
    I think the query should look more like this:
    SELECT stocks.SYMBOL, stocks.EXCHANGE
    FROM STOCK as stocks, ExchangeStream [Now] as datastream WHERE stocks.SYMBOL = datastream.SYMBOL
    Thanks
    andy

  • How can i join the header and item table to fetch the data

    hi experts,
                   i have a doubt in using inner join or for all entries, for fetching the data from the item table mseg, by taking the doc.no from mkpf. Plz sort out the difference, what happens, if i use the both statements for fetching data

    Hi,
    Both has same functionality.
    but if u are using FAE, u ahev to check for the
    ~intial condition of the source table,
    ~ duplicate entries, if any
    Inner join will fetch the data from all the join tables at once. FAE will fetch the date from a table first then use that data to fetch data from subsequent table.
    say in ur case, if u r using FAE,
    1.select from mkpf.
    2.select from mseg fae in I_MKPF.
    first try using JOIN. if it is taking lots of time, then try FAE.
    regards,
    madhu

  • Null value in detail table's primary key

    I use Business Components Data Form to define a master-detail java panel.
    I don't display the primary key column in the detail grid control.
    Then I click on "+" to add a row, enter a value (the 2nd part of the detail table's primary key) and click commit.
    I get an error saying that the primary key column that's not displayed is null and the row cann't be committed.
    How do I fix this error?

    My fields are varchar2's.
    -- simplified to protect the guilty:
    -- (made up from memory, so sql keywords may --be misspelled, but you get the idea)
    create table proj (
    proj varchar2(10) not null,
    constraint proj_pk
    primary key(proj)
    insert into proj values ('abc');
    commit;
    -- this table has legal values for -- the master.legal field.
    -- in master, legal was changed to a -- ComboBoxControl control from -- TextFieldControl that the wizard -- generated.
    create table legal_values (
    proj varchar2(10) not null,
    legal varchar2(10) not null,
    display_order integer not null,
    constraint legal_values_pk
    primary key (proj, legal)
    insert into legal_values
    values ('abc', 'one', 1);
    insert into legal_values
    values ('abc', 'two', 2);
    insert into legal_values
    values ('abc', 'three', 3);
    commit;
    create table master (
    proj varchar2(10) not null,
    masterKey varchar2(15) not null,
    legal varchar2(10) not null,
    constraint master_pk
    primary key (proj, masterKey)
    create table detail (
    proj varchar(10) not null,
    masterKey varchar(15) not null,
    detailkey varchar(10) not null,
    display_order integer not null,
    status varchar2(12) not null, -- user can only update this field
    constraint detail_pk
    primary key(proj, masterkey, detailkey)
    -- legal rows for detail table
    create table detail_values (
    proj varchar2(10) not null,
    detailkey varchar2(10) not null,
    display_order integer not null,
    constraint detail_values_pk
    primary key(proj, detailkey)
    insert into detail_values values
    ('abc', 'status a', 1);
    insert into detail_values values
    ('abc', 'status b', 2);
    commit;
    -- if their is a foriegn key on details back
    -- to master, then you get the
    -- "mutating table" error when trigger
    -- occurs.
    create or replace trigger master_tr
    after insert on master
    for each row
    begin
    insert into detail
    (masterKey, detailKey, status, display_order, status)
    select :new.masterkey, detail_key, display_order, ' '
    from detail_values;
    end;
    -- detail.status is a comboboxControl getting --its values of of another db table too.
    -- there's also "after update" triggers on master and detail tables that copy the record to master_history and "detail_history" tables if the corresponding table is modified. Thus we have a history of the changes made to the records. The 2 history tables have 2 additional fields than their parents, "modified_date date default sysdate not null" and "modified_by varchar2(30) default user not null" that record when and who made the change. There's also a change type field that records where the change is an insert, delete or update (there 3 triggers per table , so we can correctly record change type as being insert, delete or update into the change_type field).
    If you want to make it more real to life, the status value is initially blank, then can be changed to a legal status value (complete or not complete), but can not be changed back to blank.
    ***P.S. I have to have this ready for production by monday.****
    P.P.S After you reply and change to ComboBoxControls in 2 places, try changing the table names and/or the column names (say to follow the DBA's naming convention) or add another field to the composite primary key (and unstated foriegn key) (using drop table/create table). Now try getting the existing code to run. No writing down the old/new table (or column) name pair names. Just run the code and try to fix the code based on the error messages. Are the error messages giving you adequate information to find the problem?

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • Table and Primary Key Case Sensitive in Automated Row Fetch

    Why are the table and primary key fields case sensitive in the Automated Row Fetch process? I'm debugging an error in this process and I'm not sure what the case should be.

    Russ - It's a defect of sorts. Use upper case in the process definition. I don't think these processes will work with tables or columns whose names are not known to the database as upper-case values, i.e., defined using double-quoted non-upper case.
    Scott

  • How to fetch the data from a pl/sql table and varray, with some example

    I want to fetch the data using a cursor from Pl/sql table and varry and I want to update the data.
    Please provide me some example.

    PL/SQL Table  - please note that, right term is Associative Array.
    Presumably you are referring to the 'often heated' back-and-forth that sometimes goes on in the forums when people refer to ANY PL/SQL type using a term with the word 'table' in it?
    Curious that you then show an example of a nested table!
    type emp_tab is table of employees%rowtype;
    The 'right term' for that is 'nested table'. The following would be an 'associative array' or 'index-by table'
    type emp_tab is table of employees%rowtype INDEX BY PLS_INTEGER;
    Those used to be called 'PL/SQL tables' or 'index-by tables' but 'associative array' is the current term used.
    Associative Arrays
    An associative array (formerly called PL/SQL table or index-by table) is a set of key-value pairs. Each key is a unique index, used to locate the associated value with the syntax variable_name(index).
    The data type of index can be either a string type or PLS_INTEGER.
    Since the Oracle docs often use 'PL/SQL table' or 'index-by table' it isn't unusual for someone asking a question to use those terms also. Technically the types may not be 'tables' but it's clear what they mean when they use the term.
    In PL/SQL the term 'nested table' is still used even though the PL/SQL collection is not really a table. SQL does have nested tables where the data is actually stored in a table. The PL/SQL  'nested table' type can be used as the source/destination of the SQL data from a nested table so that may be why Oracle uses that term for the PL/SQL type.
    The doc that SKP referenced refers to this use:
    Nested Tables
    In the database, a nested table is a column type that stores an unspecified number of rows in no particular order. When you retrieve a nested table value from the database into a PL/SQL nested table variable, PL/SQL gives the rows consecutive indexes, starting at 1.

  • Fetch the data from the tables in the SQL 2005 server to sap R/3.

    Hi Experts,
    We need to fetch the data from the tables in the SQL 2005 server to sap R/3.
    Please explain which will be the best approach to fetch the same and how to do it. Sample program can greatly help.
    << Please do not offer points >>
    Regards,
    Shobana K
    Edited by: Rob Burbank on Sep 21, 2010 2:36 PM

    Hi,
    Try NATIVE SQL statements in your abap code otherwise you can try to establish jdbc connection from ABAP program.
    search in SDN for samples!
    Suresh

  • How to fetch the data to the internal table with out using mandt

    Hi all,
    Iam giving my code please observer... and give me the reasonable solution.
      t_mar LIKE STANDARD TABLE OF z_mar.
    SELECT  mandt
             werks                         " Plant
             lifnr                         " Vendor
        FROM z_mar
        INTO TABLE t_mar
    where sal = 2000.
    By removing MANDT from select query, it is going to dump.
    ex:
       SELECT 
              werks                         " Plant
              lifnr                         " Vendor
         FROM z_mar
         INTO TABLE t_mar
    where sal = 2000.
    > Now it is going to dump ( here i removed the mandt field ).
    Please give me a solution to fetch the data by removing mandt in select statement, with out chaning the internal table structure.
    Thanks,
    Ravi

    hi Ravi,
    i also had to avoid move-corresponding and the following is what i did...its extra work and goes around but it will
    do the needed work..............
    t_mar LIKE STANDARD TABLE OF z_mar.
    SELECT *
    FROM z_mar
    INTO TABLE t_mar
    where sal = 2000.
    the above gets you all the fields ...but if you still want to narrow it down to just two fields
    *****Declaring structure with 2 fields
    data:begin of fs_data.
    data:werks type z_mar-werks,
         lifnr type z_mar-lifnr ,
    data:end of fs_data.
    *******internal table of above
    data:int_data like fs_data occurs 0 with headerline.
    *****moving the only 2 required fields
    loop at t_mar.
    t_mar-werks  = int_data-werks.
    t_mar-lifnr  = int_data-lifnr.
    append int_data.
    endloop.
    Hope you found it useful...
    Regards
    Bx

  • How to fetch the data from pl/sql table dynamically

    Hi All, I have the requirement of comparing two db views data in pl/sql. So, I have bulk collect the view into pl/sql table. But, the issue is, It is expecting to provide the column name for comparison. But, in my case, column name is dynamic. So, i cannot provide the column name directly for comparison.
    For eg: In my view t1_VW, i have 4 columns. stid, c1,c2,c3,c4 and similar structure for t2_vw
    my code
    TYPE v1_type IS TABLE OF t1_vw%ROWTYPE;
    l_data v1_type;
    TYPE v1_type1 IS TABLE OF t2_vw%ROWTYPE;
    l_data1 v1_type1;
    test varchar2(1000);
    test1 varchar2(1000);
    temp1 number;
    begin
    SELECT * Bulk collect into l_data
    FROM T1_VW;
    SELECT * Bulk collect into l_data1
    FROM T2_VW;
    select l_data(1).stid into temp1 from dual; -- It is working fine and gives me the value properly
    -- But, in my case, we are reading the column names from array, i am constructing the query dynamically and execute it.
    test :='select l_data(1).stid into temp1 from dual';
    execute immediate test into temp1;
    -- I am getting error as follows:
    Error report:
    ORA-00904: "L_DATA": invalid identifier
    ORA-06512: at "SYSTEM.BULKCOMPARISON", line 93
    ORA-06512: at line 2
    00904. 00000 - "%s: invalid identifier"
    *Cause:   
    *Action
    end;
    - Please help me to get rid of this issue. Is it possible to construct the query dynamically and fetch the data?. If not, is there any other better approach to compare the data between two views?.

    Output should display what are all columns changed and its old value and new value.
    For eg., output should be
    COLUMNNAME OLD_VALUE NEW_VALUE STID
    C1 20 10 1
    C2 50 40 2
    C3 60 70 2
    C2 80 90 3Why no do this only via a simple sql ?
    create table a (STID number, C1 number,  C2 number, C3 number);
    insert into a values (1, 20, 30, 40)
    insert into a values (2, 40, 50, 60);
    insert into a values (3, 90, 80, 100);
    create table b as select *
    from a where 1 = 0;
    insert into b values (1, 10, 30, 40)
    insert into b values (2, 40, 40, 70);
    insert into b values (3, 90, 90, 100);
    commit;And now you can issue such a kind of select
    SELECT stid , c1, c2, c3                      
       FROM
      ( SELECT a.*,
             1 src1,
             to_number(null) src2        
       FROM  a   
       UNION ALL
       SELECT b.*,
             to_number(null) src1,
             2  src2        
        FROM b
       GROUP BY stid , c1, c2, c3
       HAVING count(src1) <> count(src2)
       order by stid;I would then create a new table a_b_difference having the same structure as a or b and insert into it like this
    create table a_b_diff as select * from a where 1 = 0;
    insert into a_b_diff
    SELECT stid , c1, c2, c3                      
       FROM
      ( SELECT a.*,
             1 src1,
             to_number(null) src2        
       FROM  a   
       UNION ALL
       SELECT b.*,
             to_number(null) src1,
             2  src2        
        FROM b
       GROUP BY stid , c1, c2, c3
       HAVING count(src1) <> count(src2)
       order by stid
       ;Then each time there is a difference between a column in a and its equivalente one in b (per unique stid ) a record will be inserted in this table.
    You can do more by adding the name of the table in front of each record in this table to see exactly where the data comes from
    Best Regards
    Mohamed Houri

  • Getting an error while fetching the data and bind it in the Tree table

    Hi All,
    I am getting an error "A navigation paths parameter object has to be defined - " while fetching the data and bind it in the Tree table.
    Please find the code and screenshot below
    var oModel = new sap.ui.model.odata.ODataModel("../../../XXXX.xsodata/", true);
    var oTable = sap.ui.getCore().byId("table");
    oTable.setModel(oModel);
    oTable.bindRows({
        path: "/Parent",
        parameters: {expand: "Children"}
    Can anyone please give me a suggestion to rectify this?
    Thanks in Advance,
    Aravindh

    Hi All,
    Please see the below code. It works fine for me.
    var oController = sap.ui.controller("member_assignment");
    var oModel = new sap.ui.model.odata.ODataModel("../../../services/XXXX.xsodata/", true);
    var Context = "/PARENT?$expand=ASSIGNEDCHILD&$select=NAME,ID,ASSIGNEDCHILD/NAME,ASSIGNEDCHILD/ID,ASSIGNEDCHILD/PARENT_ID";
    var oTable = sap.ui.getCore().byId("tblProviders");
    oModel.read(Context, null, null, true, onSuccess, onError);
    function onSuccess(oEventdata){
        var outputJson = {};
        var p = 0;
        var r = {};
        try {
            if (oEventdata.results){
                r = oEventdata.results;
        } catch(e){
            //alert('oEventdata.results failed');
        $.each(r, function(i, j) {
            outputJson[p] = {};
            outputJson[p]["NAME"] = j.NAME;
            outputJson[p]["ID"] = j.ID;
            outputJson[p]["PARENT_ID"] = j.ID;
            outputJson[p]["DELETE"] = 0;
            var m = 0;
            if (j.ASSIGNEDCHILD.results.length > 0) {
                $.each(j.ASSIGNEDCHILD.results, function(a,b) {
                outputJson[p][m] = { NAME: b.NAME,
                                     ID : b.ID,
                                     PARENT_ID: b.PARENT_ID,
                                     DELETE: 1};
                m++;
            p++;
        var oPM = new sap.ui.model.json.JSONModel();
        oPM.setData(outputJson);
        oTable.setModel(oPM);
    function onError(oEvent){
        console.log("Error on Provider Members");
    oTable.bindRows({
        path:"/"
    Regards
    Aravindh

  • Fetch the data from two tables

    hell all
    i want to fetch the data from two tables, one is from internal table and another one is data base table. what syntax i have to use either FOR ALL ENTRIES or INNER JOIN?

    hi
    Use FOR ALL ENTRIES.
    see the sample code
      select * into table tvbrk from vbrk
                                where fkart in ('F2', 'F3', 'RE',
                                           'ZVEC' , 'ZVEM' , 'ZVED',
                                           'S1')
                                and erdat in so_erdat
                                and kunag in s_kunag. 
                                      erdat in so_erdat
                               and   fkart in ('F2', 'F3', 'RE',
                                                 'ZVEC' , 'ZVEM').
    if not tvbrk is initial.
        select * into table t_zregion from zregion
                      for all entries in tvbrk
                       where country = tvbrk-land1
                       and   region = s_regio.
      endif.
    thanks
    sitaram

  • Need to fetch the data

    Hi,
    i have a table and the i want to fetch the data in the following way
    test--table name
    when we are fetching the data:- from the table test ,it is comig as bellow.
    3P SUPPORT
    ALLIED SVCS
    AS-CDN
    AS-DVSUP
    BCS
    BES
    BMS
    CAM
    i want to fetch the data in the folllwoing way.
    3P SUPPORT,
    ALLIED SVCS,
    AS-CDN,
    AS-DVSUP,
    BCS,
    BMS,
    CAM
    Regards
    Das.

    I guessed... This looks like a case of String Aggregation.
    Something like this?
    (Only on versions > 11gR2)
    ranit@XE11GR2>> ed
    Wrote file afiedt.buf
      1  with test_table as
      2  (
      3  select 1 id, '3P SUPPORT' data from dual UNION ALL
      4  select 1 id, 'ALLIED SVCS' data from dual UNION ALL
      5  select 2 id, 'AS-CDN' data from dual UNION ALL
      6  select 2 id, 'AS-DVSUP' data from dual UNION ALL
      7  select 3 id, 'BCS' data from dual UNION ALL
      8  select 3 id, 'BES' data from dual UNION ALL
      9  select 3 id, 'BMS' data from dual UNION ALL
    10  select 3 id, 'CAM' data from dual
    11  )
    12  --
    13  -- Test data
    14  --
    15  select
    16     id,
    17     LISTAGG(data,',') WITHIN GROUP(order by data) data
    18  from test_table
    19* group by id
    ranit@XE11GR2>> /
      ID DATA
       1 3P SUPPORT,ALLIED SVCS
       2 AS-CDN,AS-DVSUP
       3 BCS,BES,BMS,CAM
    The rows are grouped by column "Id" and String-aggregation is done for column "Data".
    Below solution works in all Oracle versions:
    ranit@XE11GR2>> ed
    Wrote file afiedt.buf
      1  with test_table as
      2  (
      3  select 1 id, '3P SUPPORT' data from dual UNION ALL
      4  select 1 id, 'ALLIED SVCS' data from dual UNION ALL
      5  select 2 id, 'AS-CDN' data from dual UNION ALL
      6  select 2 id, 'AS-DVSUP' data from dual UNION ALL
      7  select 3 id, 'BCS' data from dual UNION ALL
      8  select 3 id, 'BES' data from dual UNION ALL
      9  select 3 id, 'BMS' data from dual UNION ALL
    10  select 3 id, 'CAM' data from dual
    11  )
    12  --
    13  -- Test data
    14  --
    15  select
    16     id,
    17     RTRIM(
    18             XMLAgg(XMLElement(x,data||',')).extract('//text()')
    19             ,',') data
    20  from test_table
    21* group by id
    ranit@XE11GR2>> /
      ID DATA
       1 3P SUPPORT,ALLIED SVCS
       2 AS-CDN,AS-DVSUP
       3 BCS,CAM,BMS,BES
    Read more on various String Aggregation techniks --
    1. http://www.oracle-base.com/articles/misc/string-aggregation-techniques.php
    2. listagg function in 11g release 2

  • Tables or fm to fetch the data for idoc type WMMBID01

    hi
    i have to create function module in whish i have to fill segments of  idoc type
    WMMBID01.
    is there any fm which can fetch the data for the required fields of segment based on the document no.
    or which tables i can use to fetch the required data for goods issued ie transaction migo.
    regards
    vijay

    HI
    GOOD
    TRY WITH THESE FM
    DYNP_VALUES_READ Read the values from a dynpro. This function can be used to read the values from a report's selection screen too (Another example).
    HELP_START Display help for a field. Useful for doing AT SELECTION SCREEN ON VALUE REQUEST for those fields that do not provide F4 help at the DDIC level.
    RPY_DYNPRO_READ Read dynpro, including screen flow
    RPY_TRANSACTION_READ Given a transaction, return the program and screen or given a program and screen, return the transactions that use the program and screen.
    THANKS
    MRUTYUN

  • Composite Key in Toplink Mapping File - equivalent to Hibernate?

    Hi,
    I have a POJO TestEntity which refers to primary key TestEntityKey. In Hibernate mapping hbm file, we define the entry as:
              <composite-id name="id" class="TestEntityKey">
                   <key-property name ="testEntityCode" column = "TEST_ENT_CODE" type = "string" />
              </composite-id>
    Please confirm how to create the composite id in Toplink means kindly help that how to map my id to key:
    <opm:primary-key>
         <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="TEST_ENTITY_B" name="TEST_ENT_CODE" xsi:type="opm:column"/>
    </opm:primary-key>
    Thanks!

    Hey.. Thanks!
    I am clear about the concept about defining annotation based composite key. Also, I read in the documentation that I'll be needing to define as direct, aggregate or one-to-one. But, I am not able to define and run the same in the project mapping xml of toplink.
    It would be great if you can share some sample code for defining the same. For e.g. in my mentioned example, there is TestEntity POJO having 'id' as the attribute which gets populated with the testEntityCode of the TestEntityKey POJO. Please suggest the same for the same:
    <opm:primary-key>
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="TEST_ENTITY_B" name="TEST_ENT_CODE" xsi:type="opm:column"/>
    </opm:primary-key>
    Thanks!

Maybe you are looking for

  • Error message given... cannot open itunes any more???

    Hi I tried to reinstall itunes but now whenever I try to open or gain access to my itunes library it will not allow me? It gives me a screen where it asks if I want to "reinstall" or "repair" itunes, but whatever one of these options I choose I get a

  • Why is the management of iTunes on the iPhone so coarse and unforgivably hard to navigate?

    Am I alone here? Why is it so difficult for me to manage what files I want to be immediately accessible on my phone, while the rest remain safely on my computer. Why can I not connect my phone to my computer without an immediate syncing of both devic

  • Installing Crystal Report AddOn for 8.8

    Dear All, Please let me know how to install Crystal Report AddOn  for 8.8 B one ? After installing the Addon When I am starting the Add On I am getting as error as External Connection to the database failed. SAP Crystal AddOn may not function properl

  • Program ID Required for RFC Connection

    Hi All, I'm trying to create a RFC Connection betwen SAP BI and SSIS (SQL Server Integration Services). In SM59 screen i'm unable to get the appropriate Program ID required for the connection. Could someone please help me in knowing how to get it.

  • Moving Files from Movies Folder

    I have a lot of home videos on itunes that I categorize as "tv shows" so it's easier for me to find what I'm looking for. To do that I have to add them to the "movies" category then later change the file info for "tv show". However, when I do that th