Found this today
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
:doh:
Getting information off the Internet is like taking a drink from a fire hydrant. - Mitchell Kapor
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
Ed Bouras wrote:
zen-like
Yes: [Email] will always be an empty string, not null (except when ISNULL evaluates NULL as something different from NULL). String.Empty and NULL is an enormous difference for MS SQLServer and most (or all?) object-oriented programming languages. But not for zen-lacking Oracle.
-
Ed Bouras wrote:
zen-like
Yes: [Email] will always be an empty string, not null (except when ISNULL evaluates NULL as something different from NULL). String.Empty and NULL is an enormous difference for MS SQLServer and most (or all?) object-oriented programming languages. But not for zen-lacking Oracle.
Bernhard Hiller wrote:
String.Empty and NULL is an enormous difference
Yes, obviously. And I wish XML would recognize that too.
This space intentionally left blank.
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
According to this http://technet.microsoft.com/en-us/library/ms184325.aspx[^], the expression is just stupid, it is much easier to write
SELECT '' as [Email]
, because
ISNULL(NULL, '')
will ALWAYS return''
.lifecycle of a lifecycle of a lifecycle
-
According to this http://technet.microsoft.com/en-us/library/ms184325.aspx[^], the expression is just stupid, it is much easier to write
SELECT '' as [Email]
, because
ISNULL(NULL, '')
will ALWAYS return''
.lifecycle of a lifecycle of a lifecycle
Hence the post in this forum. Honestly this was probably done in haste and without care for proper coding as part of a set of replacements in the stored proc of the "Email" field with NULL. Things do happen fast and furious around here and there is no dba to oversee/filter. I found it humorous enough to share with those who like to smack themselves in the forehead :doh:
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
This probably came up for .. historic reason! ;)
My programming get away... The Blog... DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
SELECT ISNULL(NULL,'') as [Email]
There's something oddly zen-like about it :)
I also found something similar today
my $select = ""; my (@fields) = ("field1", "field2", "field3", "field4", "field5", "field6", "field7", "field8", "field9", "field10", "field11", "field12", "field13", "field14", "field15", "field16", "field17", "field18"); foreach my $f (@fields) { $select .= "$f,"; } chop $select;
For those unfamiliar, @name= array variable, $name = scalar variable. 'chop' is interpreted as a function call with the intentional side effect of removing the last character from the scalar you pass it. As a bonus, plaintext strings surrounded by double quotes must be parsed by the interpreter (this is Perl) and variable names within them are replaced with values.