View previous topic :: View next topic
|
Author |
Message |
Siddharth Bahirsheth
New User
Joined: 23 Jul 2007 Posts: 16 Location: Mumbai
|
|
|
|
I want add a check constraint to a column during create table query,to start that column by digit 9 and should range between 9000000000 and 9999999999 only.
How to go about it .Please provide me with query
P.S: Is there any data type to accept only number(13 digits) ,apart from smallint ,int and dec(13,0) .
Thanks in advance. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Siddharth,
You can use below query or this
CREATE TABLE EMPSAL
(ID INTEGER NOT NULL,
SALARY INTEGER CHECK (SALARY >= 9000000000
AND SALARY <= 9999999999)); |
|
Back to top |
|
|
Siddharth Bahirsheth
New User
Joined: 23 Jul 2007 Posts: 16 Location: Mumbai
|
|
|
|
Thanks for the reply guptae,But only the part of query is been responded ,request you to answer the rest as well. |
|
Back to top |
|
|
|