Calculated fields based on data in multiple rows

Hi,
I am using SOA Suite 11.1.1.4 for BAM.
Can someone please help explain to me if and how we can use calculated fields in BAM data objects where the calculations are not only based on the data for that row, but on multiple rows ?
Like for example, this case can easily be constructed -->
TestDataObject Layout
Column1 integer
Column2 integer
Column3 calculated = Column1 + Column2
But if I want to create something like this -->
TestDataObject Layout
Column1 integer
Column2 integer
Column3 calculated = max(Column1) + avg(Column2)
Is it possible to do the above ?
Is it possible to check multiple rows of the other columns while calculating a value ?
Thanks & Regards,
Karan.
Edited by: user8890668 on Mar 9, 2011 3:58 AM

Hi, Karan.
Do you know you can do that in reports with calculated fields?
I guess it is not possible using calculating functions offered in data objects to do that.
If you, or anybody, discover how do that, please tell us. I would like to know that.
Luciano Gomes
user8890668 wrote:
Hi,
I am using SOA Suite 11.1.1.4 for BAM.
Can someone please help explain to me if and how we can use calculated fields in BAM data objects where the calculations are not only based on the data for that row, but on multiple rows ?
Like for example, this case can easily be constructed -->
TestDataObject Layout
Column1 integer
Column2 integer
Column3 calculated = Column1 + Column2
But if I want to create something like this -->
TestDataObject Layout
Column1 integer
Column2 integer
Column3 calculated = max(Column1) + avg(Column2)
Is it possible to do the above ?
Is it possible to check multiple rows of the other columns while calculating a value ?
Thanks & Regards,
Karan.
Edited by: user8890668 on Mar 9, 2011 3:58 AM

