-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Checking null property in database
PostPosted: Tue Jul 06, 2004 7:15 am 
Newbie

Joined: Sun Apr 18, 2004 2:29 am
Posts: 18
hi guys
i need to write a query which check whether a property is null or not.
i have writhe the following query----

from CompanyWorkingHourDto dto where dto.branch.pkCode=null and dto.department.pkCode=null

is it ok.if not please let me know how should i write the query.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 7:28 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
Use "is null" rather than "= null".

Code:
from CompanyWorkingHourDto dto where dto.branch.pkCode is null and dto.department.pkCode is null


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 07, 2004 3:50 am 
Newbie

Joined: Sun Apr 18, 2004 2:29 am
Posts: 18
hi
thank u very much.it solved my problem


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.