472,351 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,351 software developers and data experts.

Empty Output? How Do I Determine the Character?

I cannot determine what character is stored in a varchar...

For instance:
thedonnaholics=# select state from mailing_list where rec_num = 7;
state
-------

(1 row)

If I then execute:
thedonnaholics=# select count(*) from mailing_list where state = '';
count
-------
0
(1 row)

So, what is in that first row?

This also returns 0:
thedonnaholics=# select count(*) from mailing_list where state = ' ';
count
-------
0
(1 row)

Any ideas? I'd like to select all rows that contain whatever that first one
contains...

Hunter
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #1
2 1400
Hunter Hillegas <li***@lastonepicked.com> writes:
I cannot determine what character is stored in a varchar...
For instance:
thedonnaholics=# select state from mailing_list where rec_num = 7;
state
------- (1 row)


I'd say it's either NULL or between one and five space characters.
To find out, try something like

select '>' || state || '<' from mailing_list where rec_num = 7;

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #2
Ok... I don't think that it is null:
thedonnaholics=# select count(*) from mailing_list where state = null;
count
-------
0
(1 row)

I ran the query you suggested but I don't know what it means:
thedonnaholics=# select '>' || state || '<' from mailing_list where rec_num
= 7;
?column?
----------

(1 row)

Any insight appreciated.

Thanks,
Hunter
From: Tom Lane <tg*@sss.pgh.pa.us>
Date: Fri, 08 Aug 2003 19:03:24 -0400
To: Hunter Hillegas <li***@lastonepicked.com>
Cc: PostgreSQL <pg***********@postgresql.org>
Subject: Re: [GENERAL] Empty Output? How Do I Determine the Character?

Hunter Hillegas <li***@lastonepicked.com> writes:
I cannot determine what character is stored in a varchar...
For instance:
thedonnaholics=# select state from mailing_list where rec_num = 7;
state
-------

(1 row)


I'd say it's either NULL or between one and five space characters.
To find out, try something like

select '>' || state || '<' from mailing_list where rec_num = 7;

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and...
3
by: tornado | last post by:
Hi all, I am pretty new to PHP. I was reading PHP manual and trying out the example from 2nd chapter (A simple Tutorial). When i try to print...
5
by: Michael | last post by:
I mean how to use _tprintf().
7
by: Clinton Pierce | last post by:
I'm calling a method in another assembly that's supposed to return a string, and possibly that string might be empty. The code looks something...
8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:"...
5
by: Sen Haerens | last post by:
I'm using string.split(/^$/m, 2) on a curl output to separate header and body. There’s an empty line between them. ^$ doesn’t seem to work... ...
19
by: Chad | last post by:
Okay, let's say I have an exotic os that limits how much goes to stdout. When I go like.. #include <stdio.h> int main(void) { int i=0; ...
0
by: jebbyleezer | last post by:
Hello, I have source code that builds correctly, however, after the program terminates the output file produced is empty. Here is my source code: ...
4
by: maria | last post by:
I only use C++ with Visual Studio 6.0 for string manipulations in thousands of HTML pages on my website. Many times, the output files of many of my...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.