Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1191
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
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm
No new posts How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us