Can we rename a column in a table ?

I am faced with a situation where I need to rename the column in a particular table. The version of Oracle is 8.1.7.2.0
Is there a DDL clause for renaming a column, or does it have to be done the conventional way - drop the column ( you want to rename ) and add a new column (with new name) ?

Direct column renaming is not available unti 9iR2. Prior to that, yes, you need to:
1) Add a column with the new name
2) Update new column with old column data
3) Drop old column

Similar Messages

  • Can we rename a column in Oracle 8.1.7.4 version?

    Can we rename a column in Oracle 8.1.7.4 version?

    Hi,
    There is no direct way of doing it but if you have DBA access then try this: (these 2 tables are in SYS user)
    SELECT obj#
    FROM obj$
    WHERE name = 'your table name';
    SELECT col#
    FROM col$
    WHERE obj# = obj# from above query
    AND name = 'your column name';
    UPDATE col$
    SET name = 'new column name'
    WHERE obj# = obj# from first query
    AND col# = col# from above query;
    And this change might not be immediately visible.
    So once you are done with above, run the following:
    ALTER SYSTEM FLUSH SHARED_POOL;
    Then go to the respective user and describe the table and you will see new name. There might be some mistake in the above queries as I could not test it because I don't have ORACLE on my current system.
    Hope this helps.
    Regards
    -Rajeev

  • Rename a column on a table that has fulltext index on the renaming column

    I have to rename a column on a table, which has an fulltext assigned to the specified column.
    Will this make the fulltext crash or in any other way have a effect to the fulltext search ???
    And/Or do i need to alter the fulltext also ?
    PS: TSQL Example would be nice ;)
    Best regards
    Paw

    Best course of action is to drop the index, rename the column, create the index.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Can we Export selected columns of a table in ADF 11g

    Hi,
    My problem is I want a table to be exported to Excel format.But my condition is only particular cloumns of a table to be exported not all the visible columns of the table.
    For example, I have 8 cloumns in a table.I need pre-determined 5 cloumns only to be exported into Excel format.I dont want to use PanelCollection Views-->Collumns to be sellected.
    Sorry,I dont know whether this is a valid question or not.But Im looking for this condition.
    Can you please help me.
    Regards,
    Felix

    I dont know how to continue.
    I have emloyee table in the HRSchema.
    I used employee table in the PanelCollection
    All the collumns are in display.
    Here in a commandButton I use a ExportCollectionListener for which id i used the employee table id.
    If I click the button it exports all collumns
    I dont know what condition I can give in the EL expression in the render or visible property of the collumn.
    can you please give further more ideas,
    Regards,
    Felix

  • Where can I find the column declarations of table X$BH? or X$ tables?

    Hi all,
    does anyone know where can I find the column declarations for each X$ tables?
    I did some googling and with no luck.
    So, hoping that I can get some help here!
    Thanks in advance!

    PhoenixBai wrote:
    does anyone know where can I find the column declarations for each X$ tables?X$ tables are not "real" tables. They are similar to the +/proc+ file system on Linux that looks like a file system with directories and files, but is actually a view into kernel memory structures.
    X$ tables are a view of internal Oracle kernel memory structures. And you need to be careful how you use these - not just how you interpret the data in them. Some structures when touched (using a select against that X$ table), will actually reset the values in the struct. (e.g. <i>X$KSMLRU - LRU flushes from the shared pool - (7.3 - 8.1) [ID 43600.1]</i>).
    The basic question you need to ask yourself is what are you looking for using the X$ views into the internals of Oracle? Why are you not using the V$ and GV$ views instead? - these are what 99% of all dba admins and experts and tools use. The times that one need to dig into X$ views (that are mostly undocumented and can have major changes from version to version) are very rare. And requires at least some basic knowledge of how databases and operating systems work internally.

  • How can I change a column name in table (JDeveloper 10.1.3.3)?

    I'd like to change a table column name, for example instead of "FirstName" I'd like "Name".
    Here is the preview: http://img208.imagevenue.com/img.php?image=86575_firstname_122_578lo.JPG
    Thank You in advance!

    Now I have following problem: When I change "Label text" to column which has "Combo box" (Department insted of DepartmentId) I do not have my combo box anymore, just DepartmentId (Number). I have created binding... (DepartmentId -> Department Name) Why is this happening?
    http://img151.imagevenue.com/img.php?image=47670_firstname_122_862lo.JPG
    Can I change my attribute name in data model?
    BTW I use ADFBC Swing
    Sorry on my bad English ...
    thank you
    Message was edited by:
    user638810
    Message was edited by:
    user638810
    Message was edited by:
    user638810

  • Can you hide a column in a table within a Pages document?

    Is it possible to have a table within a Pages document that allows you to hide columns..... I am trying to make a template for client quotations that requires a column containing discounts which needs to be hidden before I print. Haven't figured out how to make this happen.... can it be done?.... works in Numbers[as per XL] but not in Pages
    many thanks
    Gary

    One of my biggest grievances with Forms Central is the lack of any kind of calculating (living in hope Adobe!)... you will have to do it in Excel.

  • How to rename a column

    i cannot rename a column in a table;
    i tried so many sql statements but with no results;
    i use the following:
    alter table tablename rename column old_column to new_columnname;

    In other case you can create a view on that table to rename the columns like
    SQL> select empno, ename, job from scott.emp;
         EMPNO ENAME      JOB
          7369 SMITH      CLERK
          7499 ALLEN      SALESMAN
          7521 WARD       SALESMAN
          7566 JONES      MANAGER
          7654 MARTIN     SALESMAN
          7698 BLAKE      MANAGER
          7782 CLARK      MANAGER
          7788 SCOTT      ANALYST
          7839 KING       PRESIDENT
          7844 TURNER     SALESMAN
          7876 ADAMS      CLERK
         EMPNO ENAME      JOB
          7900 JAMES      CLERK
          7902 FORD       ANALYST
          7934 MILLER     CLERK
    14 rows selected.
    SQL> create or replace view emp_vw as select empno as emp_no, Ename as Employee_Name, job from scott.emp;
    View created.
    SQL> select * from emp_vw;
        EMP_NO EMPLOYEE_NAME        JOB
          7369 SMITH                CLERK
          7499 ALLEN                SALESMAN
          7521 WARD                 SALESMAN
          7566 JONES                MANAGER
          7654 MARTIN               SALESMAN
          7698 BLAKE                MANAGER
          7782 CLARK                MANAGER
          7788 SCOTT                ANALYST
          7839 KING                 PRESIDENT
          7844 TURNER               SALESMAN
          7876 ADAMS                CLERK
        EMP_NO EMPLOYEE_NAME        JOB
          7900 JAMES                CLERK
          7902 FORD                 ANALYST
          7934 MILLER               CLERK
    14 rows selected.
    SQL>

  • Is there any option in oracle 10g to rename a column?

    Hi friends,
    Is there any option in oracle 10g to rename a column? Please send me reply....Waiting for that...

    You can even rename a column in oracle 8i or 9i
    E.g:
    ALTER TABLE TABLE_NAME RENAME COLUMN OLD_COLUMN_NAME TO NEW_COLUMN_NAME;Message was edited by:
    Mohana Kumari

  • Indexing multiple columns in multiple tables

    I have a multiple tables in which I want to search. I need to do text search that supports fuzzy logic for which I've currently set up a context index using the user_datastore. I also need to search columns such as numbers/dates/timestamps which from what I understand is not supported with the context search. I'm looking at setting up a second index of type ctxcat for this purpose - but I will need to index multiple columns in multiple tables. Is this possible?
    Can someone advise on the best way to create indexes and search when a table schema such as the following exists. I've tried to keep it simple by just giving a few example columns and tables.
    Order Table
    - Has columns related to the order details - order name (varchar2), description (varchar2), date order placed (timestamp), date order completed (date), order amount (number), customer Id
    Customer Table
    - Has columns related to the customer information - customer name, address, city, state, telephone etc (all varchar2 fields)
    Items Table
    - Has details about the items being ordered - item name (varchar2), item description (varchar2), cost (number) etc
    Order-Item Table
    - Table that maps an order to the items in that order - orderId, itemId, quantity
    Comments Table
    - Logs any comments with the customer - comment description (varchar2), call type (varchar2), comment date (timestamp)
    Currently with the Context index, I have it set up so I can search all text columns in all tables for a search term. This works fine.
    I now need to be able to do more advanced searches, where I can search for a specific text in all orders as well as orders created after a certain date or orders above a certain amount or orders with a item quantity purchase of more that 10. The text has to be searched across the all text columns in all tables. How can I achieve this with Oracle Text?

    There was a similar discussion with various ideas that may help you here:
    How can I make CONTAINS query work for a date range

  • Index Multiple Column of Multiple Tables

    Hi All,
    I would like to know how to create a index which can search through all column in my database tables. Eg: I have 30
    tables and every tables have around 10 columns. I want to create a index which can search through the columns in
    these tables.
    I know that User_DataStore can helps in create multiple column search across multiple tables. But in my case the BLOB
    created will be very huge. Any work around? I mean is there any solutions like concatenated datastore?
    Thank You.
    Regards,
    LG Tan

    Hi,
    I figured out how to do this today. The first thing is that the type of index you need is a USER_DATASTORE.
    The idea behind this type of index is pretty straight forward but the documentation does a very good job of not drawing attention to just how powerful it is.
    The idea behind a USER_DATASTORE is that you can write your own stored procedure to extract the data that you want to index and return it to the indexer. Take an example where you have a master table which contains enough information to allow you to find associated data in other tables i.e. a shared key. The idea is that when you set up a USER_DATASTORE index, you specify the name of a stored procedure that the indexer will call for each row in the master table. The stored procedure has one input and one output parameter, rowid (in) and clob (out).
    When the index is created, the stored procedure you specify is, as I said above, called for each row in the master table. Your stored procedure uses this ROWID to extract the shared key (this can be anything you want) from the master table and uses this to build the necessary SELECT statement to retrieve the related data from the other tables. The rest of the stored procedure simply appends the data returned from your select statement to the return CLOB. The indexer then indexes the inforamation in this CLOB and discards the data.
    The index can of course only return hits against the master table. It's up to your application to extract shared key from the returned row(s), bind to the other tables and present the results.
    You will find a basic example of how to implement USER_DATASTORES in the Oracle Text Reference Guide (http://download.oracle.com/otndoc/oracle9i/901_doc/text.901/a90121.pdf). Feel free to email me if you want some example code.
    Dean

  • 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 get one column of ALV table as dropdown by key.

    Hi experts,
                  How can I get one column of ALV table as dropdown and editable. If  user wants to change that column value he can just select from that dropdown and click on update button. Can I provide tool tip to that column as " Select from drop down to change the status "?
      Please Help.
    Thanks,
      Pratibha

    You just need to change the cell editor of that column in ALV.
    So first get access to the alv model object (adjusting the code below for your ALV Component Usage name - mine was ALV_ADV):
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_adv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    Then access the column object you want to change:
    DATA l_column TYPE REF TO cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'REGION' ).
    Then create the cell editor for DDLB and set it as the new cell editor for this column:
    DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
      create object ddlb
        exporting
          selected_key_fieldname = 'REGION'.
      ddlb->set_tooltip( `Select from drop down to change the status` ).
      l_column->set_cell_editor( ddlb ).

  • I need add column in a table

    can someone tell me how can i add a column in a table somewhere in midle, i don't won't this column at the end of table. this table already have about 500 rows. the column i am adding it is null. can someone tell me how can i do that without losing any data.
    i am using oracle 9.2.0.7
    Thanks

    the question is there is a way to do it instead of investagating why and so.... Well, it was for you to investigate actually to ponder on the question if it is worth it.
    Anyway, I did provide you the way you would do it, if you do decide to do it.
    Did you read till the end of the post?

  • All columns of all table in one schema

    Hi
    All,
    Oralce 10.2.0.3
    I want to count all columns in all the table in one particular schema.
    How can I do that?
    which view i should use to count all cloumns of all tables in particular schema?
    Thanks

    vishal patel wrote:
    we needed for our data conversion project..I don't know how you'll use the number of columns in all a schema for data conversion. Some columns are duplicated (e.g. PK/FK), should they really count for two ?
    A data conversion means you should actually know what are the columns used for, not how many they are.
    one more question that count include hidden columns
    what is hidden column used for ? I can not see those columns in actual table.See here an example :
    Re: Difference btwn user_tab_cols & user_tab_columns
    Nicolas.

Maybe you are looking for