ISNULL in sqlite

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ISNULL in sqlite

logan-20
Hello,

How do I check for a null or empty string in SQLite. SQL server has ISNULL
but it doesn't seem to be supported in SQLite.

Thanks,
Hitesh
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

Puneet Kishor-2

On Jun 25, 2011, at 3:33 PM, [hidden email] wrote:

> Hello,
>
> How do I check for a null or empty string in SQLite. SQL server has ISNULL
> but it doesn't seem to be supported in SQLite.

ifnull() and nullif() [http://www.sqlite.org/lang_corefunc.html]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

Igor Tandetnik
In reply to this post by logan-20
[hidden email] wrote:
> How do I check for a null or empty string in SQLite. SQL server has ISNULL
> but it doesn't seem to be supported in SQLite.

where MyField is null

--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

Jay Kreibich
On Sat, Jun 25, 2011 at 04:55:13PM -0400, Igor Tandetnik scratched on the wall:
> [hidden email] wrote:
> > How do I check for a null or empty string in SQLite. SQL server has ISNULL
> > but it doesn't seem to be supported in SQLite.
>
> where MyField is null

  where MyField isnull     is also supported.

  http://www.sqlite.org/lang_expr.html  ("is null" is just a standard
  "is" with the right side expression being a literal NULL.)



   -j

--
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

logan-20
Thank you everyone!!

On Sat, Jun 25, 2011 at 9:27 PM, Jay A. Kreibich <[hidden email]> wrote:

> On Sat, Jun 25, 2011 at 04:55:13PM -0400, Igor Tandetnik scratched on the
> wall:
> > [hidden email] wrote:
> > > How do I check for a null or empty string in SQLite. SQL server has
> ISNULL
> > > but it doesn't seem to be supported in SQLite.
> >
> > where MyField is null
>
>   where MyField isnull     is also supported.
>
>  http://www.sqlite.org/lang_expr.html  ("is null" is just a standard
>  "is" with the right side expression being a literal NULL.)
>
>
>
>   -j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it,
>  but showing it to the wrong people has the tendency to make them
>  feel uncomfortable." -- Angela Johnson
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

Gerry Snyder-4
In reply to this post by logan-20
On 6/25/2011 12:33 PM, [hidden email] wrote:
> Hello,
>
> How do I check for a null or empty string in SQLite.

In addition to the other replies you have received, you need to be made
aware that an empty string and a NULL are very different, and (perhaps)
both have to be checked for, depending on how the data gor into the table.


Gerry
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: ISNULL in sqlite

logan-20
Yes, I'm checking for empty string, but it wasn't working for null. The
suggestions by kind people here helped resolve it. Thank you!

On Mon, Jun 27, 2011 at 11:16 AM, Gerry Snyder <[hidden email]>wrote:

> On 6/25/2011 12:33 PM, [hidden email] wrote:
> > Hello,
> >
> > How do I check for a null or empty string in SQLite.
>
> In addition to the other replies you have received, you need to be made
> aware that an empty string and a NULL are very different, and (perhaps)
> both have to be checked for, depending on how the data gor into the table.
>
>
> Gerry
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users