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
 

 

blank ,space and null

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

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Mon May 31, 2010 11:40 pm    Post subject: blank ,space and null
Reply with quote

hi,

this may be simple question to ask.

But i still confuse on null,space or blank.

please correct me if i am wrong .

Null - A table student is created with 2 colum name and marks .

if i insert say name alone . then there is no values in marks .so its called us Null.

SPACE - i create a table student new with 2 column name and marks.
i insert value say (alen,10) .

Now i delete the value 10 from the marks col in student new table .
can i say the col value is now spaces and not null.

Thanks ,
l.nethaji
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 01, 2010 12:10 am    Post subject: Re: blank ,space and null
Reply with quote

l.nethaji wrote:
hi,

this may be simple question to ask.

But i still confuse on null,space or blank.

please correct me if i am wrong .

Null - A table student is created with 2 colum name and marks .

if i insert say name alone . then there is no values in marks .so its called us Null.

SPACE - i create a table student new with 2 column name and marks.
i insert value say (alen,10) .

Now i delete the value 10 from the marks col in student new table .
can i say the col value is now spaces and not null.

Thanks ,
l.nethaji


It would depend on how the columns are defined, are they defined as "NOT NULL WITH DEFAULT"?

You can not delete a value from a column, you can set it to a different value or to NULL if it is defined to contain allow a NULL.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 01, 2010 1:57 am    Post subject:
Reply with quote

Hello,

Space and Blank are the same value - on the mainframe this is x'40'.

There is no value for NULL - NULL is the absence of any value at all.

I believe you need to review what NULL is and the rules for NULLs.

Personally, i recommend NULLs not be used.
Back to top
View user's profile Send private message
l.nethaji

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Tue Jun 01, 2010 11:06 am    Post subject: Reply to: blank ,space and null
Reply with quote

hi,


Thanks for the reply.

if the column MARKS is not declared as NOT NULL WITH DEFAULT.

If i create a table student with 2 column( name and marks) .

insert a row into it say (babu,10).

IF i use delete marks from student .

Whether the marks column will have space or it would be null.


Please let me know when the column is said to be blank or space .

Please correct me if am wrong

Thanks in advance
L.Nethaji
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Tue Jun 01, 2010 1:00 pm    Post subject:
Reply with quote

Hello Netaji,

I suggest you to brush up your skills in Db2. Just check you cant delete value from 1 column you can update it.
Please read the manuals and let us know if you not clear
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue Jun 01, 2010 1:04 pm    Post subject: Re: blank ,space and null
Reply with quote

as said :
Craq Giegerich wrote:
l.nethaji wrote:
IF i use delete marks from student

You can not delete a value from a column, you can set it to a different value or to NULL if it is defined to contain allow a NULL.
Back to top
View user's profile Send private message
l.nethaji

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Tue Jun 01, 2010 2:54 pm    Post subject: Reply to: blank ,space and null
Reply with quote

Hi,

Thanks for the help.

I now understand the delete function.

One final query ,where blank or space comes into picture .

I mean like which scenario these spaces or blank are used in tables in DB2.

Thanks
L.Nethaji
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Jun 01, 2010 3:46 pm    Post subject: Re: Reply to: blank ,space and null
Reply with quote

l.nethaji wrote:
Hi,

One final query ,where blank or space comes into picture .

I mean like which scenario these spaces or blank are used in tables in DB2.

Setting column value to blank (all spaces) is same as you set it to any other value..
Back to top
View user's profile Send private message
l.nethaji

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Tue Jun 01, 2010 4:08 pm    Post subject: Reply to: blank ,space and null
Reply with quote

Hi,

Could you please let me know how the spaces or blank is set to a column.

Suppose i have table t with 2 column name (varchar ) and marks(int eger ),

How do i make sure if the name and marks are set to spaces .

Is ther any query for the same to insert a space to the column mentioned above.

Thanks ,
L.Nethaji
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Jun 01, 2010 4:48 pm    Post subject: Re: Reply to: blank ,space and null
Reply with quote

l.nethaji wrote:

Hi,

Could you please let me know how the spaces or blank is set to a column.

Suppose i have table t with 2 column name (varchar ) and marks(int eger ),

How do i make sure if the name and marks are set to spaces .

Is ther any query for the same to insert a space to the column mentioned above.

You can not assign any type of value to any datatype column like roaming in park.. icon_evil.gif

I expect you to try these things on your own as you are software engineer with cobol\db2 skills.

To start with...Read this
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnapk10/TBLRCMPASS?SHELF=&DT=20070123230158&CASE=&ScrollTOP=TBLRCMPASS#TBLRCMPASS
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 01, 2010 8:43 pm    Post subject:
Reply with quote

Hello,

Quote:
How do i make sure if the name and marks are set to spaces .
You don't. . . Why would you believe it is desirable (or even possible) to have spaces in a column that is defined as numeric?

You need to step back and review your understanding of how database works.

Suggest you follow the link at the top of the page to "IBM Manuals", find the SQL Reference for your release of DB2 and read everything about how to define tables/columns and hot to place/change values in these columns. If you find something in the documentation that is not clear, post what you found and your doubt. Someone shold be able to clarify.
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 Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts GetObjectArrayElement returns NULL Majid Hussain Java & MQSeries 2 Wed Mar 30, 2016 2:59 am
No new posts How to find Table-space and Index-spa... venksiv DB2 5 Wed Feb 03, 2016 6:16 pm


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