Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Deleting a column from table

Re: Deleting a column from table

From: <mjain_at_my-dejanews.com>
Date: Sat, 07 Nov 1998 08:10:21 GMT
Message-ID: <720v9e$mi5$1@nnrp1.dejanews.com>


Wow Drop Column with Alter Table in 8.i!!

That is a great feature and will save time in using alternatives.

Thanks Tom for this SQL!!

Manoj

In article <3643a625.27365850_at_192.86.155.100>,   tkyte_at_us.oracle.com wrote:
> A copy of this was sent to "Phil Cook" <pncook_at_worldnet.att.net>
> (if that email address didn't require changing)
> On 7 Nov 1998 01:43:15 GMT, you wrote:
>
> >Age-old question, no good answer yet.
> >
> >Two options; create a view with just the columns you want or
> >drop the table and re-create. A number of ways to do this,
> >one way is to export the table, create an ascii file using
> >imp indexfile=xxx and then modify the xxx script. Just
> >be careful if any foreign keys are pointing to the table.
> >
> >Maybe Oracle 9 or 10 will fix this....
> >
> >Phil Cook
>
> 8i :)
>
> SQL*Plus: Release 8.1.3.0.0 - Beta on Fri Nov 6 20:43:25 1998
> (c) Copyright 1998 Oracle Corporation. All rights reserved.
> Connected to:
> Oracle8 Enterprise Edition Release 8.1.3.0.0 - Beta
> With the Partitioning and Objects options
> PL/SQL Release 8.1.3.0.0 - Beta
>
> 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)
>
> SQL> alter table emp drop column job;
>
> Table altered.
>
> SQL> desc emp
> Name Null? Type
> ------------------------------- -------- ----
> EMPNO NOT NULL NUMBER(4)
> ENAME VARCHAR2(10)
> MGR NUMBER(4)
> HIREDATE DATE
> SAL NUMBER(7,2)
> COMM NUMBER(7,2)
> DEPTNO NUMBER(2)
>
> Thomas Kyte
> tkyte_at_us.oracle.com
> Oracle Government
> Herndon VA
>
> --
> http://govt.us.oracle.com/ -- downloadable utilities
>
> ----------------------------------------------------------------------------
> Opinions are mine and do not necessarily reflect those of Oracle Corporation
>
> Anti-Anti Spam Msg: if you want an answer emailed to you,
> you have to make it easy to get email to you. Any bounced
> email will be treated the same way i treat SPAM-- I delete it.
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Sat Nov 07 1998 - 02:10:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US