Skip site navigation (1) Skip section navigation (2)

selectecting not null varchars.

From: Joseph Shraibman <jks(at)p1(dot)selectacast(dot)net>
To: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: selectecting not null varchars.
Date: 2000-02-24 19:46:54
Message-ID: 38B58AAE.B28DD6CB@selectacast.net (view raw or flat)
Thread:
Lists: pgsql-interfaces
I have a table with some text strings and I want to select row where the
text fields have a value in them.

I tried  :
select * from directory where length(h) > 0 ;
and got:
ERROR:  Null input to textlen

So I tried:
select * from directory where h != null AND length(h) > 0 ;
and got:
ERROR:  parser: parse error at or near "and"

In fact this:
 select * from directory where h != null  ;
... gets you this:
ERROR:  parser: parse error at or near ";"

Trying to select where it is equal to null works.  Trying to select
where an int is not equal to a certain value works.  But I cannot select
where a varchar (or int) is not equal to null.


Responses

pgsql-interfaces by date

Next:From: Ed LoehrDate: 2000-02-24 20:04:40
Subject: Re: [INTERFACES] selectecting not null varchars.
Previous:From: Mike MascariDate: 2000-02-24 15:50:30
Subject: Re: [INTERFACES] selectecting not null varchars.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group