>>Hi, i am getting data out of a database. i need to be able to check
if a value returned in a query is null.
If the idea is just because you want to ignore null values, better
simply set a condition in the query, ie:
WHERE myColumn NOT IS NULL
If what you want is being able to distinguish nu
You can also do it this way, but dipping into some Java -
http://www.compoundtheory.com/?action=displayPost&ID=153
Mark
On 10/9/07, Vince Bonfanti <[EMAIL PROTECTED]> wrote:
> >Vince - just out of curiousity, if I've got a bunch of code doing this:
> >
> >
> >
> >and in some cases it's empty str
>Vince - just out of curiousity, if I've got a bunch of code doing this:
>
>
>
>and in some cases it's empty string and others it's null - would that
>code FAIL to wkr as expected under Bluedragon because null neq ""?
>
That code will work exactly as expected under BlueDragon 7.0. For backwards
c
Vince - just out of curiousity, if I've got a bunch of code doing this:
and in some cases it's empty string and others it's null - would that
code FAIL to wkr as expected under Bluedragon because null neq ""?
Rick
On 10/8/07, Vince Bonfanti <[EMAIL PROTECTED]> wrote:
> FYI, that code does work
FYI, that code does work in BlueDragon 7.0, which can distinguish between nulls
and empty strings, and supports the "null" keyword:
http://blog.newatlanta.com/index.cfm?mode=entry&entry=5C2377F1-534E-5920-D87611A2FB9BE5EC
Vince Bonfanti
New Atlanta Communications, LLC
http://www.newatlanta.com
On 10/8/07, Jochem van Dieten <[EMAIL PROTECTED]> wrote:
> Charlie Griefer wrote:
> > heh. i suggested coalesce() over isnull() just to keep it portable.
> >
> > but agreed that isnull() is more "readable" than both the CASE and
> > coalesce() suggestions :)
>
> Really? And how about when you want
Charlie Griefer wrote:
> heh. i suggested coalesce() over isnull() just to keep it portable.
>
> but agreed that isnull() is more "readable" than both the CASE and
> coalesce() suggestions :)
Really? And how about when you want to check 3 arguments?
Jochem
~
>but agreed that isnull() is more "readable" than both the CASE and
>coalesce() suggestions :)
Yes, I'll grant you IsNull() does have the more descriptive (or intuitive)
name.
ISNULL(col,'YOURINDICATORFORNULL) AS col
COALESCE(col,'YOURINDICATORFORNULL) AS col
~
Depending on your database, you could also use ISNULL() or IFNULL()
functions - much simpler than the case statement, but less portable.
For example, in Microsoft SQL Server:
http://msdn2.microsoft.com/en-us/library/ms184325.aspx
The case statement below would look like this instead:
ISNULL(col
>Depending on your database, you could also use ISNULL() or IFNULL()
>functions - much simpler than the case statement, but less portable.
If portability is a concern, use COALESCE() as Charlie mentioned. Its a more
generic version of ISNULL()
~~~
heh. i suggested coalesce() over isnull() just to keep it portable.
but agreed that isnull() is more "readable" than both the CASE and
coalesce() suggestions :)
On 10/8/07, Rick Root <[EMAIL PROTECTED]> wrote:
> Depending on your database, you could also use ISNULL() or IFNULL()
> functions - mu
Thanks for all your help and detailed suggestions it is now very clear :)
thanks again
~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?
if you really need to distinguish between the 2 at the CF level (-if-)...
you could just the coalesce() function...
SELECT
column1,
coalesce(column2, NULL, 'nothing here'), -- the column which holds
the potentially NULL value
column3
FROM
table
(etc...)
in this ca
Instead of Stored procedure, you can simply do this
CASE WHEN col is NULL THEN 'YOURINDICATORFORNULL'
ELSE col
END AS col
HTH
On 10/8/07, Richard White <[EMAIL PROTECTED]> wrote:
>
> perfect, thanks very much charlie :)
>
> in relation to the issue of null values being different to empty strings
perfect, thanks very much charlie :)
in relation to the issue of null values being different to empty strings in the
database, am i right by saying the only way to get round this would be to
create a stored procedure that ran sql code to test for a null value or empty
string then pass back a re
CF doesn't recognize the concept of a "null value". it converts null
values into empty strings.
from a database perspective, there's absolutely a difference between
NULL (no value exists) and empty string (a string of zero length
exists). However, CF does not make that distinction :(
On 10/8
where field IS NULL
On Mon, 15 Apr 2002, Graham Pearson wrote:
> Group:
>
> This is the first time that I have to test for a NULL Value in MSSQL to
> retrieve a record set. However, at my present knowledge level, I am unable
> to retrieve this record set. Anyone have pointers on how I can do
Are you checking for null re: a value?
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www
you weren't too specific but try something like:
select ... where ColA is null
-Original Message-
From: Graham Pearson [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 1:41 PM
To: CF-Talk
Subject: Null Values in MSSQL
Group:
This is the first time that I have to test for a NU
Depends on what you want. If you are wanting all records where the value is not
NULL
Just do
selectwhatever
from table
wherewhatever IS NOT NULL
"Success is a journey, not a destination!!"
Doug Brown
- Original Message -
From: "Graham Pearson" <[EMAIL PROTECTED]>
To: "
NULL is not "" check for NULL
Hope this helps
Paul Giesenhagen
QuillDesign
http://www.quilldesign.com
SiteDirector v2.0 - Commerce Builder
> Group:
>
> This is the first time that I have to test for a NULL Value in MSSQL to
> retrieve a record set. However, at my present knowledge level,
There is no IsNull function in Coldfusion. However,It
helps to know that NULL is neither numeric nor
anything. Try the IsNumeric function. It might do the
job for you.
Girmawi
--- "Corina S. Moore" <[EMAIL PROTECTED]>
wrote:
> One quick question,
>
> I thought that there was a function call
> >
> > here is some stuff if whatever is null
> >
What about
Gennadi
- Original Message -
From: "Jaime Garza" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, November 09, 2000 4:29 AM
Subject: RE: Null Value
soon as possible and immediately
>destroy this message and its attachments entirely.
>
>
>
>-Original Message-
>From: JustinMacCarthy [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 08, 2000 9:31 AM
>To: CF-Talk
>Subject: RE: Null Values
>
>
>Much B
It is also an ODBC function
{fn ISNULL(a, b)}
if a is null take the value of 'b' otherwise use 'a' itself.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 08, 2000 7:33 AM
> To: CF-Talk
> Su
Think about it, if I pass a value of " " that is not a null
value. That is a value that has a space in it. By checking
it to see if it has length first, then trimming any leading
and trailing spaces off of it your checking to make sure
that it truly is a null value and not a blank space. Try it
Or you can use "is null" . You must include the space.
Nick Betts
PoulterNet.
UK.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 08 November 2000 15:33
To: CF-Talk
Subject: RE: Null Values
IsNull() does not exist in Cold Fusion. It is a vbscrip
: JustinMacCarthy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 9:31 AM
To: CF-Talk
Subject: RE: Null Values
Much Better to do
Justin MacCarthy
>IsNull() does not exist in Cold Fusion. It is a vbscript function.
>
> What I always do is:
>
>
> here is some st
TED]]
Sent: 08 November 2000 15:33
To: CF-Talk
Subject: RE: Null Values
IsNull() does not exist in Cold Fusion. It is a vbscript function.
What I always do is:
here is some stuff if whatever is null
chris.alvarado
cold.fusion - developer
[phone] 512.794.6563
[email] [EMAIL PROTECTED]
Much Better to do
Justin MacCarthy
>IsNull() does not exist in Cold Fusion. It is a vbscript function.
>
> What I always do is:
>
>
> here is some stuff if whatever is null
>
>
>
IsNull() does not exist in Cold Fusion. It is a vbscript function.
What I always do is:
here is some stuff if whatever is null
chris.alvarado
cold.fusion - developer
[phone] 512.794.6563
[email] [EMAIL PROTECTED]
[web] http://www.tmanage.com
Privileged/Confidential Information may
Replace all the delimiters in the list with .
Then use Trim() to get rid of the extra spaces.
Original List: #List#
Item ## #i#: #Trim(ListGetAt(List, i))#
Jim
-Original Message-
From: Aidan Whitehall <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday
This is a multi-part message in MIME format.
--=_NextPart_000_0253_01C0015C.C78A9120
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
RE: Null Values check 2Or,
it is null
it is not null
it ain't defined
You don'
This will check for the existence and if it is null.
It's Null
Or you could use
It's Not Null
--K
-Original Message-
From: Dempsey, Timothy F. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 08, 2000 6:30 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Null Values
Aslam,
I think what you want is:
I don't believe there is the equivalent of SQL's NULL in CF.
The above will determine if there is such an entity called tempValue
and if there is, there is stioll a possibility that it could be "" or 0.
-- Tim Dempsey
-Original Message-
From: aslam
OR
--K
Thank you,
Katrina Chapman
ColdFusion Web Developer
Systems Development
-Original Message-
From: aslam bajaria [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 07, 2000 3:06 PM
To: [EMAIL PROTECTED]
Subject: Null Values check 2
When I used the statement :
...
I got the f
> I am getting an error when I write a code like:
>
>
>
> ...
>
>
>
> If I write
>
>
> ...
>
>
> Then the null values are not being checked. Can
> someone tell me how do you check for null values?
If you mean null values from a database, CF doesn't recognise these as such.
If you need to tre
> Hi All,
>
> I am getting an error when I write a code like:
>
>
>
> ...
>
>
>
> If I write
>
>
> ...
>
Null values can't use EQ or =, you need to ask
--
Archives: http://www.mail-archive.com/cf-talk@houseof
CF doesn't have any notion of NULL, you need to either
OR
Steve
> -Original Message-
> From: aslam bajaria [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 07, 2000 15:45
> To: [EMAIL PROTECTED]
> Subject: Null Values check
>
>
> Hi All,
>
> I am getting an error when I write a cod
39 matches
Mail list logo