Display results in one row

Query below is returning data in multiple rows, I want to display them as one row:
select
event_id,
data_type_cd,
quantity
from Event,Data_types
where event_id = 1234
and event.DATA_TYPE_ID = data_types.DATA_TYPE_ID
(I want to display data_type_cd concatenated with quantity as every code had different quantity)

  > Sample data is:
  > Data_type_id Quantity
  > ------------------ ----------
  > 1 34
  > 2 67
  > 15 35
  > 20 23
  > I want to display as:
  > 1 34 2 67 15 35 20 23
if you want all the rows in one column see this given example below:
  SQL> select t.*
    2    from (select  1 data_type_id, 34 quantity from dual union all
    3          select  2 data_type_id, 67 quantity from dual union all
    4          select 15 data_type_id, 35 quantity from dual union all
    5          select 20 data_type_id, 23 quantity from dual) t;
  DATA_TYPE_ID   QUANTITY
             1         34
             2         67
            15         35
            20         23
  SQL> select substr(sys_xmlagg(xmlelement(col, ' ' || data_type_id||' '||quantity)).extract('/ROWSET/COL/text()').getclobval(), 2) new_disp
    2    from (select  1 data_type_id, 34 quantity from dual union all
    3          select  2 data_type_id, 67 quantity from dual union all
    4          select 15 data_type_id, 35 quantity from dual union all
    5          select 20 data_type_id, 23 quantity from dual) t;
  NEW_DISP
  1 34 2 67 15 35 20 23
  SQL>

