Query multiple rows

Hi, need some help on XML and XSD.
say I have a table in the database with 3 columns: a, b, c
on my XDP form, I have a table, like a spreadsheet, with 3 columns too: x, y, z
and it has 10 rows.
I want to pre-fill the form with 10 rows of data,
so, in my Process's action profile,
I use JDBC's query multiple rows to get the first 10 records of my database table.
how do I put these 10 rows of data into the table on my form?
TIA for helping me.
Happy New Year!

Step1: Use SQL Query Multiple results as XML activity
Step2: Define the output of SQL activity to look similar to
<table>
    <row>row1 value</row>
    <row>row2 value</row>
    <row>row3 value</row>
    <row>row4 value</row>
    <row>row5 value</row>
    <row>row6 value</row>
    <row>row7 value</row>
    <row>row8 value</row>
    <row>row9 value</row>
    <row>row10 value</row>
</table>
Step3: arrange your forms fields (Table and rows) in the same way as mentioned above.
Nith

Similar Messages

  • Query for Multiple Rows as XML

    Ok I've seen this topic in the forums, but have failed to get this to work within my process. Basically I have a process that has a user fill out a form, and upon submittal the form writes it's information to a database (via a data connection within the form that invokes a separate process upon submittal.), once this is done the main process is invoked and it's first step is to query that same database and bring back the data in a lower (now exposed) portion of the form that contains certain fields that track the issue history. The query brings back the xml document and I store it in an xml variable (xml_output). I then take this information and use the Set Value object to assign the returned nodes values to the location fields in the form. This works if the query returns only one row. But once the form is moved beyond the initial Task Assignment, (first user), and query returns more than just one row, the added nodes to not show up on the form, i.e I still just get information about the first row in my form. From what I've read the form should be able to recognize the xpath expression, and bring back all the nodes, by in a sense using instance manager to create an instance for each node on the form. My question is how can I get this to work. Jasmin if your still out there... Help!
    Also We're using Adobe LiveCycle ES 8.0
    created the process using Workbench
    the form was reader enabled and saved as a dynamic PDF.
    Thanks
    Mike

    Ok have done the binding of the schema to the form, and I'm getting the information to flow as it's supposed to.  The problem I'm having now, (I know I'm having a bunch.) is that once I've placed the form into my process, and I use the set value operation to pre-fill information I get the form to flow, but the rest of the information that was previously filled in is blank.  So I have checked the variable and nothing wrong there.  It appears the problem is how I'm using the set value operation.  If I don't use the set value operation, the form retains it's information.  And if I use the set value by trying to set the subform value, the form retains it's information, but no pre-fill.  I'm going to try to be a little more detailed here.  The xml that is returned looks like this:
            0016-03-30
            Mike
            Public Works
            alone in the dark
            Type sleep
            -1
            Council
            FYI
            Important
    Flowed and positioned are actual subforms on the form that have their properties set as their names indicates.  The entire path is /form1/Page1/flowed/positioned .  The way I was able to get the form to flow correctly upon the injection of this xml data, was to bind the subforms in the form in this manner, positioned[*].  Designer didn't place the [*] for me so I had to do this myself.  But once I previewed the document, the form pre-populated and created the necessary number of subforms and placed information into the fields correctly.
    Now on the process side, I have created an xfaform variable that stores the form (bound to xsd.)  information, and another xml variable that stores the query return that looks like the xml listed above (has an xsd associated with it for navigating xpath).  My first operation performs the query (JDBC- Query Multiple Rows as XML) and stores it into the xml variable.  The next step of the process is the Set Value operation which is supposed to inject the xml data retrieved from the query into the form.  Initially I tried the an xpath similar to the following:
    /process_data/object/data/form1/page1/flowed/positioned = /xml_data/flowed/positioned.
    No dice.  On this one the form retains the information filled out by the user (didn't explain this earlier, the form is filled out first, and upon submittal the process starts.), but doesn't pre-populate the bottom part of the form.  Next I tried the following xpath:
    /process_data/object/data/form1/page1/flowed = /xml_data/flowed/positioned.
    This time it retained the form information which was filed in by the user, but the bottom part is becomes hidden!  Didn't understand this.  But I started to kinda think that I had to navigate he xpath in order to correctly inject the xml into the form.  That being said my next attempt was:
    /process_data/object/data/form1/page1 = /xml_data
    My thinking was that if on location, I stop at page1, the xml in the variable will allow it to navigate correctly through the form.  Well it worked, but too well.  The top part of the form is blank, but the bottom portion is pre-populated correctly.  Now I'm stuck.  Not sure how to get the rest of the information in the form.  I thought about creating variables form each of the fields and then re-populating them after the injection of xml, but that didn't seem practical.  I'm almost positive it's something I'm not doing correctly with xpath.  Anyway, thanks for all your help on this.
    Mike

  • Multiple Rows Update / Refresh Toplink Query when database trigger involved

    Hi everybody!
    I have two easy troubles for you; the platform is the same as the SRDemo Toplink version.
    1.     Multiple Rows Update: I want to update with mergeEntity method, multiple rows for an isolated table; that method receives a parameter that I try to bind with the iterator "dataProvider" but it only merges the first row, not all, any other combination returns an error.
    What I want to do is to have a form (like tabular forms in Apex) that lets me update multiple rows in a single page. ¿May anyone tell me how to do it?
    2.     Refresh Toplink Named Query: I have a list on a page with two columns. From another page, a button does an action that fires a database trigger that updates one of the columns on the list´s page. When I go back to the list, it is not updated; however, the CacheResults´s property is set to false on the iterator.
    Thanks in advance,
    Alejandro T

    I didn't use it (yet), but - you might take a look. You'll find a [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html]Timer plug-in on this page. It is a dynamic action which allows you to periodically fire other dynamic actions in the browser. For example use the timer to refresh a region every five minutes. You can perform any dynamic action you want using this infrastructure.So I was thinking: you might use it to run a dynamic action which would check whether something changed in that table (I suppose you'll know the way) (for example, a database trigger might set a flag in some table, timestamp or similar), and - if you find that something really changed - refresh the page.
    As I said, I never used it so that's pure theory. Someone else might know better, though.

  • Help me with returing multiple rows - Query

    I am trying to return multiple rows and i need help with my query.
    and most important of all one of the requirement is the following:
    SERVICE LEVEL has categories Sergeant, Bonus I, All Deputies, Deputy Bailiff, Deputy Lockup, Deputy Bailiff Security, Custody Assistant,
    Security Officer, Security Assistant, Security Officer and Security Assistant, Private Security, ALL, All Sworn)
    Note: Service Level “All Deputies” includes Deputy Bailiff, Deputy Bailiff Security and Deputy Lockup
    *“All Sworn”: includes Sergeant, Bonus I, All Deputies, Deputy Bailiff, Deputy Lockup, Deputy Bailiff Security*
    //this code doesn't work cuz  case- when statement return only one row. but it works for singles such as 'Sergeant'
    select *
    from in_service
    where rank IN (CASE TRIM(UPPER(:SL))
                    WHEN 'ALL DEPUTIES' THEN
                      (SELECT DISTINCT RANK FROM IN_SERVICE
                       WHERE UPPER(RANK) LIKE 'DEPUTY%')
                    WHEN 'ALL SWORN' THEN
                   (SELECT DISTINCT RANK FROM IN_SERVICE
                   WHERE UPPER(RANK) LIKE 'DEPUTY%' OR
                   UPPER(RANK) = 'SERGEANT' OR
                   UPPER(RANK) = 'BONUS 1')
                    WHEN 'ALL' THEN
                   (SELECT DISTINCT RANK FROM IN_SERVICE
                   WHERE UPPER(RANK) LIKE 'DEPUTY%' OR
                   UPPER(RANK) = 'SERGEANT' OR
                    UPPER(RANK) = 'BONUS 1' OR
                   UPPER(RANK) LIKE 'SECURITY%' OR
                   UPPER(RANK) = 'CUSTODY ASSISTANT' OR
                    UPPER(RANK) = 'PRIVATE SECURITY') 
                    end )   I was able to get multiple rows for 'ALL' and specified category like 'Sergeant' or 'Bonus I' from the code below, but NOT for 'All Deputies' for example which includes Deputy Bailiff, Deputy Bailiff Security and Deputy Lockup. I know CASE, WHEN does NOT return multiple rows, but i am having problems writing the query to make it work for all categories as the requirements mentioned above.
    WHERE RANK IN (SELECT RANK FROM (SELECT RANK, 'ALL' ALL_SERVICE
                                            FROM IN_SERVICE
                                            UNION ALL
                                            SELECT RANK, RANK
                                            FROM IN_SERVICE) WHERE ALL_SERVICE = :SL)Please help.
    Thanks in advance

    If you define your service_level as a table then it will be much easier.
    with service_level
    as
    select 'ALL' parent_lvl, 'Sergeant' srv_lvl from dual union all
    select 'ALL', 'Bonus I' from dual union all
    select 'ALL', 'Deputy Bailiff' from dual union all
    select 'ALL', 'Deputy Lockup' from dual union all
    select 'ALL', 'Deputy Bailiff Security' from dual union all
    select 'ALL', 'Custody Assistant' from dual union all
    select 'ALL', 'Security Officer' from dual union all
    select 'ALL', 'Security Assistant' from dual union all
    select 'ALL', 'Security Officer and Security Assistant' from dual union all
    select 'ALL', 'Private Security' from dual union all
    select 'All Deputies', 'Deputy Bailiff' srv_lvl from dual union all
    select 'All Deputies', 'Deputy Bailiff Security' from dual union all
    select 'All Deputies', 'Deputy Lockup' from dual union all
    select 'All Sworn', 'Sergeant' srv_lvl from dual union all
    select 'All Sworn','Bonus I' from dual union all
    select 'All Sworn','All Deputies' from dual union all
    select 'All Sworn','Deputy Bailiff' from dual union all
    select 'All Sworn','Deputy Lockup' from dual union all
    select 'All Sworn','Deputy Bailiff Security' from dual
    select *
      from in_service
    where rank IN (
              select srv_lvl
                from service_level
               where upper(parent_lvl) = upper(:SL)
                  or upper(srv_lvl) = upper(:SL)
                   )

  • Return Code - Query for Multiple Rows as XML

    Hi,
    I'm executing an MSSQL stored procedure through the "Query for Multiple Rows as XML" activity in LiveCycle ES. I do this through a call statement such as this:
    { call MyStoredProc(?) }
    This works great, the stored procedure always returns a record set (with or without records). I use this activity rather than "Call Stored Procedure" because I can transform the record set into XML right away within this activity. Unfortunately any exception arising from invoking this stored procedure cannot be handled within the workflow as this activity does not have an exception handler (lightning bolt). In an attempt to handle at least some exceptions we have decided to use try/catches within the stored procedures and return different error codes. Now the problem I am faced with is that there is no way to retrieve the returned code within any of the SQL activities. We don't want to have to write an execute script for each of these SQL calls. Is there any way to do this? Seems like I'm 95% there.
    Thanks
    Nic

    Thanks for the offer, unfortunately we would need something certified by Adobe.
    Nic

  • Query to return multiple rows

    Hi all,
    I've a requirement where in I've to get multiple rows from a query.
    The resultset should be something like this:
    SELECT A
    FROM dual;
    A
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    Thanks in anticipation
    RK Raju

    I'm not completely certain I understand the question. Just in case you're asking for something as simple as this ...
    select rownum from all_objects where rownum <= 10;You didn't say what version you were using either (shame on you). You could use a collection or a pipeline depending on your version ...
    create or replace type ttab_number is table of number;
    create or replace function f_collection
        return ttab_number is
        tab_number ttab_number := ttab_number();
    begin
        for i in 1 .. 10 loop
            tab_number.extend;
            tab_number(tab_number.count) := i;
        end loop;
        return tab_number;
    end f_collection;
    select *
    from table(f_collection)
    create or replace function f_pipeline
        return ttab_number
        pipelined is
    begin
        for i in 1 .. 10 loop
            pipe row(i);
        end loop;
        return;
    end f_pipeline;
    show errors
    select *
    from table(f_pipeline)

  • Oracle query - Merging multiple rows into a single row output

    Hi All,
    I have to have a multiple row output to be converted into a single row output.My current output looks as follows:
    ID YR INC_CODE OFFN SCHOOLNO
    8006 2002 00175 SC03 12
    8006 2002 00175 DC06 12
    8006 2002 00175 DC03 12
    8006 2002 00175 DC02 12
    ID,INCIDENT CODE,OFFENSE are all Primary keys
    So I need the output as follows:(IN ONE ROW)
    ID YR INC_CODE OFFN1 OFFN2 OFFN3 OFFN4 SCHOOLNO
    8006 2002 00175 SC03 DC06 DC03 DC02 12
    Can you help me on this since have been spinning the wheel and this has to be a query since will have couple of tables join to produce a materialized view.
    Thanks in advance

    Hi Nigel,
    Thanks for the reply I tested out the portion having the decode and I get the output as follows:
    ID YR INC_CODE OFFN1 OFFN2 OFFN3 OFFN4 OFFN5
    8982 2002 2175 DOC01 -----------------------
    8982 2002 2175 DOC02-------------------
    8982 2002 2175 DOC03------------
    8982 2002 2175 DOC06-------
    8982 2002 2175 SCV03
    There is no value as max for OFFN and each INC_CODE MAY HAVE UP TO A MAX OF 5 OFFN.My query is as follows:
    select distinct STU_STUDENT_ID, INC_BEG_SCH_YR,INC_INCIDENT_CODE
    , decode(rank() over (partition by INC_CODE order by OFFN),1,OFFN,null) as offn1
    , decode(rank() over (partition by INC_CODE order by OFFN),2,OFFN,null) as offn2
    , decode(rank() over (partition by INC_CODE order by OFFN),3,OFFN,null) as offn3
    , decode(rank() over (partition by INC_CODE order by OFFN),4,OFFN,null) as offn4
    , decode(rank() over (partition by INC_CODE order by OFFN),5,OFFN,null) as offn5
    from stu_offn where
    stu_offn.ID = '8982' and stu_offn.INC_CODE = '2175'
    (****Where clause is just given to just check a value)
    So as you know I need to just have all the OFFN in a single row ie as follows:
    ID YR INC_CODE OFFN1 OFFN2 OFFN3 OFFN4 OFFN5
    8982 2002 2175 DOC01 DOC02 DOC03 DOC06 SCV03
    Can you just give me a step by step procedure to go through this and the table in this case is just 'STU_OFFN'
    Thanks for the earlier reply appreciate it!
    ****Sending this again to show the exact way the output is coming

  • Query on  Multiple-Row subqueries

    Multiple-row subqueries:
    -->"They should not be used with the NOT IN operator in the main query if NULL is likely to be part of the result of the subquery "
    -->"They can be used to retrieve multiple rows from a single table only"
    But i checked the following example
    select a.n1
    from t1 a
    where a.n1 not in (Select *
                 from t2 b)Where t2 contains null values
    And query is giving no error
    So the second option is correct i feel.
    Could you suggest me
    Edited by: josh1612 on Mar 7, 2010 10:38 PM

    -->"They should not be used with the NOT IN operator in the main query if NULL is likely to be part of the result of the subquery "Here is a simple example, there is no value in T2 for the column No as 1 but still you dont get any row. That is because NULL means UNKNOWN. You cant use it in comparison.
    create table t1(no integer)
    create table t2(no integer)
    insert into t1 values(1)
    insert into t2 values (null)
    insert into t2 values (2)
    select *
      from t1
    where t1.no not in (select no from t2)
    /Now delete the null value and try
    delete from t2 where no is null
    select *
      from t1
    where t1.no not in (select no from t2)
    /

  • Need query to convert Single Row Multiple Columns To Multiple rows

    Hi,
    I have a table with single row like below
    Column0 | Column1 | Column2 | Column3 | Column4|
    Value0    | Value1    | Value2    | Value3    |  Value4  |
    Am looking for a query to convert above table data to multiple rows having column name and its value in each row as shown below
    Column0 | Value0
    Column1 | Value1
    Column2 | Value2
    Column3 | Value3
    Column4 | Value4
    Thanks in advance.
    Mohan

    Hi ykMohan,
    Dynamic UNPIVOT can be applied in this case as well.
    CREATE TABLE dbo.T(ID INT,Column0 VARCHAR(99),Column1 VARCHAR(99),Column2 VARCHAR(99),Column3 VARCHAR(99),Column4 VARCHAR(99))
    INSERT INTO T VALUES
    (1,'Value0','Value1','Value2','Value3','Value4'),
    (2,'Value0','Value1','Value2','Value3','Value4');
    DECLARE @columns VARCHAR(MAX)
    SELECT @columns=
    STUFF(
    SELECT ','+ COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME ='T' AND TABLE_SCHEMA='dbo' AND Column_name NOT IN('ID') FOR XML PATH('')
    ),1,1,'')
    DECLARE @Sql NVARCHAR(MAX)
    SET @Sql =
    'SELECT ID, UPT.col,UPT.val FROM T
    UNPIVOT
    (val FOR col IN('+@columns+')) AS UPT'
    EXEC sp_executeSQL @Sql
    DROP TABLE T
    If you have any feedback on our support, you can click
    here.
    Eric Zhang
    TechNet Community Support

  • How to update multiple rows in one query using php

    i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page

    Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
    In such a situation, you need four database tables as follows:
    students (student_id, student_name, etc.)
    courses (course_id, course_name, etc.)
    students_courses (student_id, course_id)
    attendance (student_id, course_id, dater)
    A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
    The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
    So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one.

  • How to extract multiple rows from a query and how to populate it in form.

    hi all,
    i want to populate multiple rows fetched from a cursor into form.
    i write this procedur.
    PROCEDURE populate_q (v_t_no IN number) IS
    cursor ext_q is
    select test_question.no, q_no, text, ans1
    from test_question , question
    where test_question.no = v_t_no;
    BEGIN
    for ext_rec in ext_q loop
         :take_detail.q_no := ext_rec.q_no;
         :take_detail.question := ext_rec.text;
         EXIT WHEN ext_q%notfound;
         end loop;
    END;
    and call this WHEN-NEW-BLOCK-INSTANCE trigger.
    this don't return all the rows only the lost one is populated
    and shown in form.
    thanks
    Muhammad Nadeem
    Mardan (pakistan)
    [email protected]

    Hi,
    look for the next_record built-in. Your cusror only addresses the current row, but you want to create new rows as you go
    Frank

  • Querying view gives multiple rows

    I have a query that returns duplicate rows (5) when I write the query this way:
    "Select *
    from view v
    , table_A a
    where v.key = a.key"
    However, if I write the query this way, the correct data is returned, i.e., only one row.
    "Select *
    from (select * from view v)
    ,table_A a
    where v.key = a.key"
    It also works correctly if I put the in-line view in the select portion of the select statement.
    Any ideas?
    Thank you for your help,
    Tricia

    With the second query, I get "ORA-00904: "V"."KEY": invalid identifier". Are you sure that it ran ok for you? v.key is out of scope in the where clause...
    If I label the subselect as v, I get the same result as the first query - 5 rows.
    Message was edited by:
    Boneist
    (I can't spell)

  • Query for multiple row to single

    Hi All,
    Need help in Multiple row to single row
    create table cust_tranc_track
    (id number,
    payment_dt date ,
    emi_dt date,
    appr_dt date
    SET DEFINE OFF;
    Insert into CUST_TRANC_TRACK
       (ID, APPR_DT)
    Values
       (425, TO_DATE('11/12/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into CUST_TRANC_TRACK
       (ID, PAYMENT_DT, EMI_DT)
    Values
       (425, TO_DATE('11/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('11/13/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    Output :
    ID     PAYMENT_DT     EMI_DT              APPR_DT
    425     11/1/2012     11/13/2012     11/12/2012thanks
    ajr

    *> g2500 wrote:**> Hi All,*
    *>*
    *> Need help in Multiple row to single row*
    *>*
    *> *
    *>*
    *>*
    **_+Hi,+_**
    **_+I cant clear about ur question. I m giving the solution wat i can understand.to get multiple row inti single u can use listagg function.+_**
    **_+use hr.employees+_**
    **_+select department_id,listagg(first_name,',') WITHIN GROUP (ORDER BY first_name) AS employeename+_**
    **_+from employees+_**
    **_+group by department_id;+_**
    **_+u [http://dba-oracle.com/t_oracle_listagg_function.htm]+_**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Multiple rows insertion - need help

    Hello all,
    I need to insert multiple rows in a table with a single query and the number of rows is 269470.
    There are 3 columns in the table. One of the columns is determined by another sub query which returns multilple(269470) rows and the other 2 columns remain same for all.
    I came up with the following query but need a loop to make it run multiple time(269470 times).
    insert into EMLUSRRECV
    (user_id, storeent_id, receiveml)
    values
    ((select user_id from users where user_id not in (select distinct user_id from EMLUSRRECV) and CURR = 'USD' and rownum = 1), 11154, 1);
    Thanks in advance.
    Edited by: 924585 on Feb 20, 2013 7:19 PM

    924585 wrote:
    Hello all,
    I need to insert multiple rows in a table with a single query and the number of rows is 269470.
    There are 3 columns in the table. One of the columns is determined by another sub query which returns multilple(269470) rows and the other 2 columns remain same for all.
    I came up with the following query but need a loop to make it run multiple time(269470 times).
    insert into EMLUSRRECV
    (user_id, storeent_id, receiveml)
    values
    ((select user_id from users where user_id not in (select distinct user_id from EMLUSRRECV) and CURR = 'USD' and rownum = 1), 11154, 1);
    Thanks in advance.
    Edited by: 924585 on Feb 20, 2013 7:19 PMwhy not just:
    insert into emlusrrecv
    select user_id, 11154, 1
      from  users
    where user_id not in (select user_id from EMLUSRRECV)
    and CURR = 'USD' and rownum = 1)

  • Multiple rows Converge to Single row and join

    Hi Folks,
    I am facing a tricky challenge to join a table with multiple rows and converge into a single row (based on ID, period) and join with another table to get a single row. Let me explain.
    Table 1: DTL_TABLE (id, period, course, names, title, type)
    1 2010 mat john null null
    1 2010 mat jim null null
    1 2010 cam null officer null
    1 2010 cam null Prof null
    1 2010 phy null null Inclass
    1 2010 phy null null Online
    Join with
    Table 2: ID_TABLE(id, period, Loc, Dept, Code)
    1 2010 nj 101 CC.
    Output format (id, period, course, names, title, type, Loc, Dept, Code)
    result : 1 2010 mat,cam,phy john,jim officer,prof inclass,online nj 101 CC
    I have created all the DDLs and DMLs if that help. Kindly let me know if a Join SQL query is possible.
    Thank you,
    Aj
    CREATE TABLE DTL_TABLE
       ids      VARCHAR2 (10),
       period   VARCHAR2 (10),
       course   VARCHAR2 (10),
       names    VARCHAR2 (10),
       title    VARCHAR2 (10),
       TYPE     VARCHAR2 (10)
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'mat',
                 'jim',
                 NULL,
                 NULL);
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'mat',
                 'john',
                 NULL,
                 NULL);
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'mat',
                 'kale',
                 NULL,
                 NULL);
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'cam',
                 NULL,
                 'officer',
                 NULL);
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'cam',
                 NULL,
                 'prof',
                 NULL);
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'phy',
                 NULL,
                 NULL,
                 'inclass');
    INSERT INTO DTL_TABLE
         VALUES ('1',
                 '2010',
                 'phy',
                 NULL,
                 NULL,
                 'online');
    COMMIT;
    CREATE TABLE id_table
       ids      VARCHAR2 (10),
       period   VARCHAR2 (10),
       loc      VARCHAR2 (10),
       dept     VARCHAR2 (10),
       code     VARCHAR2 (10)
    INSERT INTO id_table
         VALUES ('1',
                 '2010',
                 'nj',
                 '101',
                 'cc');
    COMMIT;

    Aj09 wrote:
    Hi Folks,
    I am facing a tricky challenge to join a table with multiple rows and converge into a single row (based on ID, period) and join with another table to get a single row. Let me explain.
    Table 1: DTL_TABLE (id, period, course, names, title, type)
    1 2010 mat john null null
    1 2010 mat jim null null
    1 2010 cam null officer null
    1 2010 cam null Prof null
    1 2010 phy null null Inclass
    1 2010 phy null null Online
    Join with
    Table 2: ID_TABLE(id, period, Loc, Dept, Code)
    1 2010 nj 101 CC.
    Output format (id, period, course, names, title, type, Loc, Dept, Code)
    result : 1 2010 mat,cam,phy john,jim officer,prof inclass,online nj 101 CC
    I have created all the DDLs and DMLs if that help. Kindly let me know if a Join SQL query is possible.
    SELECT TBL.id,
           DTLperiod,
           course,
           names,
           title,
           TYPE,
           Loc,
           Dept,
           Code
    FROM   ID_TABLE TBL,
           DTL_TABLE DTL
    WHERE  TBL.ID = DTL.ID
           AND TBL.PERIOD = DTL.PERIOD; it not good to use RESERVED WORDS like "ID" or "TYPE" as column names

Maybe you are looking for

  • Memory Question - is this normal?

    I just got my new MacBook yesterday. Built week 24. I got 1 GB of RAM on it. I just restarted it and it is charging the battery (after calibrating it). I have not run anything on it since it restarted only the dashboard because I have installed a win

  • Space bar not working imac

    Suddenly for no reason the backspace, spacebar and caps lock are no longer working on my wireless keyboard. I've seen loads of posts with the same problem but wondered if its a software issue of if the keyboard has just died?  I've tried it with othe

  • Cant sign into facebook via iphone?

    Im able to sign into facebook via my ipad and laptop but not via iphone.

  • IP adress of SAP server

    How can i get SAP application server IP  adress? is there any system field is avilable to store that ip adress

  • Scrollbar in ALV table

    Hi All, Is anybody using Scroll bars in ALV table? If yes please help me out. Iam not able to set scroll bar. Thank You, Suresh.