Renaming columns in 8i

I have tried in vain to rename a column in 8i. There are no good examples out there. Here's my code
SQL> DESC KKQA_CLINIC_CD
Name Null? Type
CLINIC_CD NOT NULL VARCHAR2(15)
REC_EFFENDDT NOT NULL DATE
REC_EFFDT NOT NULL DATE
IDX_NM VARCHAR2(60)
DEPT VARCHAR2(30)
SUBDEPT VARCHAR2(30)
CLINIC_CD_DESC VARCHAR2(150)
MIM_CODES_CLINIC VARCHAR2(1)
HOSPITAL_BASED VARCHAR2(15)
REG_SOURCE VARCHAR2(15)
SQL> ALTER TABLE KKQA_CLINIC_CD ADD (CLINIC_CD_EFFENDDT DATE);
Table altered.
SQL> UPDATE KKQA_CLINIC_CD SET CLINIC_CD_EFFENDDT=REC_EFFENDDT;
0 rows updated.
A second attempt to rename another col, yeilds error:
ALTER TABLE KKQA_CLINIC_CD SET CLINIC_CD_EFFDT=REC_EFFDT
ERROR at line 1:
ORA-02000: missing UNUSED keyword
I just can't seem to find any meaningful examples or substance on this problem particularly ora-02000
I have tried the "unused" keyword example, it basically deletes a col. Can someone help, I am thoroughly puzzled.

Hi
Renaming a column is not supported in 8i.
Chris
PS: the syntax is "ALTER TABLE <table name> RENAME COLUMN <old column name> TO <new column name>"

