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
 
How to access null values from the table by a query?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vasa
Warnings : 1

New User


Joined: 10 Jan 2006
Posts: 9

PostPosted: Sat Mar 18, 2006 12:49 pm    Post subject: How to access null values from the table by a query?
Reply with quote

How to access null values from the table by a query?
please send me the query.
Back to top
View user's profile Send private message

ragshere

New User


Joined: 20 Dec 2004
Posts: 70

PostPosted: Mon Mar 20, 2006 2:11 pm    Post subject: Re: How to access null values from the table by a query?
Reply with quote

vasa,
use this below query as a sample

select * from tablename
where col1 is null


Thanks
Rags
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Mon Mar 20, 2006 3:30 pm    Post subject:
Reply with quote

Hi,

Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned to any project or rows that have null values in PROJECT

SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;

The standard to be followed for writing a select st is to give the name of the column to be selected than a '*'.

Thanks,
KS
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Mon Mar 20, 2006 3:33 pm    Post subject:
Reply with quote

Hi,

Hope am correct abt the standard.If not , kindly correct .

Thanks,
KS
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Mon Mar 20, 2006 3:50 pm    Post subject:
Reply with quote

hy,

just note:
if you use the INTO variables clause,
you should never forget to give with
the variable also an indicator variable.
because if the value is null and you give no
indicator, your sql statement will abend.

martin9
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm

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