May 17, 2004 #1 paultasy Technical User May 12, 2004 5 GB Here's a quick one,,, I have multiple values that I want to check are all NULL to trigger a condition.... Currently it's and A=NULL and B=NULL and C=NULL and D=NULL etc etc.... Is there anyway to write the same as something like: and (A,B,C,D=NULL)? Thanks
Here's a quick one,,, I have multiple values that I want to check are all NULL to trigger a condition.... Currently it's and A=NULL and B=NULL and C=NULL and D=NULL etc etc.... Is there anyway to write the same as something like: and (A,B,C,D=NULL)? Thanks
May 17, 2004 #2 PHV MIS Nov 8, 2002 53,708 FR IMHO, the correct way is: and A IS NULL and B IS NULL and C IS NULL and D IS NULL etc etc.... Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
IMHO, the correct way is: and A IS NULL and B IS NULL and C IS NULL and D IS NULL etc etc.... Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
May 17, 2004 Thread starter #3 paultasy Technical User May 12, 2004 5 GB thanks for that, however, what I am really trying to achieve is to shorten the code if possible? Upvote 0 Downvote
May 17, 2004 #4 swampBoogie Programmer Jan 6, 2003 1,660 SE Depending on your DBMS, the following may be allowed. Code: where (a,b,c,d) is null Upvote 0 Downvote
May 17, 2004 Thread starter #5 paultasy Technical User May 12, 2004 5 GB doesn't work in Sybase - oh well, never mind. The code isn't too cumbersome so I'll stick with the original form! Thanks for looking anyway Upvote 0 Downvote
doesn't work in Sybase - oh well, never mind. The code isn't too cumbersome so I'll stick with the original form! Thanks for looking anyway
May 17, 2004 #6 jimbopalmer Programmer Jul 20, 2001 2,904 US I am not near my database, but does WHERE a||b||c||d is null; work? in Oracle that should concatinate the 4 variables into a single value and test the single value I tried to remain child-like, all I acheived was childish. Upvote 0 Downvote
I am not near my database, but does WHERE a||b||c||d is null; work? in Oracle that should concatinate the 4 variables into a single value and test the single value I tried to remain child-like, all I acheived was childish.
May 17, 2004 Thread starter #7 paultasy Technical User May 12, 2004 5 GB Great - that works fine! Neater code!! Upvote 0 Downvote
May 17, 2004 #8 PHV MIS Nov 8, 2002 53,708 FR Be aware that WHERE a||b||c||d is null is true then only one of a,b,c or d is null, which is not the same logic as the original post. Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
Be aware that WHERE a||b||c||d is null is true then only one of a,b,c or d is null, which is not the same logic as the original post. Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
May 17, 2004 Thread starter #9 paultasy Technical User May 12, 2004 5 GB don't worry, I stuck brackets around it: and (lbl_bp_cd || pd_cd || cat_it_cd || pric_cd || convert(varchar,age_restr) || profit_ctr_cd || rptr_grp_cd || series_grp_cd) is NULL Upvote 0 Downvote
don't worry, I stuck brackets around it: and (lbl_bp_cd || pd_cd || cat_it_cd || pric_cd || convert(varchar,age_restr) || profit_ctr_cd || rptr_grp_cd || series_grp_cd) is NULL
May 17, 2004 #10 PHV MIS Nov 8, 2002 53,708 FR This where clause will not have the same behaviour as the original post. Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
This where clause will not have the same behaviour as the original post. Hope This Help, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244