dropping default constraint [message #157293] |
Wed, 01 February 2006 07:49  |
lijok
Messages: 68 Registered: April 2005
|
Member |
|
|
Hi,
Can some one help me in getting the right syntax for dropping default constraint on a field?
The constraint was added this way
ALTER TABLE ICITEM ADD ITEMTYPE CHAR(1) DEFAULT 'I'
When I try this I get the following error, I tried to look through google but did not get much information on this.
SQL> ALTER TABLE ICITEM MODIFY ITEMTYPE DROP DEFAULT
2 /
ALTER TABLE ICITEM MODIFY ITEMTYPE DROP DEFAULT
*
ERROR at line 1:
ORA-00902: invalid datatype
|
|
|
|
|
Re: dropping default constraint [message #157301 is a reply to message #157293] |
Wed, 01 February 2006 08:09   |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
If you cared to look in the sticky, you would have found a link to the Oracle manuals. Especially the Oracle9i SQL Reference Release 2 (9.2) Part Number A96540-02 might have been interesting, as it explains in Chapter 11 (SQL Statements: ALTER TABLE to ALTER TABLESPACE) what you are looking for.
From the FM | To discontinue previously specified default values, so that they are no longer automatically inserted into newly added rows, replace the values with nulls, as shown in this statement:
ALTER TABLE product_information
MODIFY (min_price DEFAULT NULL);
|
MHE
EDIT: I'm getting slow
[Updated on: Wed, 01 February 2006 08:10] Report message to a moderator
|
|
|
|