Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Found this today

Found this today

Scheduled Pinned Locked Moved The Weird and The Wonderful
9 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Middle Manager
    wrote on last edited by
    #1

    SELECT ISNULL(NULL,'') as [Email]

    There's something oddly zen-like about it :)

    B D B V S 6 Replies Last reply
    0
    • M Middle Manager

      SELECT ISNULL(NULL,'') as [Email]

      There's something oddly zen-like about it :)

      B Offline
      B Offline
      Brisingr Aerowing
      wrote on last edited by
      #2

      :doh:

      Getting information off the Internet is like taking a drink from a fire hydrant. - Mitchell Kapor

      1 Reply Last reply
      0
      • M Middle Manager

        SELECT ISNULL(NULL,'') as [Email]

        There's something oddly zen-like about it :)

        D Offline
        D Offline
        dakovinc
        wrote on last edited by
        #3

        Maybe someone wanted to make sure that a mapping framework (like .net EntityFramework) made a nullable string out of it :laugh:

        1 Reply Last reply
        0
        • M Middle Manager

          SELECT ISNULL(NULL,'') as [Email]

          There's something oddly zen-like about it :)

          B Offline
          B Offline
          Bernhard Hiller
          wrote on last edited by
          #4

          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.

          P 1 Reply Last reply
          0
          • B Bernhard Hiller

            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.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • M Middle Manager

              SELECT ISNULL(NULL,'') as [Email]

              There's something oddly zen-like about it :)

              V Offline
              V Offline
              Vladimir Svyatski
              wrote on last edited by
              #6

              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

              M 1 Reply Last reply
              0
              • V Vladimir Svyatski

                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

                M Offline
                M Offline
                Middle Manager
                wrote on last edited by
                #7

                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:

                1 Reply Last reply
                0
                • M Middle Manager

                  SELECT ISNULL(NULL,'') as [Email]

                  There's something oddly zen-like about it :)

                  S Offline
                  S Offline
                  Super Lloyd
                  wrote on last edited by
                  #8

                  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!

                  1 Reply Last reply
                  0
                  • M Middle Manager

                    SELECT ISNULL(NULL,'') as [Email]

                    There's something oddly zen-like about it :)

                    B Offline
                    B Offline
                    bulg
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups