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: URGENT!!! How can I drop a column???

Re: URGENT!!! How can I drop a column???

From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: 2000/03/20
Message-ID: <8b5kj1$ied$1@nnrp1.deja.com>#1/1

Using SQLPlusPlus (freeware) you could generate a script to alter a table to
your heart's content.

For example to alter DEPT table, we could generate the following script.

SQL> EXEC S2.BLDALT('DEPT','SCOTT')
| ----------------------------------------------------------------------



-
| ALTER TABLE scott.dept DROP CONSTRAINT sys_c0014552;
|
| DROP INDEX scott.sys_c0014552;
|
| RENAME dept TO dept_old1234;
| CREATE TABLE scott.dept(
| deptno NUMBER(2,0) NOT NULL
| ,dname VARCHAR2(14) NULL
| ,loc VARCHAR2(13) NULL
| )
| PCTFREE 10
| PCTUSED 40
| INITRANS 1
| MAXTRANS 255
| TABLESPACE system
| STORAGE(INITIAL 102400
| NEXT 102400
| PCTINCREASE 1
| MINEXTENTS 1
| MAXEXTENTS 300);
|
| INSERT INTO scott.dept(
| deptno,
| dname,
| loc)
| SELECT
| deptno,
| dname,
| loc FROM scott.dept_old1234;
|
| ALTER TABLE scott.dept ADD CONSTRAINT
| sys_c0014552 PRIMARY KEY (
| deptno
| );
|
| CREATE INDEX scott.sys_c0014552 ON SCOTT.DEPT(
| deptno
| )
| PCTFREE 10
| INITRANS 2
| MAXTRANS 255
| TABLESPACE system
| STORAGE(INITIAL 102400
| NEXT 102400
| PCTINCREASE 1
| MINEXTENTS 1
| MAXEXTENTS 300);
|
| GRANT DELETE ON scott.dept TO public;
| GRANT INSERT ON scott.dept TO public;
| GRANT SELECT ON scott.dept TO public;
| GRANT UPDATE ON scott.dept TO public;

PL/SQL procedure successfully completed.

SQL> SPOOL OFF regards,
M. Armaghan Saqib

+---------------------------------------------------------------

| 1. SQL PlusPlus => Add power to SQL Plus command line
| 2. SQL Link for XL => Integrate Oracle with XL
| 3. Oracle CBT with sample GL Accounting System
| Download free: http://www.geocities.com/armaghan/
 +---------------------------------------------------------------

| SQLPlusPlus now on http://www.ioug.org/
| "PL/SQL package that extends SQL*Plus to another dimension.
| Contains a PL/SQL code generator and set of extremely useful
| utilites with extensive documentation." IOUG Web Site
+---------------------------------------------------------------

Emilie Carton <emilie_carton_at_hotmail.com> wrote in message news:8aq654$2rm$1_at_fe1.cs.interbusiness.it... > how can I drop a single column from a table without losing the whole  my

> dates?
> I tried to do with using:
> sql> alter table "table name " drop "column name";
> but it answers me back "missing keyword"...
> How can I solve this problem?
>
> Thanks a lot
> Emilie
>
>
>
>





Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 20 2000 - 00:00:00 CST

Original text of this message

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