hi
i want know is it possibe for check constraints and default constraints in 1 table.because i want to insert a row in the table like my field is mark.and i am give check constrats to mark fileld to if mark is less than 0 and greather then 100.but i want to if the check constraints is failed then the need to insert default value which is given the defualt value of mark filed.
Loading

Manisha GuptaPosted Jul 1, 2014, 3:20 AM
you can try this for your question. its easy and simple.
-----creating a table
create table just
(
mark int default 50 not null
check((mark>0) and (mark<100))
);
---inserting a specific value
insert into just (mark)
values(20);
---viewing complete table entries
select * from just;