Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Drop column from a table-You can with SQL++
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
+---------------------------------------------------------------| 2. SQL Link for XL => Integrate Oracle with XL
| 1. SQL PlusPlus => Add power to SQL Plus command line
+---------------------------------------------------------------
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 anALTER
> > 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