need a clarification on not null declaration.

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
pradeepa
Member
Posts: 16
Joined: Tue Jun 02, 2009 5:10 pm
Location: chennai

need a clarification on not null declaration.

Post by pradeepa » Wed Jun 17, 2009 2:38 pm

i want to know why we use not null when we declaring variables.
for example:
ENO int not null,
ENAME char(10) not null. please help in that.
pradeepa

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Wed Jun 17, 2009 2:51 pm

If you declare with NOT NULL option. DB2 wont allow null value while inserting data into that filed. if field is not defined with NOT NULL , users are allowed to
insert null values into that field.
Natarajan
Chennai

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Jun 17, 2009 2:58 pm

because the default is NULL
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

pradeepa
Member
Posts: 16
Joined: Tue Jun 02, 2009 5:10 pm
Location: chennai

Post by pradeepa » Wed Jun 17, 2009 4:44 pm

Thank u very much
pradeepa

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others