Similar Messages

  • Automatically fill in field based on data from table rows

    hello,
    Users in our organization currently have to complete a number of different forms when an accident occurs. I am creating a .pdf that combines these fomrs into one, with the first portion being a data input section where the user inputs the data and then this populates other sections (pages of the form) that can later be saved and printed.
    The data input section contains subforms with tables. The tables have a row that has "add new item" and "delete this item" buttons.  The rows have dropdown list fields.
    I would like to create a field that will be automatically filled in with the values from the dropdown lists, including the values from the new rows that are added using the 'add new item' button.
    Any assistance in this regard would be most appreciated.  This is my first time on a forum, so I apologize if I have not been clear.
    Thank you.

    This is pretty complicated. You'll have to use scripting for this and I'll tell you how I'd approach this with JavaScript.
    First of all you need to decide at what point you want to populate this field with the drop down selections. I think you have two options.
    Option 1 - Automatically calculate this field each time a user makes a drop-down selection. It's possible that a user will enter data and then change a drop down value so you'll have to account for this.
    Option 2 - Create an update button that users click to calculate this field. There is still a risk that users will change the value in the drop down after clicking update, so you would want to use scripting to lock those fields (e.g. make them protected) when the update button is clicked. You could then change the caption of this same button or have a second button that when clicked would unlock those drop down fields.
    The other thing you need to do is figure out how to calculate this field. It seems to me you would probably build a string together that mixes text with the drop-down values. So your JavaScript would look something like this:
    calculatedField.rawValue = "The accident occurred on " + table.row1.date.rawValue + ". It was witnessed by " + table.row1.witness1.rawValue +
                                                      " and " + table.row1.witness2.rawValue + ".";
    When you're in the LC Designer JavaScript editor, hold control for the relative path to those fields and control + shift for the absolute path and then click on the fields whose values you want to access.
    I hope this points you in the right direction!

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • Procedure to insert data in multiple rows

    Hi,
    I need a stored procedure which inserts data into multiple rows..
    Ex: I need to have 3 columns in Procedure, where col3 has limit in size let's say 500.
    If user insert about 1500 in col3, i has to insert first 500 in row1 and 501 - 1000 in row 2 and 1001 - 1500 in row 3.
    Can any one help in creating procedure for above scenario.
    Thanks in Advance...
    Sree

    create table #t (id int, id1 int)
    WITH [1-20]
    AS
    SELECT row_number() over (order by number) rn,number
            FROM master..spt_values
             WHERE type = 'P'
             AND number BETWEEN 1 AND 20
     [21-30]
    AS
    SELECT row_number() over (order by number) rn,number
            FROM master..spt_values
             WHERE type = 'P'
             AND number BETWEEN 21 AND 30
    ) INSERT INTO #t 
      SELECT A.number,B.number FROM
         [1-20] A JOIN [21-30] B ON A.rn=B.rn
    SELECT * FROM #t
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Dynamically enable a field based on a selected table row

    Hi everyone.
    I'm getting really confused right now, please show me the right way. My approach may be, and probably is, wrong since I am self learning this and all I have is an ASP.NET background.
    I have a page with a table in it. I've created a DataControl for a collection I've made and mapped it to the table. I added a column that shows an "edit" button. On it's click, I open a popup that shows the selected row's data. Naviguation controls are also present on the popup.
    This is working fine.
    My problem comes in the popup. Each row has multiples fields. These fields, shown on the popup, need to dynamically be enable/disable. To toggle those field, the only way I can see right now is to have a function that takes into parameter the rowId and the fieldName. Based on those two fields, I can get the necessary information to know if I need to enable or disable the control.
    What I was aiming for, but then again I totally failed, was to have that function called on the "enabled" EL Expression, returning a Boolean.
    Now that this has been said, can someone guide my on how to dynamically enable/disable each field based on the selected row.
    Thanks !

    Above +
    why don't you create a bean method that returns a Boolean ans through EL Expression Builder select the method to this property.
    btw .. on which components are you setting this?
    Also,
    If there is business logic that prohibits to update this object unless that is met.. you can also do it as..
    In EOImpl .. override isAttributeUpdateable(int i) method eg:
    @Override
    public boolean isAttributeUpdateable(int i) {
    if(i == this.ENAME && "KING".equalsIgnoreCase(this.getEname())){
    return true;
    }else
    return super.isAttributeUpdateable(i);
    and then in UI for the component say
    ReadOnly = #{bindings.Ename.updateable}
    Or, In UI
    disable = #{ bindings.Ename.attributeValue == 'KING' & bindings.Mrg.attributeValue == null ? true : false}
    adf does provides many ways to do it ..
    Cheers, Amit

  • How to manipulate data in multiple rows without using cursor??

    Hi all,
    I have a form in which there is a push button & 4 text fields.
    Push button : Process
    Text fields: Year, Month, Financial_To_Year, Financial_From_Date.
    In database , there are tables like, CUSTOMER_MASTER, FD_ACCOUNT_MASTER, FD_ACCOUNT_DTL, CUSTOMER_YEARLY_INTEREST, etc.
    In table FD_ACCOUNT_MASTER, there are columns, like CUST_CODE, FD_ACCT_NO, FD_AMOUNT, ACCT_OPEN_DT, ACCT_CLOSE_DATE, ACCT_TYPE, INTEREST_RATE, etc.
    There are thousands of records in the table.
    For Push button : Process , TRIGGER: When button pressed,
    I have to do all the process of FD for all the FD_ACCOUNTS at once. Process means i have to calculate Interest for all the accounts, calculate interest monthly, quarterly, yearly and make the FD_Accounts disable after the date of ACCT_CLOSE_DATE is reached, make the accounts renewed , etc all the process.
    But to do this process for multiple rows at once, we use cursor, but i don't want to use cursor as i feel its too tedious to do.
    Is there any other way , where i do process of multiple records at once without using cursor??
    Help me, Thank You.
    Oracle Forms Builder 6i.
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

    An Update statement certainly can update sets of data instead single row updates:
    UPDATE Statement
    if you can't do it in a single statement you can use bulk processing as well:
    PLSQL 101
    cheers

  • RFC XI JDBC to external database.... Get data in multiple rows

    Hi,
    We have been really struggling with this scenario. We have created a RFC that has 1 Import parameter (Order_ID) and table parameter (3 Columns: Order_ID, Partner_type, Partner_no).
    When we call this RFC in SAP, it should make a connection to external database via JDBC and get multiple row data for every Order_ID. We are not using Oracle Stored Procedure, instead we are using simple Select statement. Did all the mapping and configured correctly. However, we are getting short-dump when we execute RFC. When we checked in XI, it says " Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at "
    Has anyone tried getting multiple row information from external database(Oracle) using Select statement in XI ? IF so, can you pl let us know if we need to something different in Mapping ?
    Niranjan

    Niranjan,
    Check this blog of mine to see how the datatype for Synchronous Select should be constructed,
    https://weblogs.sdn.sap.com/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    If this looks good, a few checks
    1. Check the request inbound payload , i.e the RFC request in MONI. Is this as expected?
    2. Check the output of the request mapping and check if this is as expected.
    3. Check the response from JDBC, is this as per the datatype defined.
    4. Check the mapping from JDBC response to RFC response.
    To me this looks like an issue with the JDBC response structure.
    Meanwhile to understand how to test mapping, check blog of michal,
    /people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
    Regards
    Bhavesh

  • Update row in a table based on join on multiple rows in another table

    I am using SQL Server 2005. I have the following update query which is not working as desired.
    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. But the above update query is considering only one row from
    PlantAction table even though there are multiple rows that match with DocID and PlantID.
    DocHistory column is of type NVARCHAR(MAX).
    How do I fix my query to achieve what I want ? Thanks for the help.

    UPDATE DocPlant
    SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
    FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID 
    We do not use the old Sybase UPDATE..FROM.. syntax. Google it and learn how it does not work. We do not use the old Sybase CONVERT() string function. You are still writing 1950's COBOL with string dates instead of temeproal data types. 
    You also did not post DDL, so we have to guess about everything. Does your boss make you work without DDL? How do you do it? 
    >> For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction [singular name?] table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. <<
    Why? What does this new data element mean? This is like dividing Thursday by Red and expecting a reasonable answer. Now, non-SQL programmers who are still writing COBOL will violate the tiered architecture rule about doing display formatting in the database.
    If you will follow forum rules, we can help you. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Spry:repeat display data in multiple rows/columns

    I know how to use spry:repeat to display data in table rows,
    one item per row.
    Is there a way to tell spry to display data in a grid of x
    rows by y columns?
    I'm trying to maximize the page's real estate. Here is the
    page
    http://www.jannah.com/mp3/browse.html
    Click on "Artist/Scholar" in "STEP1" section. "STEP2" section
    gets filled with a list. I'm trying to display that list in 3
    columns and as many rows as needed. How do I do that?
    While I'm at it, I also can't figure out why the spry:select
    is not working for "STEP2" section; I need to click twice on the
    same item to get it highlighted. the other spry selects on the page
    work ok. Can someone take a look.
    Greatly appreciated.

    You can't use Spry with tables to do this, but if you're up
    to using a div based layout/presentation, it is possible. Check out
    the Zuggest sample:
    http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html
    It uses floated divs to get the same effect. The nice thing
    about using divs, is that more columns dynamically appear as the
    horizontal real-estate is expanded.
    --== Kin ==--

  • Collecting data from multiple rows into one column

    I'd like to run a query and put a collection of items into one output column instead of multiple rows. See the example below:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
    PL/SQL Release 10.2.0.5.0 - Production
    "CORE     10.2.0.5.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
         CREATE TABLE "SKIP"."INGREDIENTS"
       (     "INGRED_ID" NUMBER,
         "INGRED_NAME" VARCHAR2(20 BYTE),
         "STORES" VARCHAR2(20 BYTE)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.INGREDIENTS
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (1,'SEA SALT','Food lion');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (2,'TABLE SALT','Food lion');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (3,'FLOUR','Piggly Wiggly');
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (4,'YEAST',null);
    Insert into SKIP.INGREDIENTS (INGRED_ID,INGRED_NAME,STORES) values (5,'BEER','ABC Store');
      CREATE TABLE "SKIP"."PRETZELS"
       (     "PRETZEL_ID" NUMBER,
         "PRETZEL_NAME" VARCHAR2(20 BYTE),
         "PRETZEL_DESC" VARCHAR2(100 BYTE)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.PRETZELS
    Insert into SKIP.PRETZELS (PRETZEL_ID,PRETZEL_NAME,PRETZEL_DESC) values (1,'CLASSIC','Classic knot pretzel');
    Insert into SKIP.PRETZELS (PRETZEL_ID,PRETZEL_NAME,PRETZEL_DESC) values (2,'THICK STICK','Straight pretzel, abt 1/2" in dia');
      CREATE TABLE "SKIP"."INGRED_XREF"
       (     "PRETZEL_ID" NUMBER,
         "INGRED_ID" NUMBER
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;
    REM INSERTING into SKIP.INGRED_XREF
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,1);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,2);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (1,4);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,2);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,3);
    Insert into SKIP.INGRED_XREF (PRETZEL_ID,INGRED_ID) values (2,5);
    --  Constraints for Table INGRED_XREF
      ALTER TABLE "SKIP"."INGRED_XREF" MODIFY ("PRETZEL_ID" NOT NULL ENABLE);
      ALTER TABLE "SKIP"."INGRED_XREF" MODIFY ("INGRED_ID" NOT NULL ENABLE);
    {code}
    Desired output (note how the ingredients are all listed in one column, separated by commas):
    {code}
    PRETZEL_ID PRETZEL_NAME     PRETZEL_DESC                        INGREDIENTS
    1          CLASSIC          Classic knot pretzel                SEA SALT, TABLE SALT, YEAST
    2          THICK STICK      Straight pretzel, abt 1/2" in dia   TABLE_SALT, FLOUR, BEER

    See the FAQ : {message:id=9360005}
    Especially links concerning string aggregation.

  • How to autopopulate a text field with unique data from multiple data sets

    Hi,
    I'm a laboratory manager in charge of a hospital project which will be using pdf forms to send and receive data from our end users across the city. I need help with the last part of our pdf form, specifically with a js that will do a bit of text-field autopopulation magic. This, unfortunately, is a beyond what I have taught myself about pdf js functionality.a
    The problem:
    I need to provide my end users with a text field containing a set of data [A, B, C, D, E, F ...] and the total items in this set [tot#]. The end user needs this information as part of the implementation of this particular laboratory machine.
    The particulars
    When the end user asks for an experiment to be run, we must specify some pieces of data to help them interpret the results. These are constructed as panels which contain discrete data elements.
    For example - One experiment may use two panels, Panel#1 and Panel #2. Panel #1 includes the items A, B, D, E, Panel #2 includes the items A, B, C, F, G.
    Thus, the panels may share some of the same items, but, I only want the unique members to be displayed in the text field. If I make a drop down box or checkboxes with the panels, I want to  be able to select the panels that we ran and (in this example) have the text field display only the unique items among all the panels that were used:
    textfield outpute = A, B, C, D, E, F, G - 7 total.
    Any assistance from the pdf community would be very much appreciated.
    Thanks!

    Thanks for that help.
    I should have made it more apparent that I'm very new to scripting and I'm
    not a programmer by trade. I have a few questions before modifying the code
    you kindly provided.
    1) Where should I embed this script? Within the 'selection change' area of
    my listbox?
    2) Can I replace the term 'arr' with the names of the various items in my
    listbox or should I put 'arr#' as the output value for each term?
    3) Will this script find and display the unique values when a user selects
    multiple items in my listbox?
    4) How does the script know where to output the unique members of the
    combined set?
    I appreciate your patience with me.
    ck

  • Updating data from multiple rows in a table view

    Hello,
    so far in my OAF programming, I have always selected one particular row from a table and saved from it. Now I have a requirement where in my table, fields from more than one row shall have to be updated.
    Can anyone please let me know how to accomplish this.
    Regards
    Hawker

    Hi Prince,
    currently I am selecting one row from the table and rendering a region at the top of the table and capturing the user entered data with the following code:
    ViewObjectVOImpl vo = getViewObjectVO1();
    Row CurrentRow = vo.getCurrentRow();
    //After this I perform the checks like user entered value is not null or check input as per business logic.
    if(CurrentRow.getAttribute("attributeName") ==null){
    //Add what message you want to display
    //Add other business logic.
    After making all the checks, i commit it.
    getOADBTransaction().commit();
    Now in my new page I am capturing the user input in the table itself like an excel sheet. Suppose there are ten rows in my advanced table on my page, and each row has one editable field. I have one save button at the bottom of the table.
    Now on clicking the save button I have to capture the user input, check whether there is any null value and if all the entered data is correct then only I should commit it.
    Can you please let me know how we can accomplish that.
    Regards
    Hawker

  • Displaying calculated field only when data exist

    Hello,
    Is there a way to display my calculated value only when the data entry field is being used. For instance, if I have several fields vertically aligned, I don't want to display a bunch of zeros if their data fields are not being used.
    THANK YOU!!!!

    You can check for the rawValue in the Calculate event before any script.
    Event: Calculate
    //FormCalc
       if(Field1.rawValue ne null) then
         // write your script here
       endif
    //JavaScript
    if(this.rawValue != null){
       // write your script here
    Thanks
    Srini

  • Fetch Multiple row in repor to insert data with multiple rows .

    Hi Friends
    i want to Insert emp attendance .
    There are 10 emp in company .they enter there arival time in attendance register .
    i have two item
    1--p1_att_date
    2--p1_status
    ATTEN_STATUS are PRESENT by default in selectlist .
    i want, when i enter date in p1_att_date item and Press submit then generate a report with 10 employee and insert in_time in report and when press enter then data with 10 emp should insert in to table ABC .
    i don't want to use tabularform for this .actully i don't want to use ADD_ROW option to ADD attendance for second emp.so please give me some solution.
    Emp_ID     ATTEN_DATE     ATTEN_STATUS      IN_TIME     OUT_TIME
    101     22-JAN-2009     PRESENT          
    102     22-JAN-2009     PRESENT          
    103     22-JAN-2009     PRESENT          
    104     22-JAN-2009     PRESENT          
    105     22-JAN-2009     PRESENT          
    106     22-JAN-2009     PRESENT          
    107     22-JAN-2009     PRESENT          
    108     22-JAN-2009     PRESENT          
    109     22-JAN-2009     PRESENT          
    110     22-JAN-2009     PRESENT     
    My table is :-
    table Name --ABC
    emp_id number;
    atten_date date;
    atten_status varchar2(12);
    in_time timestemp;
    out_time timestemp;
    How can i do this.
    Thanks
    Manoj

    Hi Manoj,
    You can create multiple records easily using a single, simple, form. However, you would surely have to enter in the times individually using a tabular form (otherwise, you would have to use the same form 10 times). You do not have to keep the Add Row option on the page - this functionality can be removed.
    Andy

  • Create a view to shows data from multiple rows in a single column

    Hi all - this is probably posted in the wrong forum but I couldn't find which was the correct one.
    I am almost a complete novice at sql but I have a need to create a view which can be developed at 10g (which runs efficiently as the volumes are likely to be high) which will do the following.
    Original table with columns Parent_code, Child_code
    Parent_Code Child_Code
    1000 2000
    1000 3000
    1000 4000
    2000 3000
    2000 5000
    (note Parents can have multiple children and a child can have multiple parents!)
    What I need to end up with in my view is the following
    Child_Code Parent_List
    2000 '1000 (3)'
    3000 '1000 (3), 2000 (2)'
    4000 '1000 (3)'
    5000 '2000 (2)'
    Note the number in parantheses is the number of children that the parent has - ie in the original table parent 1000 has 3 rows (one for each child)
    This view is then to be used as a look up (on child code) for a business objects report.
    Is there anyone who could PLEASE, PLEASE help me fairly quickly on this as I have very little time to find a solution?

    Hi,
    You can test these ones :
    select child_code
         , ltrim(sys_connect_by_path(parent_info,', '), ', ') as parent_list
    from (
      select child_code
           , to_char(parent_code) ||
             ' (' ||
             count(*) over(partition by parent_code) ||
             ')' as parent_info
           , row_number() over(partition by child_code order by parent_code) rn
      from your_table
    where connect_by_isleaf = 1
    connect by prior rn = rn-1
           and prior child_code = child_code
    start with rn = 1
    select child_code,
           rtrim(
             extract(
               xmlagg(xmlelement("e",parent_info||', ') order by parent_info)
             , '//text()'
           ) as parent_list
    from (
      select child_code,
             to_char(parent_code) ||
             ' (' ||
             count(*) over(partition by parent_code) ||
             ')' as parent_info
      from your_table
    group by child_code
    ;What you need is called "string aggregation".
    See here for various techniques, including the two above : http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

Maybe you are looking for

  • IDVD 6 Burn Problem , still

    Still having trouble. I have been trying to burn a 2 hour 20 minute DVD for three weeks. I have tried in iDVD 5 , where the progress bar would get to an 1/8 of an inch from the end and it would stop responding, with no success and now trying iDVD 6 t

  • [SOLVED] CTRL+ALT+F? don't working

    I don't know when it stopped to work, but today I needed use CTRL+ALT+F? to log in text mode, and it does not work. I don't know where I need start my investigation. System updated every day (and today too). Thanks for any help. Last edited by mkanad

  • SQL query for formatted search

    Hi guys and expertise, I have this one problem where i need to do the formatted search,below is my example query that i  have done declare @itemcode varchar (20) set @itemcode = (select x.itemcode from OITM x where x.ItemCode=[%]) declare @itmgrp var

  • My wi-fi button greyd out after iOS 6.1 update. Any sugestions to solve this problem?

    My wi-fi button greyd out after iOS 6.1 update. Any sugestions to solve this problem?

  • Content Aware not always working?

    What are the specifications for how to make content aware work?  Sometimes I delete something and it asks for content aware, but other times it just deletes it.  Do you know what's up? -TitanVex