Similar Messages

  • Error while renaming column in Apex 3.2.1

    Hi,
    I am getting the following error while renaming column in Oracle Apex 3.2.1 through SQL workshop:
    "ORA-24344: success with compilation error"
    Interestingly, it only gives an error when I rename the column again to its original name. For example, if I renaming the column X to X1 (no problem) but renaming back to X, I get this error. Same is true for X to X1 to X2 without any issues but renaming back from X2 to either X1 or X, I get the same error.
    Any insight into this issue would be very helpful and greatly appreciated.
    Thanks,
    Milaan

    I've moved a step ahead, getting the new apex screen at http://127.0.0.1:8080/apex/ and can also login to my application. However there is no image for Application Express on http://127.0.0.1:8080/apex/ and I cannot click on the Login button. Hitting http://127.0.0.1:8080/i/ does list down the images. Any clue on what could be the problem?
    For others reference: I'm not sure what was wrong, but I tried the entire steps again, with the 2 changes: shutdown the listener and job process ( in step 3.1) before running 'apexins' and second that I installed on SYSAUX and not USERS (in step 4)
    1. Downloaded apex_3.2.1.zip to C:\Software
    2. unzip apex_3.2.1.zip to C:\Software\apex
    3. started command prompt and set these variables
    set ORACLE_HOME=C:\oraclexe\app\oracle\product\10.2.0\server
    set ORACLE_SID=xe
    set ORACLE_PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin
    set LD_LIBRARY_PATH=C:\oraclexe\app\oracle\product\10.2.0\server\lib
    3.1 Shutdown the listener and job services
    4.
    sqlplus /nolog
    CONNECT SYS as SYSDBA
    @apexins SYSAUX SYSAUX TEMP /i/
    5.
    sqlplus /nolog
    CONNECT SYS as SYSDBA
    @apxchpwd
    6.
    Stopped and Started the Database, also the listener and job processes
    7.
    sqlplus /nolog
    connect sys as sysdba
    @apxldimg.sql c:\software
    8.
    sqlplus /nolog
    connect sys as sysdba
    exec dbms_xdb.setListenerLocalAccess (l_access => FALSE);

  • Rename column name of a table

    Hi Guys,
    I want to rename the column name of a table. Lets say I have table employee:
    SQL> desc emp;
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    ENAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    STARS VARCHAR2(8)
    I want to change the name of the cloumn name of ENAME to EMPNAME so that structure looks like this:
    SQL> desc emp;
    Name Null? Type
    EMPNO NOT NULL NUMBER(4)
    EMPNAME VARCHAR2(10)
    JOB VARCHAR2(9)
    MGR NUMBER(4)
    HIREDATE DATE
    SAL NUMBER(7,2)
    COMM NUMBER(7,2)
    DEPTNO NUMBER(2)
    STARS VARCHAR2(8)
    Can anyone tell me any statement or way to solve this problem. Please keep in mind that I will not delete the table or create another column name of EMPNAME and copy the data from ENAME to EMPNAME.
    Regds,
    Debabrata

    ALTER TABLE DEPT2 RENAME COLUMN ENAME TO EMPNAME
    Regards,
    Raj

  • How to rename column name of table?

    Hello...
    How to rename column name of table?
    The column have data.
    Thanks.
    Martonio.

    The following should work in 9i release 2 and above.
    SQL> create table mytable(col1 varchar2(2),
      2  col2 date);
    Table created.
    SQL> insert into mytable values('t1',sysdate);
    1 row created.
    SQL> select * from mytable;
    CO COL2
    t1 30-NOV-04
    1 row selected.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    COL2                                               DATE
    SQL> alter table mytable rename column col2 to mydate;
    Table altered.
    SQL> desc mytable
    Name                                      Null?    Type
    COL1                                               VARCHAR2(2)
    MYDATE                                             DATE
    SQL> select * from mytable;
    CO MYDATE
    t1 30-NOV-04
    1 row selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.3.0 - Productionhttp://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/wnsql.htm#972698

  • Rename column in Oracle 9i

    Can we rename column in Oracle 9i?
    Thanks,
    Alex

    I don't think it should be that complicated unless you have any contraints to it. Do you have any foreign keys that are referencing to this particular table ? Also let me know what syntax are you using for dropping the column ?
    Also look at the following example, try these things on some test/dummt table first.
    Dropping a Column: Example
    ===========================
    This statement illustrates the drop_column_clause with CASCADE CONSTRAINTS. Assume table t1 is created as follows:
    CREATE TABLE t1 (
    pk NUMBER PRIMARY KEY,
    fk NUMBER,
    c1 NUMBER,
    c2 NUMBER,
    CONSTRAINT ri FOREIGN KEY (fk) REFERENCES t1,
    CONSTRAINT ck1 CHECK (pk > 0 and c1 > 0),
    CONSTRAINT ck2 CHECK (c2 > 0)
    An error will be returned for the following statements:
    /* The next two statements return errors:
    ALTER TABLE t1 DROP (pk); -- pk is a parent key
    ALTER TABLE t1 DROP (c1); -- c1 is referenced by multicolumn
    -- constraint ck1
    Submitting the following statement drops column pk, the primary key constraint, the foreign key constraint, ri, and the check constraint, ck1:
    ALTER TABLE t1 DROP (pk) CASCADE CONSTRAINTS;
    If all columns referenced by the constraints defined on the dropped columns are also dropped, then CASCADE CONSTRAINTS is not required. For example, assuming that no other referential constraints from other tables refer to column pk, then it is valid to submit the following statement without the CASCADE CONSTRAINTS clause:
    ALTER TABLE t1 DROP (pk, fk, c1);
    Shalu

  • Rename columns of list created by external content type in share point 2010

    Hi,
    I want to rename columns of list created by external content type.
    Please help to solve the issue.
    Thanks in advance!
    Regards
    Rajni

    Hi,
    Steps to rename column name:
    Open external content type in SharePoint designer
    click on “Operations Design View” from ribbon
    select corresponding external content type operations
    click on edit operation from ribbon
    click next button to get the Return parameter configuration page
    select the parameter and change the display name from the properties
    Anandhan.S Remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

  • Renaming columns resulting in breakage of already existing reports

    Hi
    We recently upgraded from 10g to 11g and we faced the following issue related to trailing spaces:
    In 10g we had trailing spaces for few columns which accounts for say around 300 in number. After consistency check, these trailing spaces were shown as warnings in 10g and did not error out any reports. But in 11g, these trailing spaces were shown as errors and resulting in the breakage of already existing reports. To avoid this, we have to delete the trailing spaces along with the aliases. After this, the only process we are aware of, is to re-pull the renamed columns in the existing reports to make them error free. Now we have around 200 reports using these columns and it requires good amount of manual effort to go in. I would like to know, is there any better solution other than re-pulling these columns to keep the reports error free.
    Any suggestions on this will be very helpful and greatly appreciated.
    Thanks

    Hi,
    Refer
    renaming presentation colums
    Re: renaming using rename wizard.
    Re: Renaming Business Model and Subject Area
    Thanks
    Deva
    Edited by: Devarasu on Sep 27, 2011 5:27 PM

  • Rename columns

    Hi
    As input I use an Excel file with ONE worksheet and columns C1old, C2old, C3old...
    As output I use an Excel file with MORE worksheets W1, W2, W3...and columns W1_C1new, W1_C2new, W1_C3new...in worksheet W1, W2_C1new, W2_C2new, W2_C3new...in worksheet W2 and so on.
    In MS-SQL I have a table with 2 columns doing such mapping (renaming):
    C1old    W1_C1new
    C2old    W1_C2new
    C3old    W1_C3new
    C4old    W2_C1new
    C5old    W2_C2new
    How to implement it in SSIS?
    If it's too difficult I better write a macro (VBA) to simply rename columns and put them on the right worksheets according to the MS-SQL table.
    Thanks a lot!
    gec

    Hi Mecu9,
    Does the suggestions above solve your issue? If the issue persists, please post the detail information about your issue, so that we can make further analysis.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Rename columns in Presentaion Layer

    Hi,
    I need to change the column names in the Presentaion Layer. I need only the beginning of the word to be uppercase. Do I have to go to BMM layer and use the rename wizard and get all the columns again to presentation layer. We have a lot of columns so manually doing it would be very time consuming. I am trying to do in Presenation Layer itself using Rename wizard but somehow the 'next' field is not highlighted to go to the next step. Any suggestions? Also if I change any column name in presentation layer manually do I also have to chnage the name in BMM layer as well.

    Hi,
    Keeping the column names consistent in BMM and presntation layer is best suggested as diffrent names in both the layers can lead to confusion .As Aliastair suggested if you rename in presentation layer then it will create aliases to Old names,If someone delete that alias then you will get view display error in report.So follow a simple approach and keep names consistent in both the layesr unless and until its very urgent to rename columns in presentation layer.
    Thanks
    Sandeep
    Edited by: Sandeep Saini on 23-Jul-2010 08:34

  • Rename column name

    Can i rename column name of a table. If so how to do it????

    before 9i
    Renaming a column in table:
    ==========================
    This is possible by updating the "name" column of the col$. To reflect this
    change in the system views, run catalog.sql and catproc.sql.
    Here is an example:
    SQL> create table test(
    x number,
    y varchar2(10),
    z varchar2(10));
    SQL> insert into test values (12,'Child','BLUE');
    SQL> insert into test values (34,'Mens','BROWN');
    If you wanted to rename column "x" as column "x1" then do the following.
    The first step is to identify the object number for the table (as SYS):
    SQL> select obj# from obj$
    where name='TEST' and owner#=9;
    OBJ#
    ======
    58217
    Now identify the column numbers for the table:
    SQL> select obj#, col#, name from col$ where obj#=58217;
    OBJ# COL# NAME
    58217 1 X
    58217 2 Y
    58217 3 Z
    To change the name, a simple update statement will suffice:
    update col$ set name='X1'
    where obj#=58217 and col#=1;
    To reflect the change in system views, run catalog and catproc (unix) eg:
    svrmgr> @$ORACLE_HOME/rdbms/admin/catalog
    svrmgr> @$ORACLE_HOME/rdbms/admin/catproc
    Now when a describe of the table is done:
    SQL> desc test;
    Name Null ? Type
    X1 NUMBER
    Y VARCHAR2(10)
    Z VARCHAR2(10)
    Similarly, selecting from the table and querying views such as
    DBA_TAB_COLUMNS shows the new column name.
    NOTE: Before changing column names, drop any indexes,
    foreign keys and primary constraints that might be on
    the column. These can be re-created later.

  • Rename column !!

    Can oracle 8i gives a facility to rename column ? How ?
    Thanks in Adv.

    Its a bit longer process but u can do it:
    SELECT obj#
    FROM sys.obj#
    WHERE name = '<your_table_name>';
    SELECT col#
    FROM sys.col$
    WHERE obj# = <obj# from the above query>
    AND name = '<column_name>';
    UPDATE sys.col$
    SET name = '<new_column_name>'
    WHERE obj# = <obj# used in the above query>
    AND col# = <col# from the above query>;
    It won't show the effect immediately. So use this:
    ALTER SYSTEM FLUSH SHARED_POOL;
    Now describe the table and find the new column name :)
    Hope this helps.
    -Rajeev

  • Rename Column in Table

    Hi
    It's anyway to rename a column name in the Table name?
    For info I using Oracle DB 9.2
    regards
    wisman

    Under no circumstances should you change the data dictionary unless:[list=1]
    [*]Oracle support tells you to;
    [*]you really want to re-build your database.
    [list]
    Point 2 is not likely but it is a real possibility so take a full backup.
    If you are on 8i the proper way to do it is this:[list=1]
    [*]ALTER TABLE my_table ADD (new_name varchar2(10));
    [*]UPDATE my_table SET new_name = old_name;
    [*]ALTER TABLE my_table DROP COLUMN (old_name);
    [list]
    Obviously you'll need to handle integrity constraints, etc.
    If you are on 9i you can do this:
    ALTER TABLE my_table RENAME COLUMN old_name TO new_name;Cash back! APC

  • Renaming columns in 9i - sp

    Here is a stored proc we use to rename columns. It's not bulletproof, but it will get you started:
    create or replace procedure &&1.RenameColumn(uid IN varchar2,tablename IN varchar2,oldcolumn IN varchar2,newcolumn IN varchar2)
    as
         dt varchar2(106);
         dl number;
         dp number;
         ds number;
         nulls varchar2(1);
         dd long;
         buildstring varchar2(128);
         alteraddstring varchar2(256);
         alterdropstring varchar2(256);
         updatestring varchar2(128);
    begin
         SELECT data_type,data_length,data_precision,data_scale,nullable,data_default
         INTO dt,dl,dp,ds,nulls,dd
         FROM all_tab_columns
         WHERE UPPER(owner)=UPPER(uid) and UPPER(table_name)=UPPER(tablename)
         and UPPER(column_name)=UPPER(oldcolumn);
         CASE
         WHEN dt='CHAR'
              THEN
                   IF dl IS NOT NULL THEN
                        buildstring:=dt||' '||'('||dl||')';
                   ELSE
                        buildstring:=dt;
                   END IF;
         WHEN dt='DATE'
              THEN
                   buildstring:=dt;
         WHEN substr(dt,1,9)='TIMESTAMP'
              THEN
                   buildstring:=dt;
         WHEN dt='VARCHAR'
              THEN
                   IF dl IS NOT NULL THEN
                        buildstring:=dt||' '||'('||dl||')';
                   ELSE
                        buildstring:=dt;
                   END IF;
         WHEN dt='VARCHAR2'
              THEN
                   IF dl IS NOT NULL THEN
                        buildstring:=dt||' '||'('||dl||')';
                   ELSE
                        buildstring:=dt;
                   END IF;
         WHEN dt='NUMBER'
              THEN
                   buildstring:=dt;
                   IF dp IS NOT NULL THEN
                        buildstring:=buildstring||' '||'('||dp;
                        IF ds IS NOT NULL THEN
                             buildstring:=buildstring||','||ds;
                        END IF;
                        buildstring:=buildstring||')';
                   END IF;
         END CASE;
         IF nulls = 'N' THEN
              buildstring:=buildstring||' NOT NULL';
         END IF;
         IF dd is not null THEN
              IF dt='NUMBER' THEN
                   buildstring:=buildstring||' DEFAULT '||dd;
              ELSE
                   buildstring:=buildstring||' DEFAULT '''||dd||'''';
              END IF;
         END IF;
         dbms_output.put_line('String: ' || buildstring);
         alteraddstring:='alter table '||tablename||' add ('||newcolumn||' '||buildstring||')';
         dbms_output.put_line('AlterAddString: ' || alteraddstring);
         updatestring:='update '||tablename||' set '||newcolumn||'='||oldcolumn||'';
         dbms_output.put_line('UpdateString: ' || updatestring);
         alterdropstring:='alter table '||tablename||' drop column '||oldcolumn||'';
         dbms_output.put_line('DropString: ' || alterdropstring);
    EXECUTE IMMEDIATE alteraddstring;
    EXECUTE IMMEDIATE updatestring;
    EXECUTE IMMEDIATE alterdropstring;
    EXCEPTION
    WHEN OTHERS THEN
         dbms_output.put_line('ERROR executing renamecolumn'||SUBSTR(SQLERRM, 1, 100));
         rollback;
    end;

    Hi
    Renaming a column is not supported in 8i.
    Chris
    PS: the syntax is "ALTER TABLE <table name> RENAME COLUMN <old column name> TO <new column name>"

  • Renaming column giving error

    alter table tablename change oldcolumnnname to newcolumnname;
    but it has given partition or subpartition keyword is missing
    please suggest ..
    db: oracle 11g
    regards
    raj

    raj_fresher wrote:
    alter table mytabl rename column old_col to new_col
    this gives me the errorIt shouldn't, 11g too:
    SQL> alter table test_tab rename column x to y;
    Table altered.

  • Problem renaming column in Management Studio 2012

    After importing spreadsheet data with no column headings, I notes that SSMS provided column names like [Column 1] that contain a space. I think that is strange considering that SQL Server does not particularly like column names that include spaces. I don't
    like column names with spaces because when trying to create ad hoc queries just to analyze data, it becomes necessary to enclose those names in brackets...a real pain.
    So I began renaming columns using the Table Designer in SSMS. I had another spreadsheet open with the column names I wished to use. So I selected and copied from the spreadsheet and tried to paste the new name into the designer. That new name did not appear
    after the paste, so I copied again and pasted. Still no visible name in the designer. So I tried typing it in manually. After saving the change I see that new column name had become the name i wanted but repeated 3 times and concatenated? The column name I
    wanted was REGN_NUM. the saved name is REGN_NUM
    REGN_NUM
    REGN_NUM
    REGN_NUM.
    I just copied that new name from the Object Explorer and notice that line breaks are included. What is going on here?
    I just tried to rename that column again in the Object Explorer interface by right-clicking the column and clicking rename. I back-spaced out the visible letters and then pressed the delete key several times just in case there were trailing line feeds. During
    the renaming there looks to be the name I want in place before I click out of the rename input field. But low and behold, the quadruplicated name again appears. Huh? So I went to the next column, went through the renaming process by typing the new name in,
    and that one saved properly.
    Does anyone know what might be happening here?
    Thanks in advance for any replies.

    >After importing spreadsheet data with no column headings,
    How did you import it?  Use the SSIS Import/Export Wizard, column names can be assigned:
    http://www.sqlusa.com/bestpractices/ssis-wizard/
    Kalman Toth Database & OLAP Architect
    T-SQL Scripts at sqlusa.com
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for