Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 11 to 15 of 15 total |
NULL in a parameter |
Tue, Sep 14 2010 8:44 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Uli
That approach is fine when you build the SQL dynamically. If you want to use parameters (eg when the query is inside a loop) you loose all the advantages of preparing the query. With that caveat it will certainly work - I know I have to do that with a number of queries (even some inside loops ) Roy Lambert [Team Elevate] |
Tue, Sep 14 2010 10:24 AM | Permanent Link |
Uli Becker | Roy,
> That approach is fine when you build the SQL dynamically. If you want to use parameters (eg when the query is inside a loop) you loose all the advantages of preparing the query. > > With that caveat it will certainly work - I know I have to do that with a number of queries (even some inside loops ) You are right, but I don't see another way to pass the NULL-parameters except using 2.04 which I havent' tested yet. Uli |
Tue, Sep 14 2010 2:22 PM | Permanent Link |
Charles Tyson | I have a feeling I'm not awake enough to understand the problem, but
have you tried... select lastname, firstname, dob from tablex where coalesce(cast(dob as varchar(10)), '') = :d1 Set d1 (whose datatype is ftString) to '' to find nulls, or in the form 'YYYY-MM-DD' for non-nulls. |
Wed, Sep 15 2010 3:09 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Charles
>select lastname, firstname, dob from tablex where >coalesce(cast(dob as varchar(10)), '') = :d1 > >Set d1 (whose datatype is ftString) to '' to find nulls, or in the form >'YYYY-MM-DD' for non-nulls. That's excellent. Roy Lambert [Team Elevate] |
Thu, Sep 16 2010 7:13 PM | Permanent Link |
Peter | All
I moved up to 2.04 but still didn't get the params to work in a fashion similar to the DBISAM manner. I didn't try the CAST method which looks good, as I had already decided to use dynamic SQL, where I format one of the arguments to be either AND (DoB IS NULL) or AND (DoB = DATE (FormatDateTime(... etc. I'll try the CAST method when I get more time. Thanks for your suggestions. Regards Peter |
« Previous Page | Page 2 of 2 | |
Jump to Page: 1 2 |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |