Changing a column postion from say 5th to 1st

Hi there,
i need some help on changing a column position to a preferred
position.
Can an 'Alter' statement do it. Whether yes or no, how?
---My table
create table new_employee(
empno number(4),
ename varchar2(25),
job varchar2(15),
deptno number(2),
title varchar2(2)'
sex varchar(1)'
constraint pk_new_employee primary key (empno),
constraint fk_new_employee foreign key (deptno) references dept);
How can I make 'title' column become the first column.
Much appreciation in advance.
Ayo

The only way to physically change the order of columns in a
table is to drop the table and re-create it with the order you
want. This is, however, completely unneccessary. The physical
order of the columns is meaningless in Oracle. You can index on
any column or set of columns in any order regardless of where
they are in the physical order.
If you want to get title as the first column, you simply select
it first when you query the table.
SELECT title, empno, ename
FROM new_employee
The only time that the physical order of the columns matters is
when you do an insert statement without a column list. For
example, given your table, and the following data:
empno        123
ename        SMITH
job          CLERK
deptno       20
TITLE        SR. CLERK
SEX          M
This insert statement will work:
INSERT INTO new_employee
VALUES (123,'SMITH','CLERK',20,
        'SR. CLERK','M')
This one will not:
INSERT INTO new_employee
VALUES ('SR. CLERK',123,'SMITH','CLERK',
        20,'M')
This one will:
INSERT INTO new_employees
    (title,empno,ename,job,deptno,sex)
VALUES ('SR. CLERK',123,'SMITH','CLERK',
        20,'M')As long as you tell Oracle in which order the column values are
passed, you can populate the columns in any order.

