473,473 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

alter table syntax

7 New Member
hello experts,

i'm having a problem in this synatx

alter table <table name> drop column <column name>

alter tabel <table name> rename column <old column name> to <new column name>

actually this syntax aren't working in oracle 8i whether it will work in 9i ?. can anyone suggest me pls. and also can anyone tell me the difference between 8i and 9i?
May 22 '07 #1
6 5568
frozenmist
179 Recognized Expert New Member
Hi,
Its working in 9i.
Please check if it is a syntax problem or a problem with the column you are trying to drop. If there is a primary key , foreign key or any such constraints on that column error can be raised.

So try
alter table <table name> drop column <column name> CASCADE CONSTRAINTS;

Hope it is useful
Cheers
May 22 '07 #2
sushjames
7 New Member
hi frozenmist,

I had tried this syntax in oralce 8i but still it's not working. Are you sure that this syntax is working in oracle 9i bcoz if it's working in oracle 9i then i will upgrade my oracle 8i to 9i. Can you pls confirm it.. thanx in advance
May 22 '07 #3
frozenmist
179 Recognized Expert New Member
Hi,
I am working on Oracle 9i and I have tired out the query. Its working fine.
So it should work.

Cheers
May 22 '07 #4
sushjames
7 New Member
Hi,
I am working on Oracle 9i and I have tired out the query. Its working fine.
So it should work.

Cheers

Thanx dude! and Can you tell me anything about OCP Exam?
May 22 '07 #5
frozenmist
179 Recognized Expert New Member
No idea , i have never taken it.
May be some one else can help you.
Cheers.
May 22 '07 #6
debasisdas
8,127 Recognized Expert Expert
dear sush

your syntax is right

to rename any column try the command on version 10g ,it may not work on earlier versions.
May 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephen Miller | last post by:
Is it possible to ALTER a temporary table in TSQL (SQL2000)? The following TSQL reports a syntax error at the ALTER TABLE line: DECLARE @Test TABLE( NOT NULL , NOT NULL ) ALTER TABLE...
2
by: me | last post by:
I would like to add an Identity to an existing column in a table using a stored procedure then add records to the table and then remove the identity after the records have been added or something...
6
by: Brian Basquille | last post by:
Just started learning SQL recently. But one thing i'm still not clear on is about altering relationships between tables after they've been created. Instead of creating a foreign key when the...
1
by: Rajesh Kumar Mallah | last post by:
Hi , Looks like ADD UNIQUE( some_fuc( some_feild) ) is not supported with add constraint. the only way is to add the constriant is using UNIQUE INDEX . Is it a bug or intended behaviour? ...
10
by: Jane | last post by:
Does any one know why this statement is failing? db2 => ALTER TABLE ELMT_T ALTER COLUMN CDTY_CD SET DATA TYPE VARCHAR(51) DB21034E The command was processed as an SQL statement because it was...
5
by: Mike L | last post by:
Hello all I'm trying to migrate a BE from Access to SQL Server. I've been making changes to the Access BE from the FE with SQL statements, and want to do the same with the BE in SQL Server. ...
3
by: Kimi | last post by:
Hi, I'm trying to change a column on a DB2 table so that it has a default value but I cannot get it to work. Does anyone have any experience in this area. I'm trying with this statement: ...
3
by: sparks | last post by:
several months ago I was trying to set the field size of text fields in a table and Lyle Fairfield was nice enought to post a way using alter column. it was surprising since it was ALTER COLUMN...
3
by: Deano | last post by:
Hi, I just want to add a text column to a table in my code. I can't find a simple example of this. dbs.Execute ("ALTER tblCCOccurrences ADD COLUMN Year1 Text;"). This gives me; Syntax...
3
by: BD | last post by:
Hi, folks. Sorry about this - I have been R'ing all TFM's I can find, but am just getting more frustrated. Background: db2 UDB 8.1 on Windows. I'm quite new to db2, but have several...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.