Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Check Constraint

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Siddharth Bahirsheth

New User


Joined: 23 Jul 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Oct 21, 2008 12:48 pm    Post subject: Check Constraint
Reply with quote

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
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Oct 21, 2008 3:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Siddharth Bahirsheth

New User


Joined: 23 Jul 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Oct 21, 2008 5:15 pm    Post subject: Reply to: Check Constraint
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm
No new posts Check special resource availability w... pinimo JCL & VSAM 8 Fri Apr 15, 2016 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us