Similar Messages

  • Changing the column postion in table control

    Hi All,
    In table control i want to change the columns postion according to users requirement.
    How to do that?
    Thanks for advance.
    Regards,
    krishna

    Hi,
      In the top right hand side of the table control..there will be button for variant..
      there you can create a variant..in the variant..you can move the columns around and save it as variant..then they can choose the variant..
    Thanks
    Naren

  • Need to change the column constrain from NOT NULL to NULL

    Hi,
    My requriment is I have to change the column constraint (NOT NULL) to NULLable (column having data), I used below query for that
    alter table table_name modify transaction_cost2 default null
    even command is successfull, but column constrain is still NOT NULL.
    can you any one help on this.. ( steps to change column constain from not null to null)
    Thanks,

    ALTER TABLE table_name
      MODIFY( transaction_cost2 NUMBER NULL )That assumes that the data type of the TRANSACTION_COST2 column is NUMBER-- you'll want to use the current data type if it is something else. I'm hoping that the fact that you have a column named TRANSACTION_COST2 doesn't imply that you have an incorrectly normalized data model. But the name of the column certainly implies that you do.
    Justin

  • How can we change the column sequence from 1st to 7th position

    Hi
    I have a table in which I have a column naming DNAME and it is is on the first position I want to change its position to 7 that is the last one. The table is huge filled with data.
    Is there ant way in which I can cange the position of the column with out recreating in into another table and then renaming it.
    Thanks

    Hello,
    The sequence of a column in a table is meaningless and you should treat it as such. The column ordering you see when you run a "select * from ..." query is based on the physical implementation of the table, which is completely separate from the logical interpretation, and should not be relied on in a programmatic context. It should essentially be viewed as "random" and prone to change with the physical storage properties of the table (although this is not always the case, there is no assurance of this).
    One way to do this (which happens to be the easiest and least resource-intensive in this case) is to create a view (derived relation) of the base table, with the columns ordered in the specific sequence you desire. But really, the column ordering here is still meaningless, and the only time your application should rely on the order is when you specifically list the columns you require in a query -- but NEVER a "select *".
    cheers,
    Anthony

  • How to change the column postion in Dynamic Table

    Folks,
    I have an ess application which is creating dynamic table from dynamic node, I need to change one of the column position , please let me know how to do
    Thanks,
    Manish

    problem solved

  • DATAEXPORT to RDBMS - changing column dim from Accounts to Time

    While performing a DATAEXPORT to Oracle using DSN, the format of the table created has the members of the Accounts dimension in the columns and the other dimensions in the rows. Is is possible to change the column dimension from Accounts to Time while exporting data to RDBMS using the DATAEXPORT command?
    The problem is that I have around 1000 members in the Accounts dimension and cannot have that many columns in my table. Is it possible to manually define the column dimension while using the DATAEXPORT command? I can use the Jexport cdf, but I am not sure if I will get the same performance as the DATAEXPORT with the bulk insert options.
    Thanks,
    FJ

    Thanks for the quick reply, Glenn.
    But, I did go through the technical reference and it mentions that the DataExportColHeader option can only be used with text files and I am trying to export to a relational database.
    Regards,
    Francis

  • Change download columns from report

    Hi! I have a report, with some columns and I'd like to change the columns when downloading as csv file.
    Let's say that I have a report with col1,col2, col3,col4 and some hidden columns: col5, col6, col7. When I download the file I'd like to have only
    col2, col3, col6, col7.
    How can I do this?
    Thanks!

    Currently there is no way to do this. The CSV export function just re-runs the exact same report as you see it on the screen and transforms it to CSV format.
    Another option is to create a report with the columns you want in the CSV on another page, and use the export:CSV template as in
    http://tinypic.com/jzya2t.jpg
    and provide a link to that page. This will run that page and instead of showing the page it will popup the File download box.
    Hope this helps.

  • How to change the column value which is coming from DO by a calculated field?

    Hi all,
    I want to change a column value based on my calculated field value. I have a column which is coming from DO which is based on External Data Source. I have a calculated field in my report. When there is any change in the calculated field then the column which is coming from DO needs to be changed. It means the DO needs to get updated when there is a change in the calculated field. Or like if the calculated field meets some condition then I need to change/update the same in the DO. This has to be done on the fly. the report should not submitted for this. when there is a change in the calculated column the DO column needs to get updated.
    Thanks,
    Venky.

    Ok, I've been a customer for very many years, I'm on a fixed retirement
    income.  I need to reduce my bills, my contract ends in  Dec. I will be
    pursuing other options unless I can get some concessions from Verizon.  My
    future son-in-law was given this loyalty plan, so I know this is a
    reasonable request.  My phone number is (removed)  acct number
    (removed)
    >> Personal information removed to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • I created an new apple id and want to change my billing information from the old id to the new id. How do i do that, as i have been trying it like always and it keeps saying that i have to contact apple support? I have an iphone 5S.

    I created an new apple id and want to change my billing information from the old id to the new id. How do i do that, as i have been trying it like always and it keeps saying that i have to contact apple support? I have an iphone 5S.

    Good day BenithaK,
    Once you have changed your Apple ID, you need to set it up for use in the various systems such as iTunes, the App Store, etc so it can be used as intended. This article shows how to do that -
    Apple ID: What to do after you change your Apple ID - Apple Support
    To change your iTunes billing information for either Apple ID account, follow the directions in this article -
    iTunes 12 for Mac: Manage your iTunes Store account
    Thanks for using Apple Support Communities.
    Safe computing,
    Brett L 

  • Change Column Header from Crosstab

    Hi, can I change the column's header from a crosstab in a JSP?, by example, I have a crosstab with one column where the header said "Product", and I want to change it to "Product A".
    thanks.

    Hi,
    by making use of specific report column templates and column template conditions you can change the headers dynamically.
    See this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/ui_templt.htm#HTMDB25708 for more info.
    regards,
    Erik-jan

  • I can't save previous word files I have into iWork's, I have dropped the file into pages, but it says it can't convert text, even though I have changed a selective fond from pages

    I can't save previous word files I have into iWork's, I have dropped the file into pages, but it says it can't convert text, even though I have changed a selective fond from pages! Help!

    Take us through this in more detail.
    What is the Word file? From a PC?
    What version of Word and what is the file extension?
    What is it about the text that is different?
    When you say fond do you mean font/typeface? If so what font, and is it on your Mac? Is there something special/different about this font?
    Peter

  • Change mail's from column (received from)

    I am trying out the LetterBox plugin for Mail (to get 3 vertical panels rather than the two horizontal panels). The only thing is, the "From" column shows the address, and I rather it show the smart name if I have them in my Address Book (to save some space in the panel & to make it look cleaner).
    I know that I can get the e-mail header to show the smart name rather than the address, but what about the "From" column?

    I don't think you can change this. The from column uses whatever name the sender has supplied, without the email address, so "Joe" <[email protected]> will show as Joe. When I view the message, this will be matched against my address book and the name from the address book will be used in the viewing pane. If the sender has supplied only an email address without enclosing angle brackets this will be used in the from column. If they supply only an email address enclosed in angle brackets then the bracketed form will be used twice in the from column. This last has to be a bug!
    AK

  • E-mail from saying Your account info Has Changed

    e-mail from saying Your account info Has Changed

    If it's asking you to confirm account information or anything else of a personal nature, it's almost certainly a fake. See:
    http://support.apple.com/kb/HT4933
    Regards.

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • Change a column name

    What is the correct syntax to change a column name. say
    ID VARCHAR2(10)
    to
    ID_NO VARCHAR2(10)

    You can alternatively do this:
    Connect as sys user and run the following script:
    SELECT obj# from obj$
    where name = 'Your_Table_Name';
    SELECT col# from col$
    where obj# = obj# from previous query
    and name = 'your_column_name which you want to rename';
    update col$ set name = 'your_new_name'
    where obj# = obj# from the first query
    and col# = col# from previous query;
    Alter system flush shared_pool;
    connect as your user and you will see the change there.
    Hope this helps
    Rajeev

Maybe you are looking for