JTable: Multiple Columns to Single Header

Hi
How is it possible to allocate multiple columns in a JTable to the one header.
I retrieve a resultset from a DB. At present 'firstname' and 'lastname' go into separate columns with separate headers.('firstname' and 'lastname')
I would like to either combine 'firstname' and 'lastname' then add to the table as one column, or, leave 'firstname' and 'lastname' as is and combine the headers of these columns.
Not sure how to go about this...
Any help would be appreciated,
Thanks
Gregg

Look at http://www2.gol.com/users/tame/

Similar Messages

  • How to insert from one table to another (multiple columns to single column)

    I want to insert data from table1 into table2 and the data looks in 3 columns as below
    Table1     
    RepNm ObjNm DbNm
    123     abc def
    456     def xyz
    789     123 456
    and the data in table2 should be display as
    Table 2
    ObjNm
    123
    456
    789
    abc
    def
    xyz
    the dupes should get eliminated and only the distinct values should be inserted into a single column in table2 from multiple columns in table1

    How do you want to handle nulls? If there is a null in any value of a column, do you want to insert it?
    Then,
    WITH T
         AS (SELECT LEVEL colnum
               FROM DUAL
             CONNECT BY LEVEL <= 3)
    SELECT DECODE (colnum,  1, RepNm,  2, ObjNm,  3, DbNm) as ObjNm
      FROM table1, T;if you dont want to insert nulls then,
    WITH T
         AS (SELECT LEVEL colnum
               FROM DUAL
             CONNECT BY LEVEL <= 3)
    SELECT DECODE (colnum,  1, RepNm,  2, ObjNm,  3, DbNm) AS ObjNm
      FROM table1, T
    WHERE DECODE (colnum,  1, RepNm,  2, ObjNm,  3, DbNm) = DECODE (colnum,  1, RepNm,  2, ObjNm,  3, DbNm)G.

  • Update multiple columns with single update statement..

    HI all,
    i am reading the columns value from different table but i want to update it with signle update statement..
    such as how to update multiple columns (50 columns) of table with single update statement .. is there any sql statement available i know it how to do with pl/sql..

    As I understood, may be this. Here i am updating ename,sal, comm columns all at once.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17/12/1980 12:00:00        800                    20
    SQL> UPDATE emp
      2     SET ename = lower (ename),
      3         sal = sal + 1000,
      4         comm = 100
      5   WHERE empno = 7369;
    1 row updated.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 smith      CLERK           7902 17/12/1980 12:00:00       1800        100         20
    SQL> UPDATE emp
      2     SET ename = (SELECT 'ABCD' FROM DUAL),
      3         sal = (SELECT 1000 FROM DUAL),
      4         comm = (SELECT 100 FROM DUAL)
      5   WHERE empno = 7369;
    1 row updated.

  • Converting multiple column in single column

    Hi All,
    I need to create a table with single column by using select statement with multiple columns
    For Ex- i have 1 row with 10 columns (may be more than 10) like
    'A','B','C','D','E','F','G','H',I','J'
    i written sql like
    select 'A','B','C','D','E','F','G','H','I','J' from dual
    result is - 'A','B','C','D','E','F','G','H','I','J' with 10 columns
    Now i need output lik this using SQL
    Text
    'A'
    'B'
    'C'
    'D'
    'E'
    'F'
    'G'
    'H'
    'I'
    'J'
    Please help me to sort out this problem. Your help would highly appropriated.
    Regards
    Raju
    Edited by: 888667 on Apr 8, 2013 10:54 PM
    Edited by: 888667 on Apr 8, 2013 10:56 PM

    Welcome to the forum!!! You can convert column to row like this
    SQL>with my_table
      2  as
      3  (
      4  select 'A' col1,'B' col2,'C' col3,'D' col4,'E' col5,'F' col6,'G' col7,'H' col8,'I' col9,'J' col10
      5    from dual
      6  )
      7  select decode(no , 1, col1, 2, col2, 3, col3, 4, col4, 5, col5, 6, col6, 7, col7, 8, col8, 9, col9, 10, col10) col
      8    from my_table
      9    cross join (select level no from dual connect by level <= 10)
    10  /
    C
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    10 rows selected.
    SQL> To ask question in a better way please read {message:id=9360002} from FAQ

  • Merge multiple columns into single column?

    Hi,
    I need to execute queries dynamically and return the values. I need to fetch the values of the queries in single column only by concatenating the multiple columns. I cannot use PL/SQL in my scenario.
    is there any way to execute a query and the result will be fetched in single column (values of multiple columns needs to be concatenated)?
    Thanks,
    Raja.

    hi,
    do you mean this??
      1* select EMPNO||' '||ENAME||' '||JOB||' '||MGR||' '||HIREDATE||' '||SAL||' '||COMM||' '||DEPTNO||
    SQL> /
    MULTIPLE_COL
    100 JDF DIR  05-SEP-09 200 1000 10
    7497 MILLER CLERK 7782 23-JAN-82 25000 195 35
    7566 JONES MANAGER 7839 02-APR-81 3175 446.25 20
    7654 RAR SALESMAN 7698 28-SEP-81 1450 1587.5 30
    7698 BLAKE MANAGER 7839 01-MAY-81 3050 427.5 30
    7782 CLARK MANAGER 7839 09-JUN-81 2650 367.5 10
    7788 SCOTT ANALYST 7566 09-DEC-82 3200 450 20
    7839 KING PRESIDENT  17-NOV-81 5200 8250 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1700 225 30
    7876 ADAMS CLERK 7788 12-JAN-83 1300 165 20
    7900 JAMES CLERK 7698 03-DEC-81 1150 85.5 30 [email protected]
    MULTIPLE_COL
    7902 FORD ANALYST 7566 03-DEC-81 3200 450 20
    8000 KINGBABA PRESIDENT  17-NOV-81 5200 8250 10
    8001 TURNER RAV SALESMAN 8000 08-SEP-81 1700 450 30
    1001 KITTU DOR  05-SEP-09 1200 100 40
    15 rows selected.Or
    Mean this??
    SQL> ed
    Wrote file afiedt.buf
      1  With T As
      2     ( Select Level col1 From dual Connect By Level<=10
      3     )
      4     Select Max(SYS_CONNECT_BY_PATH(COL1||',',' ')) Multi_col
      5       From
      6     ( Select COL1, Lag(COL1) Over (Order By COL1) As Lag
      7             From   T  )
      8      Start With Lag Is Null
      9        Connect By
    10*    Prior col1 = LAG
    SQL> /
    MULTI_COL
    1, 2, 3, 4, 5, 6, 7, 8, 9, 10,Edited by: user291283 on Sep 8, 2009 10:10 PM

  • How to Concat multiple columns to single column at the report level

    Hi All,
    I have a requirement in such a way that I have to concat multiple colulmns to single column at the report level.
    First of all the column I am using in my report is "X" with datatype as Integer. Now  if the length of this column "X" is <8 then I have add zero's (0) before the number.
    And then I have to concat with a column "Y" and then cocnat with a column "Z" and finally the datatype should be casted to CHAR.
    Can anyone please let me know the logic how I can add to my column so that it satisfies all the above.
    Thanks All

    >Also, Another thing is if X < length of 8 Ihave to append with zero's..
    >Ex: if the actual value of X is 123456 i wanted to show it as 000123456.
    Try to be consistence what you said, you are looking for 8 length and above ex is 9 in length.
    You need to learn many things one of those is CASE, at least do copy and also read
    Forums Etiquette/Reward Points

  • Transform Multiple column into single column;

    Hi all,
    I have a table with multiple columns
    Col_1
    Col_2
    Col1_3
    Col_4
    Col_5
    Col1_6
    Col_7
    Col_8
    Col1_9
    Val_1
    val_2
    Val_3
    Val_4
    val_5
    Val_6
    Val_7
    val_8
    Val_9
    Oper1
    Oper2
    Oper9
    Currently the table look like this
    ID Name | f_actve | Col_1| Col_2|….Col1_9| Val_1| val_2| …Val_9| Oper1…..| Oper9
    Now I need to insert the data into new table The structure of the new table look like this
    Table : T1 (header)
    ID | Name | F_active
    Table : T2 (detail )
    Dtl ID |  Columnname | Oper
    Now all the column_name Col_1through Col_9 should be inserted into column_name column.
    Same thing with the Opers
    Table T3(detail )
    DTL_ID | Column_Values
    Now all the Column_Values Col_1through Col_9 should be inserted into column_name column
    Please help
    We have 10G /11g.
    Thanks
    Rebecca

    What you are trying to do is called unpivot in 11g.
    See this example.
    SQL> WITH T
      2       AS (SELECT 1 dtl_id,
      3                  1 col1,
      4                  2 col2,
      5                  3 col3,
      6                  4 col4
      7             FROM DUAL)
      8  SELECT * FROM T;
        DTL_ID       COL1       COL2       COL3       COL4
             1          1          2          3          4
    SQL> WITH T
      2       AS (SELECT 1 dtl_id,
      3                  1 col1,
      4                  2 col2,
      5                  3 col3,
      6                  4 col4
      7             FROM DUAL)
      8  SELECT dtl_id, "COL_VALUES"
      9    FROM T UNPIVOT (col_values FOR abc IN (col1, col2, col3, col4));
        DTL_ID COL_VALUES
             1          1
             1          2
             1          3
             1          4
    SQL>

  • How to add multiple columns to single column header

    hi,
    i wans to add two columns under a single column header in jtable how can i do this.

    By following some of these clever samples:
    http://www.crionics.com/products/opensource/faq/swing_ex/JTableExamples1.html
    Lots of different ideas on manipulating headers and columns there and on the proceeding pages.

  • Concatenate Multiple Columns into Single

    Hi All,
    I am developing a report and there is a field called FUNDING_SOURCE.
    This field is being picked from class_code of PA_PROJECT_CLASSES table as shown below:
    (select distinct(class_code)
    from pa_project_classes ppc,
    pa_projects_all ppa
    where class_category = 'FUNDING SOURCE'
    and ppc.project_id = :project_id)
    But, the requirement is to have all values of Funding Source for a particular project ID concatenated into a single column.
    Eg: If I run the above code, the output would be in 3 rows,
    Intenal
    External
    Other
    I want the output concatenated and displayed as Internal, External, Other.
    Please help me ASAP. Need to finish this soon.
    Thanks!

                        SELECT substr(MAX(sys_connect_by_path(a,
                                                              '~')),
                                      2) --first character wil be ~ max is used because the query will return 3 rows and u need only one row with all values appended
                          FROM (SELECT a,
                                       row_number() over(ORDER BY t.b) AS curr, --order in which appending happens
                                       row_number() over(ORDER BY t.b) - 1 AS prev --order in which appending happens
                                  FROM (SELECT 'Internal' a,
                                               1 b
                                          FROM dual
                                        UNION ALL
                                        SELECT 'External' a,
                                               2 b
                                          FROM dual
                                        UNION ALL
                                        SELECT 'Other' a,
                                               3 b
                                          FROM dual) t --creating dummy table
                        CONNECT BY prev = PRIOR curr
                         START WITH curr = 1;

  • Update Multiple Column with Single Command with Join between Two tables.

    This is our command where we are trying to update a table's two columns by pulling values from another table after joining. This query takes too much time to execute. Any suggestions ?
    UPDATE raw_alc_rmfscombinednew
    SET (BSC, CELL_NAME) =
    SELECT distinct raw_alc_R110combinednew.BSC, raw_alc_R110combinednew.CELL_NAME
    FROM raw_alc_R110Combinednew
    WHERE
    raw_alc_R110Combinednew.OMC_ID = raw_alc_rmfscombinednew.OMC_ID
    AND raw_alc_R110Combinednew.CELL_CI = raw_alc_rmfscombinednew.CI
    AND RAW_ALC_R110COMBINEDNEW.START_TIME = RAW_ALC_RMFSCOMBINEDNEW.START_TIME
    Results of Last execution:
    Elapsed Time (sec) 4,476.56
    CPU Time (sec) 4,471.88
    Wait Time (sec) 4.68
    Executions that Fetched all Rows (%) 100.00
    Average Persistent Mem (KB) 32.43
    Average Runtime Mem (KB) 31.59
    --------------------------------------------------------------

    Your update requires a full execution of the subquery for each row in the destination table (raw_alc_rmfscombinednew). Try rewriting as a MERGE. Tons faster.
    MERGE INTO raw_alc_rmfscombinednew  D
          USING ( SELECT distinct
                         BSC,
                         CELL_NAME
                         START_TIME
                    FROM raw_alc_R110Combinednew )  S
             ON (    S.OMC_ID     = D.OMC_ID
                 AND S.CELL_CI    = D.CI
                 AND S.START_TIME = D.START_TIME )
        WHEN MATCHED THEN
          UPDATE
             SET D.BSC        = S.BSC,
                 D.CELL_NAME  = S.CELL_NAME

  • Mapping multiple columns of a table to single dimension using odi

    Hi John,
    Can we map multiple columns of a table to a single dimnesion?
    For example, in RDBMS, for the employee details, Grade position etc will be in different columns, and in Planning these would be as members of one dimension.
    So while loading data from oracle to essbase can we map these multiple columns to single dimension?
    If yes how?

    Hi,
    In your staging area/target you can concatentate the columns.
    So in your interface and on your target datastore, pick the column which is going to hold the details of the concatenation.
    Then in the expression editor use the CONCAT function, or you could use ||
    eg CONCAT(<sourceCol1>, <sourceCol2>)
    or <sourceCol1> || <sourceCol2>
    obviously you need to change the information between <sourceCol1> to your source datastore column
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to sort on Multiple columns in WebI report

    Hi
             I am working in BO XI R2. I have a report containing two columns in a section. Section is on Fiscal Year- Fiscal year includes calendar year 2010 and 2011.
    data for fiscal year 2010 is from october onwards.
    The two columns in the section are
    column 1- calendar  Year
    column 2- calendar Month
    I want to display results as follows
    2010 oct
    2010 nov
    2010 dec
    2011 jan
    2011 feb and so on.
    I first sorted calendar year column so that it shows
    2010
    2011
    but when i try to sort calendar month, for 2010 I am able to display oct, nov, dec in a ascending order but for 2011 the months are displayed randomly. Business user wants to see them in ascending order from Jan to June.
    Please let me know how to get this functionality in the report.
    Thanks in advance.

    Hello Gurus,
    I have same issue with me I am working on XI3.1 and I want to apply Sort on multiple columns on Single block.
    So as you can see the "Org Name" is decending Order and " Emails Sent" total is 63 and   "BCB" have 18 total.
    How would I apply sorting based on email sent from high number to low number. Please help.
    Thank you.
    Adil
    Org Name
    Org Tax ID
    Org ID
    Email
    Emails Sent
    Undelivered Emails
    Well Shot
    11111111
    22222222
    [email protected]
    32
    0
    11111111
    22222222
    [email protected]
    12
    0
    11111111
    22222222
    [email protected]
    10
    0
    11111111
    22222222
    [email protected]
    9
    0
    Well Shot
    Subtotal:
    63
    0
    Org Name
    Org Tax ID
    Org ID
    Email
    Emails Sent
    Undelivered Emails
    Well Play
    444444444
    33333333
    [email protected]
    1
    0
    WellPoint KY Test Org - Central
    Subtotal:
    1
    0
    Org Name
    Org Tax ID
    Org ID
    Email
    Emails Sent
    Undelivered Emails
    BCB
    55555555
    99999999
    [email protected]
    8
    0
    55555555
    99999999
    [email protected]
    8
    0
    55555555
    99999999
    [email protected]
    2
    0
    BCB
    Subtotal:
    18
    0
    Org Name
    Org Tax ID
    Org ID
    Email
    Emails Sent
    Undelivered Emails
    Ghazi, Foundation
    77777777
    8888888
    [email protected]
    1
    0
    77777777
    8888888
    [email protected]
    1
    0
    77777777
    8888888
    [email protected]
    1
    0
    77777777
    8888888
    [email protected]
    1
    0
    77777777
    8888888
    [email protected]
    1
    0
    Ghazi, Foundation
    Subtotal:
    5
    0
    Availity Orgnaization Name
    Org Tax ID
    Org ID
    Email
    Number of Emails Sent
    Undelivered Emails
    Ghazi, Foundations
    66666666
    1234567893
    [email protected]
    1
    0
    66666666
    1234567893
    [email protected]
    1
    0
    Ghazi,  Foundations
    Subtotal:
    2
    0
    Totals:
    89
    0

  • Multiple columns in one prompt

    Hi Gurus,
    can we add multiple columns in single prompt in obiee,if yes then how
    thanks

    hi User,
    It should be like this in fx of prompt
    Dim- tabel.Area || Dim-Table .Region || Dim-Table || districts
    Else, convert to SQL Results in Show section and use Union All
    SELECT "D2 Market"."M02 Area" FROM "Sample Sales"
    UNION ALL
    SELECT "D2 Market"."M04 Region" FROM "Sample Sales"
    Thanks,
    Saichand.v

  • SSRS - multiple toggle in single row item to drill down sub report

    I need to open a sub report using drill down concept. Is there any possible to give toggle for multiple columns in single row.
     http://social.msdn.microsoft.com/Forums/getfile/528971
    The sub report have two parameters to show data. If I click first link the subreport to be drill down with parameters 1 and 5. If I click second link the
    same sub report to be drill through with different parametrs as 2 and 6.
    Any idea to do this?

    Thanks for your reply.
    I do it this in different way. 
    See the below sample image url. I created the main report having four details with toggle to drill down the sub report. If I click the Detail1 the
    subreport1 will expand drill down then I click Detail2 the subreport2 to be expand.
    But still the subreport1 is visible I want to collapse Subreort1 once click toggle second and vice versa.
    Please give your suggetions. 
    http://social.msdn.microsoft.com/Forums/getfile/529184

  • Need multiple lines in single column of header using alv oops

    Hi
    I am using alv oops in a report.
    I need multiple lines in single column of header.   
    In header of my report i am using 9 columns.
    In the second column i need to split the line
    Notification description/activity/work/activity long text/
    as
    Notification description/
    activity/
    work/
    activity long text/
    Please guide me to achieve this functionality.

    It is not possible to break the column description in the ALV  disply.
    Actually, if you have a longer description in one of the seltext_* field of the fiels catalog, it will automatically display it as a tooltip, if you put the mouse over the heading. In ALV OO, you can explicitly set the tooltip text.
    Also you can get more help on the field pressing F1: If you use DDIC fields, it it automatic, otherwise you can do it as you like.

Maybe you are looking for

  • My Apple TV does not show all of the movies in my library.

    All are in the movies category, no home videos here.  It almost seems to be movies that I have removed from a device.  At least some of the ones not showing up were recently removed from my iPad.  Came back from a trip and removed some of the movies

  • Will creating a new apple id delete all my music?

    So i recently discovered that the email I have been using for my apple id has been hacked, so I am thinking about creating a new apple id. My question is will creating a new apple id cause me to lose all the music on my itunes? I cannot sign back ont

  • SQL Developer 1.5.1 failed to start after applying patchset 11.1.0.7

    After applying patchset 11.1.0.7 to Oracle 11g (11.1.0.6) running on Windows 2003, when starting SQL Developer 1.5.1 I got an error: "Unable to find main class. Class specified is: oracle/ide/boot/Launcher". Any idea? Thanks.

  • "in" clause in case statement

    Hello, I want to do something like this:      select * from ....         join ....       where ....         and case when pparameter = 'D' then (a.column in ('M', 'P'))                  when pparameter = 'N' then (a.column in ('N', Z'))             e

  • Help.. best way to share FC projects between 4 computers

    Hi There, We are a small video production company and we use four computers to edit, one Mac Pro, two iMacs and a Macbook Pro. The problem we have is that we often need to move the projects from one computer to another, so different members of the te