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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Drop column from a table-You can with SQL++

Re: Drop column from a table-You can with SQL++

From: M. Armaghan Saqib <armaghan_at_yahoo.com>
Date: Mon, 17 Jan 2000 09:47:15 GMT
Message-ID: <85uof1$up2$1@nnrp1.deja.com>


Please use my freeware SQLPlusPlus which provides a workaround with a generated script.

With this script in hand, you can now alter a table to your heart content with any changes you like.

SQL> exec s.alttab('dept')
| ALTER TABLE scott.dept DROP CONSTRAINT sys_c001037;
|
| RENAME dept TO dept_old1234;
| CREATE TABLE scott.dept(
| deptno NUMBER(2,0) NOT NULL
| ,dname VARCHAR2(14) NULL
| ,loc VARCHAR2(13) NULL
| );
|
| INSERT INTO scott.dept(
| deptno,
| dname,
| loc)
| SELECT
| deptno,
| dname,
| loc FROM scott.dept_old1234;
|
| ALTER TABLE scott.dept ADD CONSTRAINT
| sys_c001037 PRIMARY KEY (
| deptno
| );
|
| CREATE INDEX scott.sys_c001037 ON SCOTT.DEPT(
| deptno
| );
|
| 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;

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/
+---------------------------------------------------------------

In article <SqOf4.43416$g12.1170813_at_news2.rdc1.on.home.com>,   "Paul Q" <paulq_at_home.com> wrote:

> Not in 7.3.4 .. upgrade to 8i
>
> or create new_table as select fields_you_want from old_table
>
> "JMH" <JMH_at_badlands.com> wrote in message
> news:85oa2u$e81$1_at_bob.news.rcn.net...
> > I'm using Oracle 7.3.4 and have decided to move two columns from one
> > table to another table. I would have thought I could just do an
ALTER
> > command but that doesn't seem to work and I cannot find any example
> > for check my syntax. Here's the statement:
> >
> > alter table T drop column C
> >
> > I also tried without teh "column" bit but got the same results.
> >
> > Can I drop a column from table?
> >
> > JMH


Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Jan 17 2000 - 03:47:15 CST

Original text of this message

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