Results 1 to 3 of 3
Thread: Modifying Constraint?
May 3, 2003, 03:57 #1
I have created a table using Oracle 8 (on win98se) as follows :
create table sales_order
(sales_order_no varchar(6) primary key,
constraint sorderno check(sales_order_no like('O%')),
dely_type char(1) default 'F',
constraint deltype check(dely_type in('P','F')),
constraint delydate check(dely_date>s_order_date),
constraint orderstat check(order_status in('inprocess','fullfilled','backorder')))
Now I want to modify the last constraint to include one more option for 'cancelled' along with the options present i.e inprocess,fullfilled, backorder .I want to know the command line editing for it.
May 3, 2003, 04:05 #2
- Join Date
- Sep 2001
- 0 Post(s)
- 0 Thread(s)
You can't modify a check constraint. Try dropping and adding it again.
ALTER TABLE sales_order DROP CONSTRAINT orderstat ALTER TABLE sales_order ADD CONSTRAINT orderstat CHECK(order_status IN('inprocess','fullfilled','backorder','cancelled'))
May 3, 2003, 09:13 #3
Got the problem solved.