Similar Messages

  • Displaying records in one row??

    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34I had written a query(splitting KBIM code data & PBIM code data which actually brought back results as seen below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     NULL     NULL
    NULL     NULL     Y     B1234I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234

    Hi,
    francislazaro wrote:
    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34...
    I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234
    So you don't want anything in the results about userrecordids 'm002' and 'm003', because they do not have both board_codes 'KBIM' and 'PBIM', is that it?
    One way to get those results is a self-join, as if all the rows with borad_code 'KBIM' were in one table, and all the rows with borad_code 'PBIM' were in another:
    SELECT     'Y'          AS "KBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    ,     'Y'          AS "PBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    FROM     boards     k
    JOIN     boards     p     ON     k.userrecordid     = p.usrrecordid
    WHERE     k.board_codes     = 'KBIM'
    AND     p.board_codes     = 'PBIM'
    ;Another way is a GROUP BY, like Mpautom suggested.
    If your requirements change in the future, so that you need to include all rows, even if they don't have both board_codes, then you could change the JOIN to a FULL OUTER JOIN and make what I wrote as the WHERE clause part of the join condition, but I suspect the GROUP BY approach would be more efficient in that case.

  • PUT QUERY RESULT ON ONE ROW INSTEAD OF MULTIPLE ONE

    Hi
    I have two tables with the column id_table1 to join them.
    My first table "table_one" contain 3 fields and one record.
    id_table1 : 1
    table1 : project1
    date_project : 2005/08/01
    My second table "table_two" contain 3 fileds and 3 records which contain the id 1 on the join column.
    id_table2 : 1
    table2 : pdf
    id_table1 : 1
    id_table2 : 2
    table2 : excel
    id_table1 : 1
    id_table2 : 3
    table2 : text
    id_table1 : 1
    If i did a simply join, the result is appear in 3 lines:
    1 project1 2005/08/01 excel
    1 project1 2005/08/01 pdf
    1 project1 2005/08/01 text
    Is this possible to have this result in one query :
    1 project1 2005/08/01 excel pdf text
    I mean to have the result in one row and a separated column for each item of the table2.
    We know how to do it with one column concatened ("excel pdf text") but not with separated column
    ("excel" "pdf" "text")
    Thanks if someone has a solution.
    Alexandre

    SQL> select e.job, d.dname from emp e, dept d where e.deptno = d.deptno;
    JOB       DNAME
    CLERK     RESEARCH
    SALESMAN  SALES
    SALESMAN  SALES
    MANAGER   RESEARCH
    SALESMAN  SALES
    MANAGER   SALES
    MANAGER   ACCOUNTING
    ANALYST   RESEARCH
    PRESIDENT ACCOUNTING
    SALESMAN  SALES
    CLERK     RESEARCH
    CLERK     SALES
    ANALYST   RESEARCH
    CLERK     ACCOUNTING
    14 rows selected.
    SQL> select e.job,
      2  max(decode(d.dname,'RESEARCH',d.dname,null)) "Research",
      3  max(decode(d.dname,'SALES',d.dname, null)) "Sales",
      4  max(decode(d.dname,'ACCOUNTING',d.dname,null)) "Accounting"
      5  from emp e, dept d where e.deptno = d.deptno
      6  group by job
      7  /
    JOB       Research       Sales          Accounting
    ANALYST   RESEARCH
    CLERK     RESEARCH       SALES          ACCOUNTING
    MANAGER   RESEARCH       SALES          ACCOUNTING
    PRESIDENT                               ACCOUNTING
    SALESMAN                 SALESRgds.

  • Combining like results into one row

    The statement below works. However when the results are returned there are multiple values returned for the same "Period" that I would like to see returned into one row.
    SELECT "Request ID", "External Customer", "Staff Prof Id", "Period", "Planned External", "Actual External", "Planned Internal", "Actual Internal", "Total Planned", "Actual Total"
    FROM (
    SELECT ppl.request_id "Request ID", ppl.mdpr_bds_ext_customer "External Customer", cells.staff_prof_id "Staff Prof Id", period.period_short_name "Period", CELLS.PLANNED_FTE/100 "Planned External", CELLS.actual_fte/100 "Actual External", 0 "Planned Internal", 0 "Actual Internal", /*skills.skill_name,*/ total.plan_total_fte/100 "Total Planned", total.actual_total_fte/100 "Actual Total"
    FROM RML.MREQ_MDPR_PROJ PPL, knta.krsc_staff_prof_line_cells_v CELLS, knta.krsc_staff_prof_lines_v LINES, knta.knta_periods PERIOD, knta.krsc_skills_v SKILLS, knta.krsc_staff_prof_period_sum TOTAL
    where PPL.MDPR_BDS_SUB_PROJ IS NOT NULL AND PPL.KNTA_STAFFING_PROFILE = CELLS.STAFF_PROF_ID(+) AND cells.staff_prof_line_id = lines.staff_prof_line_id AND ppl.knta_staffing_profile = total.staff_prof_id
    AND cells.period_id = period.period_id AND lines.skill_id = skills.skill_id AND skills.skill_name like '%External%' AND total.period_id = period.period_id
    UNION
    SELECT ppl.request_id "Request ID", ppl.mdpr_bds_ext_customer "External Customer", cells2.staff_prof_id "Staff Prof Id", period.period_short_name "Period", 0 "Planned External", 0 "Actual External", CELLS2.planned_fte/100 "Planned Internal", CELLS2.actual_fte/100 "Actual Internal", /*skills.skill_name,*/ total.plan_total_fte/100 "Total Planned", total.actual_total_fte/100 "Actual Total"
    FROM RML.MREQ_MDPR_PROJ PPL, knta.krsc_staff_prof_line_cells_v CELLS2, knta.krsc_staff_prof_lines_v LINES, knta.knta_periods PERIOD, knta.krsc_skills_v SKILLS, knta.krsc_staff_prof_period_sum TOTAL
    where PPL.MDPR_BDS_SUB_PROJ IS NOT NULL AND PPL.KNTA_STAFFING_PROFILE = CELLS2.STAFF_PROF_ID(+) AND cells2.staff_prof_line_id = lines.staff_prof_line_id AND ppl.knta_staffing_profile = total.staff_prof_id
    AND cells2.period_id = period.period_id AND lines.skill_id = skills.skill_id AND skills.skill_name not like '%External%' AND total.period_id = period.period_id)
    ORDER BY "Request ID"

    Probably you are looking at something like GROUP BY "Request ID", "External Customer", "Staff Prof Id", "Period" and SUM () the other columns. As Enrico says, examples of actual and desired output would be helpful.
    At a glance a UNION of...
    AND    skills.skill_name LIKE '%External%'...and...
    AND    skills.skill_name NOT LIKE '%External%'...seems a slightly strange approach.

  • Display Ids in one row

    Hi I need to avoid extracting the Ids multiple times. That is display first Id for the receipt_no as Primary Id and display the next ocurring ones as associate Ids in one line. There could be more than one associate Ids with one receipt. Any help appreciated.
    Sample Query as below:
    SELECT DISTINCT gift_id,receipt, asssociate_donor_id, associate_donor
    from g2
    LEFT OUTER JOIN (SELECT DISTINCT gift_id asssociate_donor_id
    ,receipt_number
    ,e2.name AS associate_donor
    FROM X
    JOIN advance.entity e2 ON (e2.id_number = gift_donor_id)
    WHERE
    AND receipt_date >=
    to_date('01/01/2000'
    ,'dd/mm/yyyy')) g4 ON (g2.gift_id !=
    asssociate_donor_id AND
    g2.receipt =
    g4.receipt_number )
    Sample table
    Id     receipt_no     cash
    1     101          $100
    2     101          $100
    3     102          100
    Sample Expected Result:
    1, 101, 2, Mark
    3, 102
    Many Thanks

    You didn't really provide enough data to arrive at your expected output, so I took the liberty of creating some. If my data do not match yours, perhaps you'll provide yours and we can give you a better answer....
    WITH receipts AS
               ( SELECT 1 gift_id, 101 receipt_id, 201 gift_donor_id, 100 amt FROM DUAL
       UNION ALL SELECT 2, 101, 202, 100 FROM DUAL
       UNION ALL SELECT 3, 102, 203, 100 FROM DUAL )
      , donors AS ( SELECT 201 AS donor_id, 'Matthew' donor_name FROM DUAL
          UNION ALL SELECT 202, 'Mark' FROM DUAL
          UNION ALL SELECT 203, 'Luke' FROM DUAL)
    , g2 AS ( SELECT receipts.*, row_number() OVER ( PARTITION BY receipt_id ORDER BY gift_id ) gift_ordering
              FROM receipts )
    , donations as ( SELECT gift_id, receipt_id
                     FROM g2
                     WHERE gift_ordering = 1 )
    , assocs AS ( SELECT receipt_id , donor_name , COUNT(*) assoc_cnt
                     FROM g2 JOIN donors ON ( gift_donor_id = donor_id )
                     WHERE gift_ordering > 1
                     GROUP BY receipt_id , donor_name)
    SELECT donations.gift_id
         , donations.receipt_id
         , assocs.assoc_cnt + 1 total_donors_on_receipt
         /* will be NULL if only one donor */
         , assocs.donor_name
    FROM donations
      LEFT JOIN assocs ON ( donations.receipt_id  = assocs.receipt_id )And the output...
       GIFT_ID RECEIPT_ID TOTAL_DONORS_ON_RECEIPT DONOR_N
             1        101                       2 Mark
             3        102
    2 rows selected.I hope this helps, or at least points you in the right direction.

  • How can I DISPLAY MORE THAN ONE ROW OF PHOTOS WHEN CREATING A BOOK?

    Can I display more than A SINGLE ROW of ohotos on the right side of the page when I am creating a photo book? I have 500 pics and this single bar is ridiculous.

    Command (right) - click on a photo in the Photo tray and select Small Photo from the contextual menu:
    This will give you two columns of photos.
    To reduce the number of photos to select from one can select only Unplaced Photos to be displayed in the tray.
    Happy Holidays

  • Displaying data in one row for  for 2 tables without relaiton

    I Have 2 tables without any relation and there is a common field and i want to display data like below
    table refdet
    1)
    refdt----------refbr----refamt----refcat
    10-aug-09---10-----34234-----101a
    10-aug-009--11----23245-----102a
    1-AUG-09----10----455.98----104A
    19-aug-09-12-----10000-------103B
    2) brdet
    trdt---------brn-----brtot-----------brcat
    11-aug09--10-----454000-------A
    09-aug-09-12-----550000-------B
    30-sep-09--10-----430000------A
    09-aug-09-11-----550000-------B
    i want to display data for each branch refdet.refbr = brdet.brn
    refdet
    Br10
    refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
    10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
    1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
    Br 11
    10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
    Br12
    19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------B
    i tried the following query but its not working
    select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
    from brdet a,refdet b
    where a.refbr (+) = b.brn
    union all
    select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
    from brdet a,refdet b
    where a.refbr = b.brn (+)
    its not giving the records on each row for both side its creating separte rows for each records in both table.
    rgds
    jytohi
    -

    Hi jytohi,
    Please lean back for a moment and study your question. Ask yourself, is this a reasonable way to ask a question?
    Jopefully you'll reach the answer, "No it isn't, I need to.."
    1. Turn these
    1)
    refdt----------refbr----refamt----refcat
    2) brdet
    trdt---------brn-----brtot-----------brcatinto CREATE TABLE statements.
    2. Turn these
    10-aug-09---10-----34234-----101a
    10-aug-009--11----23245-----102a
    1-AUG-09----10----455.98----104A
    19-aug-09-12-----10000-------103B
    11-aug09--10-----454000-------A
    09-aug-09-12-----550000-------B
    30-sep-09--10-----430000------A
    09-aug-09-11-----550000-------Binto INSERT INTO statements
    3. Turn this
    refdet
    Br10
    refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
    10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
    1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
    Br 11
    10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
    Br12
    19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------Binto properly formatted expected output, along with a reasonable explanation of why
    4. Turn this
    select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
    from brdet a,refdet b
    where a.refbr (+) = b.brn
    union all
    select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
    from brdet a,refdet b
    where a.refbr = b.brn (+)into a properly formatted query
    And last, put everything in into curly brackets {noformat}{noformat} to preserve formatting and blank space.
    Best regards
    Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problems with splitting result into different rows. Group by-issue?

    Hi all!
    I have a table that looks a bit like this:
    Pallet          Status          Number          Time
    A          MoveIn          48          11:11
    A          Pick          -1          11:11
    A          Pick          -1          11:12
    A          Pick          -1          11:12
    A          MoveOut     45          11:13
    A          MoveIn          45          18:20
    A          Pick          -1          18:23
    A          Pick          -1          18:23
    A          Pick          -1          18:23
    A          Pick          -1          18:24
    A          MoveOut     41          18:25
    A          MoveIn          41          21:31
    A          Pick          -1          21:55
    .....This is logging pallets that is moved to one station and then number of boxes are picked off. (For making it more simple, I only show one pallet in above example.)
    I would like to present the result with one row for each time the pallet have been at the station, like:
    Pallet          Picked          Time
    A          3          11:11
    A          5          18:20
    A          ....          .....This means that the same pallet might be showned on several rows, as it has been to the station several times. I have tried several different "GROUP BY" but I cannot make it work.
    For example I have tried to group by hour, but this fails if a pallet is moved twice per hour or if boxes are picket at different hours (eg, first box picked 09:59, last box 10:01)
    Does anyone have a suggestion how to solve this?
    Thanks in advance and Kind regards / Anders from Sweden

    Hej, Anders,
    Can you explain what defines a group?
    It looks like you're saying that a group is a sub-set of a pallet. If we arrange all the rows for a pallet in order by time, then a new group will start every time we have a row where status='MoveIn'. That is, a group consists of a row with status='MoveIn', and all the rows immediately following it, in order by time, up to, but not including, the next row with status=-'MoveIn'. Is that right?
    If so, you can use the analytic COUNT (or SUM) function to find out how many rows with status='MoveIn' have already occurred, in order by time, like this:
    WITH     got_grp          AS
         SELECT     pallet, status, time
         ,     COUNT ( CASE
                             WHEN  status = 'MoveIn'
                       THEN  1
                         END
                    ) OVER ( PARTITION BY  pallet
                                ORDER BY          time
                        )           AS grp
         FROM    table_x
    SELECT       pallet
    ,       COUNT ( CASE
                      WHEN  status = 'Pick'
                    THEN  1
                  END
                )          AS picked
    ,       MIN (time)          AS start_time
    FROM       got_grp
    GROUP BY  pallet
    ,            grp
    ORDER BY  pallet
    ,            grp
    ;If you'd care to post CREATE TABLE and INSERT statements for your sample data, then I could test this.
    This assumes that the combination (pallet, time) is unique. Your sample data includes:
    Pallet          Status          Number          Time
    A          MoveIn          48          11:11
    A          Pick          -1          11:11I assume that you're just not displaying the full time, and your data is really something like:
    Pallet          Status          Number          Time
    A          MoveIn          48          23-Sep-2011 11:11:01
    A          Pick          -1          23-Sep-2011 11:11:08Otherwise, how do you know if these two rows are in te same group or not? You may need to add a tie-breaker to the analytic ORDER BY clause. For example, if you say "ORDER BY time, *status* ", then, if the two rows above really did have exactly the same time, down to the second, then the one with status='MoveIn' would be considered to be earlier than the row with status='Pick'.

  • Display results seperated by comma's

    Hi
    Just wondering if there was a way to display results from seperate rows in one text box where the results are seperated by comma's?
    =First(Fields!ClientId.Value, "DataSet1")
    The example above will just show one ClientId however I would like to list all of them all like below
    C001,C002,C546,F546,H232
    Am I after Lookup/LookupSet?
    Any help appreciated.
    Cheers
    Cheers Chris

    One method is to create a hidden parameter ,make it allow Multiple values and set its default value to be same as dataset field value. Then you can simply use
    =Join(Parameters!ParameterName.value,",")
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Displaying more than one column in TreeControl

    Hi,
    I have three tables ( LaborOperation, LaborIndex, LaborData). In TreeControl, i am displaying the following table columns,
    LaborOperation ->operationid,
    LaborIndex -> indexid,
    LaborData -> date, value.
    i want to be like this.
    + Operation Id(Single Column)
    + OperationIndex(Single Column)
    -OperationData(Multiple Column)
    I can able to display single column values in tree control by setting the nodedifinition property in tree control. i can't able to display more than one column in tree control.
    any idea about this problem
    thanks in advance.
    -Nainar

    Arun Prasath wrote:
    I want to display more than one row in a multiple columns of a single row.
    For example,
    In oracle apps, there are multiple tax lines for a single invoice. Each tax lines having their own entry in tax detail table.
    When i try to display a single invoice's details in a single row i found the difficulty.Hmm did you see the title of the forum? Oracle Database » General Questions !
    May be you want to check the Oracle Apps forum?
    Aman....

  • How to pivot horizontally Author names, and group by Book title. One row per book with multiple authors

    I have 3 tables - Book, Author, BookAuthorReference
    A book can have multiple authors, and when I do straight query I get multiple rows per book
    SELECT <columns>
    FROM Book b, Author a, BookAuthorReference ba
    where ba.BookId = b.BookId and
    ba.AuthorId = a.AuthorId
    I want to get the results as ONE row per book, and Authors separated by commas, like:
    SQL 2008 internals book    Paul Randal, Kimberly Tripp, Jonathan K, Joe Sack...something like this
    Thank you in advance

    This can by done by straying into XML land. The syntax is anything but intuitive, but it works. And moreover, it is guaranteed to work.
    SELECT b.Title, substring(a.Authors, 1, len(a.Authors) - 1) AS Authors
    FROM   Books b
    CROSS  APPLY (SELECT a.Author + ','
                  FROM   BookAuthorReference ba
                  JOIN   Authors a ON a.AuthorID = ba.AuthorID
                  WHERE  ba.BookID = a.BookID
                  ORDER  BY ba.AuthorNo
                  FOR XML PATH('')) AS a(Authors)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • FM K_LINE_ITEM_ACT_DATA_GET doesn not display result

    HI Guys,
    FM K_LINE_ITEM_ACT_DATA_GET doesn't display result for one of my user. Instead of having to debug standard function , have anybody experienced this before and can tell if user might miss authorization ?  please advice ...

    ee

  • How I can display the values in one row when they come from the same colum

    This query
    SELECT
    sorints_ints_code
    FROM
    saturn.sorints a,
    connman.cc_adm_prospect_master
    WHERE
    sorints_ints_code like 'Z%'
    and sorints_pidm = prospect_pidm
    give me the results of
    ZA
    ZB
    ZC
    I want to use this query in a cursor to update a column in another table, the problem is that I need to update the table concatenating the values ZA,ZB,ZC
    I have 24 different codes stored in the column sorints_ints_code, so I don’t want to use 24 different cursors and I don’t to use cross reference, It is there any way that I DON’T know to display the data like this za,zb,zc without using cross reference, I don’t want to use the table 24 times…
    Like THIS, this is only for two values…
    SELECT
    a.sorints_ints_code,
    b. sorints_ints_code
    FROM
    saturn.sorints a,
    saturn.sorints b
    connman.cc_adm_prospect_master
    WHERE
    a.sorints_ints_code = ‘ZA’
    AND a.sorints_ints_code = ‘ZB’
    and a.sorints_pidm = prospect_pidm
    and b.sorints_pidm = prospect_pidm
    REMEMBER, I have 24 different values
    I am trying to write a procedure like this;
    Someone suggest this v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
    BUT IT IS NOT WORKING!!!
    PROCEDURE prospect_coach_interest_upd
    p_prospect_term_code IN srbrecr.srbrecr_term_code%TYPE,
    p_prospect_admin_err_code OUT VARCHAR2,
    p_ora_err_code OUT NUMBER,
    p_ora_err_msg OUT VARCHAR2
    ) IS
    v_out_path VARCHAR2(40) := '/home/connman/student';
    v_out_file VARCHAR2(40) := 'cc_adm_prospect_'||p_prospect_term_code||'_'||TO_CHAR(SYSDATE,'YYYYMMDDHH');
    v_file_handle UTL_FILE.FILE_TYPE;
    v_pidm NUMBER;
    v_int_code1 varchar2(30);
    v_int_code2 varchar2(2);
    v_int_code3 varchar2(2);
    CURSOR cur_pidms IS
    SELECT prospect_pidm
    FROM connman.cc_adm_prospect_master
    WHERE prospect_term_code = p_prospect_term_code
    FOR UPDATE;
    CURSOR interest_coach_cur is
    SELECT
    sorints_ints_code
    FROM
    saturn.sorints
    WHERE
    sorints_ints_code like 'Z%'
    and sorints_pidm = v_pidm ;
    interest_coach_rec interest_coach_cur%ROWTYPE;
    BEGIN
    UTL_FILE.FCLOSE_ALL;
    v_file_handle := UTL_FILE.FOPEN (v_out_path, v_out_file, 'a');
    UTL_FILE.PUT_LINE (v_file_handle,
    CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS')
    UTL_FILE.PUT_LINE (v_file_handle, 'Entering the Admin Name procedure.');
    --- BEGIN
    FOR rec_pidms IN cur_pidms
    LOOP
    EXIT WHEN cur_pidms%NOTFOUND;
    v_pidm := rec_pidms.PROSPECT_pidm;
    v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
    IF interest_coach_cur%ISOPEN
    THEN
    CLOSE interest_coach_cur;
    END IF;
    OPEN interest_coach_cur;
    FETCH interest_coach_cur
    INTO interest_coach_rec;
    IF interest_coach_cur%FOUND
    THEN
    UPDATE
    connman.cc_adm_prospect_master
    SET
    PROSPECT_COACH_INTEREST = interest_coach_rec.sorints_ints_code
    WHERE CURRENT OF cur_pidms;
    END IF;
    END LOOP;
    COMMIT;
    p_prospect_admin_err_code := '0';
    UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
    EXCEPTION
    WHEN OTHERS
    THEN
    p_prospect_admin_err_code := '1';
    p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
    p_ora_err_code := SQLCODE;
    END; -- prospect_coach_interest_upd;

    Search in the forum or web you will find many solutions
    Return multi-row result as one comma-delimited row
    http://www.oracle-developer.net/display.php?id=412

  • How to read the row of resulted table one by one

    Hi,
    My query is displaying n no of rows in resulted table.Is there any way to read the row one by one and pass the value of attribute in other variable.
    If anybody knows then please let me know.
    thanks
    Divya

    hi
    read the VO using RowSetIterator
    OAViewObject reqLinesVO = (OAViewObject)am.findViewObject("VO");
    if(reqLinesVO!=null)
    int fetchedRowCount = reqLinesVO.getFetchedRowCount();
    RowSetIterator reqLinesIter = reqLinesVO.createRowSetIterator("reqLinesIter");
    if (fetchedRowCount > 0)
    reqLinesIter.setRangeStart(0);
    reqLinesIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    OARow row = (OARow)reqLinesIter.getRowAtRangeIndex(i);
    String getattr=(String) row.getAttribute("Attribute14");
    // Always close the iterator when you're done.
    reqLinesIter.closeRowSetIterator();
    thanx
    Pratap

  • Display array data in one row

    Hello ---
    I have an array of data, I would like to be displayed all the data in one row.<tr></tr>, how to do this?
    If I use <h:table> <column></column></h:table>, it will display different rows.
    Thanks!
    Ben

    Populate the components in the backingbean. Try something like:
    JSF<h:panelGrid binding="#{myBean.grid}" />MyBeanprivate List arrayOfData;
    private HtmlPanelGrid grid; // + getter + setter
    private void populateGrid() {
        grid = new HtmlPanelGrid();
        grid.setColumns(arrayOfData.size());
        for (Iterator iter = arrayOfData.iterator(); iter.hasNext();) {
            Object value = iter.next();
            HtmlOutputText text  = new HtmlOutputText();
            text.setValue(value);
            grid.getChildren.add(text);
    }

Maybe you are looking for

  • PDF forms populating Access DB and vice/versa

    I have a PDF from that I published to Acrobat.com There are fields to be filled out. Problems: 1. How can I set the fields to populate into an existing MS Access DB once submitted results back to me? 2. How can the form populate upon a certain chouic

  • IDVD 7.1.2 in OSX 10.8.5 Cannot get to finish burning DVD

    I tried two different slideshow templates in iDVD thinking that I had chosen a newer template causing my problem. I know I burned a DVD slideshow successfully last year on my computer and with my current operating system and current iDVD version. But

  • Parameter Files Error

    Hi everybody, I am working with Oracle BI Apps, and I use Informatica as ETL tool and DAC(Datawarehouse Administration Console) as a manager of Informatica. In DAC I have execution plans that execute informatica workflows. My problem is next: I have

  • Af:tree with command link

    hi experts, am using jdeveloper 11g version 11.1.1.5.0 - adfbc components - oracle db 10g. am trying some examples regards, af:tree with commandLink, here what i did: i achieved the af:tree with the help of some association between two tables and the

  • MacBook with OS X and remote desktop to Windows server

    I am curious if an apple MacBook running OS X 10.4 can be used as a remote desk top to access a Windows 2000 server. It is easy to do so with a Windows PC with Windows XP. However this necessitates carrying a Windows machine while travelling. I like