Changing the Column name of a table horizontally

Hi ,
I have a table named emp.
Empno Sal
10 1000
20 2000
30 3000
40 4000
I need the output like
Empno 10 20 30 40
sal 1000 2000 3000 4000
Note: It should work for any table. Also not the column & row mapping which should be synchronised like the original structure.

I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
;)

Similar Messages

  • Change the column names programatically

    Hi All,
    is it possible to change the column name in a table programatically?? my req is like this..I ve a table which contains 60 columns. out of these 60 columns 53 columns signifies the 53 weeks of the year. so i ve to display the date in the column headers. How can i achieve this?
    Thanks in advance,
    Sree

    Column prompts can be modified through the OAF Personalization screens. This will ensure you are declaratively setting the values.
    Regards,
    Prabodh.

  • How to change the column name as bold in adf table

    Hi,
    How can I change the column name with bolder style and blue colour in adf Table?
    I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
    can any one have any idea how to do this?
    and I have taken panel tabbed layout and in that i'm displaying this table.
    but this table has scroll beneath of it to show all columns.
    but i want to display all columns (for this, page should have scroll at the bottom side).
    how can I achieve this???

    Hi,
    Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
    *af|column::column-header-cell{*
    color:Blue;
    font-weight:bold;
    This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
    By the way, what version of JDeveloper are you using?
    Thanks,
    Navaneeth

  • How to read the column name of a table from sap system using C#?

    Hi!!
    I am using SAP .NET connector and creating a windows application.
    Now I wanna read the column name when a table name is given....
    Connection is done, but I don't know the code to read the column names alone...
    Can anyone help me with the code??

    fine!!
    So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
    Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
    This is my code: What I have to change in this???
    ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
                RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
                RfcDestination rfcDest = null;
                rfcDest = RfcDestinationManager.GetDestination(a);
                    RfcRepository repo = rfcDest.Repository;
                    IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
                    IRfcTable addressData = customerList.GetTable("AddressTable"));
                    int j = addressData.Metadata.LineType.FieldCount;
                    for (int i = 0; i < j; i++)
                        RfcElementMetadata metadata = addressData.GetElementMetadata(i);
                        listallcolumn.Items.Add(metadata.Name);
    Message was edited by: Jeswin Rebil

  • BSP Changing the Column name

    Hi experts,
    I have used tableview in BSP . In the output it displays the column name as per the table which i have referred. I want to change the name of the column. How Should i do that.. anyone plz explain me with an example.
    Thanks in Advance
    Edited by: Vijay Babu Dudla on Apr 28, 2009 12:59 AM

    Hi ,
    If you want to change the column name, you can put your code following:
    <htmlb:tableViewColumn columnName    = " "
               *title        = " put the cloumn name here"*
               </htmlb:tableViewColumn>
    Please try.
    Any doubt let me know.
    Regards,
    Chris Gu
    Edited by: Gu Chris on Apr 28, 2009 5:26 AM
    Edited by: Gu Chris on Apr 28, 2009 5:26 AM
    Edited by: Gu Chris on Apr 28, 2009 5:27 AM

  • Can I change the Column Name without losing data and change the sequence

    Dear Experts,
    I want to change the column name without changing the sequence and dont want lose the data.

    Oracle Version : ?
    Example Based on 10g.
    SQL> conn scott/tiger
    Connected.
    SQL> create table col1 as select * from all_objects where rownum <= 100;
    Table created.
    SQL> alter table col1  add constraints col1_pk_objid primary key(object_id);
    Table altered.
    SQL> desc col1
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    OBJECT_NAME                                        VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_ID                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                            DATE
    LAST_DDL_TIME                                      DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    SQL> alter table col1 rename column object_id to object_no;
    Table altered.
    SQL> desc col1;
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    OBJECT_NAME                                        VARCHAR2(30)
    SUBOBJECT_NAME                                     VARCHAR2(30)
    OBJECT_NO                                 NOT NULL NUMBER
    DATA_OBJECT_ID                                     NUMBER
    OBJECT_TYPE                                        VARCHAR2(19)
    CREATED                                            DATE
    LAST_DDL_TIME                                      DATE
    TIMESTAMP                                          VARCHAR2(19)
    STATUS                                             VARCHAR2(7)
    TEMPORARY                                          VARCHAR2(1)
    GENERATED                                          VARCHAR2(1)
    SECONDARY                                          VARCHAR2(1)
    SQL> column column_name format a30
      1  select column_name,constraint_name
      2  from user_cons_columns
      3  where table_name = 'COL1'
      4* and owner = 'SCOTT'
    COLUMN_NAME                    CONSTRAINT_NAME
    OBJECT_NO                      COL1_PK_OBJID
    SQL>
    also go through
    http://www.dizwell.com/prod/node/65
    Message was edited by:
    user52

  • How to select even the column names of a table?

    Hello All,
    Is there a way to select even the column names of a table in the select statement?
    My select from a table (say X) is in a SQL* Plus script that gets invoked by application tier and displays data in the application tier window. User's can then copy the data into a spreadsheet and do their processing. However, I need to give them the column names too along with the data.
    Thanks,
    Chiru

    If there is a middle tier that is selecting and
    displaying the data, and that's what the users are
    copying from, the middle tier would have to address
    its presentation of the data to allow users to
    include column names. If this is a common task, the
    application should probably be modified to give users
    the option of downloading the data in a spreadsheet
    directly rather than forcing them to copy and paste
    data.Thanks for the reply.
    The users don't have to copy paste. The application tier has an options in the "Tools" menu item which allows them to copy the entire output to a file (in my case a txt file which is a pipe delimited). Then they have to do text to columns to get the data into each column of the spreadsheet. I could have directly called the stored procedures from the application tier and created ".csv" files and FTP'd them to the user's folders. However, I am having to go this round about because, I am not getting enough support from the LAN team in FTP'ing etc.
    OK I'll think of another workaround.
    Thanks,
    Chiru

  • Set the column name of a table in a list box

    is there any code to set the column name of a table in a list box at oracle devloper 6i?
    pls help.

    I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
    Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
    ;)

  • How to change the column names in display

    Hi,
    I want to change the columns names and give the display names as more User friendly..
    How should I acheive this in WebI reports.
    Regards,
    BOB

    Hi,
    the columns names are normal text fields. Just selecdt to edit your report , go to the editor panel and select the column header you want to modify. You can enter the text you want to display
    Regards,
    Stratos

  • Changing the column names displayed via an ODBC driver

    Hi we are just starting to used Crystal Reports to improve the reporting capabaility of a legacy application, we can access the data fine using an ODBC driver. What we want to do is change the column names that are displayed within Crystal Reports so they are more user friendly and not in techno speak,, so that the users can create their own reports. Do we need to used Business Objects to setup a Universe to do this, is their a simple cheaper method sorry if this post is in the wrong section

    Can you set up "views" in your database? That would probably be the easiest way to do this.
    -Dell
    - A computer only does what you told it to, not what you thought you told it to!</p>

  • How to display the column names of a table in the output

    Hi,
    I want to display the name of the columns of the table without using literals in a abap report.
    EX: Consider the table KNA1
    KUNNR NAME  ADDRESS
    I want to display the column names in the above fashion without using hardcoded write statements.
    Thanking in anticipation

    You can use this FM <b>DDIF_FIELDINFO_GET</b> It gives you all the names related to fields in a table -:)
    Greetings,
    Blag.

  • Changing the Column names / alias

    Hi,
    I have an oracle query and it works fine.
    select q.sname,
    SUM( decode(p.nprofile1,10,1,0)) as "0 - 5",
    SUM( decode(p.nprofile1,9,1,0)) as "6 - 10",
    SUM( decode(p.nprofile1,8,1,0)) as "11 - 15",
    SUM( decode(p.nprofile1,7,1,0)) as "16 - 19",
    SUM( decode(p.nprofile1,6,1,0)) as "20 - 20",
    SUM( decode(p.nprofile1,5,1,0)) as "21 - 27",
    SUM( decode(p.nprofile1,4,1,0)) as "28 - 30",
    SUM( decode(p.nprofile1,3,1,0)) as "31 - 40",
    SUM( decode(p.nprofile1,2,1,0)) as "41 - 45",
    SUM( decode(p.nprofile1,1,1,0)) "46 - Over",
    COUNT(q.sname) "TOTAL"
    from task_core@cds t, cor_queue q, profile_core@crb p
    where t.nmboxid = q.nmboxid
    and p.ncodaid = t.nobjectid
    and p.ntype=2
    GROUP BY q.sname
    ORDER BY q.sname
    It generates a Cross-tab sort of result and I am using the decode function to generate the result.
    My problem is that right now I am using hardcoded column names or alias for the columns generated by the decode function. eg. "0-5", "6-10" etc.
    I have another table which contains these values ("0-5","6-10"). I would like to know instead of hard coding the column names like
    SUM( decode(p.nprofile1,10,1,0)) as "0 - 5"
    can we retrieve the values from the Other table that contains the values "0-5","6-10" etc and display it there in the decode function?
    Pls help me with this issue
    Thanks
    Gilles

    hi,
    the column names are always fixed. You can try dynamic sql in pl/sql or spool then execute, but in pure sql, it is not possible

  • How can I list all the column names of a table by programming?

    Hi,
    Now I want to write an function which has the following features:
    Firstly, The function was given a parameter as table name.
    Then, it will lists all the columns names of the table.
    e.g
    table: person
    ---firstName------lastName----+
           Michale               Jackson
    We can get the columns 'firstname' and 'lastName' by calling the function with table name 'person'.
    And I also wonder that where I can get reference book or any other materials?
    Thanks.
    Edited by: wenjing wang on Feb 15, 2008 6:42 AM
    Edited by: wenjing wang on Feb 15, 2008 6:57 AM

    hi,
    hope the below code helps u. Just take the headee which contains the field name and split it like below and compare it with the field name u want here 'last name'.
    here,
    'First name' will be in wt_filedata1 and remaining field names in wt_filedata2, so 'do' continues.
    c_tab must be the separator, either , or + or tab etc..
    CODE:
    read table person into wl_header index 1.
    do.
        split wl_header at c_tab into: wt_filedata1 wt_filedata2.
        if wt_filedata1 <> 'lastname'.
          cnt1 = cnt1 + 1.
          wl_header = wt_filedata2.
        else.
          exit.
        endif.
      enddo.
    Please reward if it is useful.
    regards,
    sri

  • Dynamically change the column name....

    Hi,
    I am facing a problem in displaying name of the columns dynamically as a parameter selected from the dashboard prompt.
    I have some facts which contains data according to the selected month (From Prompt).
    As of now the column names are:
    Curr, Next1, Next2, Next3 which displays the data for the months accordingly to the selected month from prompt.
    Data is coming correctly but on the report the column name are displayed as Curr, Next1, Next2 and Next3 which I want to be displayed as the month name for which it contains data.
    How can I do that? I have tried presentation variables to be used in custom heading but that is only as string.
    Thanks in advance !!!
    Regards,
    S Anand
    Edited by: S Anand on Nov 20, 2009 2:29 AM
    Edited by: S Anand on Nov 20, 2009 2:29 AM

    My scenario is little different, let me explain:
    My columns will remain same but values changes (based on column formula) according to the selected prompt value
    If I select 'Oct' from prompt then
    Curr will contain data for 'Oct' only
    Next1 will contain data for 'Nov' only
    Next2 will contain data for 'Dec' only
    Next3 will contain data for 'Jan' of next year only.
    Later if I select 'Jul' from prompt then
    Curr will contain data for 'Jul' only
    Next1 will contain data for 'Aug' only
    Next2 will contain data for 'Sep' only
    Next3 will contain data for 'Oct' only.
    I don't have different columns for each months but the columns are capable to reflect data for any month.
    So, how can I reflect the column name as month name for which that contains data.
    Regards,
    S Anand

  • Can i change the column width in a table row dynamically

    Hi,
    There are two columns in one of the row of the table, can i change the width of the cells dynamically.
    Sometimes one of them will be blank and the other cell has to print the entire string .
    Left cell is left aligned and the right cell is right aligned.
    I tried to change the width using field.W but it didnot work.
    Regards,
    Sobhan

    Hi,
    We can change the column width of a column dynamically. Try the javascript code in the appropriate event.
    Table.columnWidths = "2in 3in 4in 5in";
    Thanks & Regards,
    Sanoosh

Maybe you are looking for

  • Can't transfer tunes to ipod

    I have a 60GB ipod and since upgrading to itunes 7.0, every time I try to transfer my library, I get the error message: "ipod cannot be updated. The disk could not be read from or written to" I've tried the all the advice at http://docs.info.apple.co

  • Creating a job

    hi , sql developer 4.0.2 i want to run a batch file (.bat) every day , so i did that " scheduler > job(wizard) > job type(executable) > selected the .bat file > when to execute a job(Repeating) > clicked the edit button for " repeat interval " > in t

  • Lightroom 5 is distorting my images in Develop view

    When working on images in Develop, Lightroom 5 is distorting them. For example, let's say I'm looking at an image in Library view (fig.1), then switch to Develop view (fig.2) - the image is suddenly compressed horizontally (or stretched vertically, h

  • My phone was stolen how do i retrieve my contacts on a new phone

    My phone was stolen how do i retrieve my contacts on a new phone?

  • Where clause with null values

    I need to have a where clause but either/both of the two attributes compared could be null. How can I make this work, atm it just returns no records even though rows do exist. Thanks