Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Future proofing my sql |
Thu, May 25 2006 9:26 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | I know I'm not allowed to ask about ElevateDB so I'm not
I want to make sure that the SQL statements I'm writing now are as future proof as possible so I'd like answers to the following (sorry its that null again) If I want to test for wether or not a field has text in it (and in my case an empty string (ie quote quote) qualifies as not having text) do I have to write IF stringfield IS NOT NULL AND stringfield IS NOT '' or would IF LENGTH(stringfield) > 0 be better I seem to remember from other posts that IF integerfield <> 0 is sufficient - is that right or do I need IF integerfield IS NOT NULL AND integerfield <> 0 and for a boolean field simple IF booleanfield or IF NOT booleanfield is right Sorry to ask (I know how heartily sick of null we all got) but I'm writing a wadge of sql and I want it to work with the future product. Roy Lambert |
Thu, May 25 2006 7:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< If I want to test for wether or not a field has text in it (and in my case an empty string (ie quote quote) qualifies as not having text) do I have to write IF stringfield IS NOT NULL AND stringfield IS NOT '' or would IF LENGTH(stringfield) > 0 be better >> If you want to avoid issues with NULLs, then you can't use a simple equality/non-equality operator, meaning that the LENGTH() function will be the solution for you and will work with both NULL and non-NULL string columns. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |