Click here to Skip to main content
14,332,032 members
Rate this:
Please Sign up or sign in to vote.
See more:

I try to read out from a GDB, this way:
string sql = "select * from test where start > '2011.04.22. 00:00:00'"

But there are a lot of blank cells, because they aren't started yet. I want these cells to be listed. How can I check it?

Updated 25-Apr-11 20:24pm
ZeeroC00l 26-Apr-11 2:20am
What you mean by lot of blank cells ??
can you post an example of how your table looks like with a few data inserted into it.?
velvet7 26-Apr-11 2:26am
Image above.
Rate this:
Please Sign up or sign in to vote.

Solution 1

Why don't you just check for nulls instead?
Or you could provide a default value into your table column.
velvet7 26-Apr-11 2:24am
Actually the problem is this is not my database. It is generated by another program.
And the database doesn't allow NULL.
Does not allow Null? SQL?!
That's new to me. I'm not an expert, but did anyone heard about such stuff?

Thank you.
velvet7 26-Apr-11 2:31am
"I try to read out from a GDB".
I just need an SQL command.
Anyway, to be exact the field is set to "Not null".
CodeHawkz 26-Apr-11 2:34am
@SA: I think he meant, the fields in his table does not allow nulls.

@Abhinav: Why don't you try checking the length of the field after trimming? If it is zero, it should be the blank :) Just a thought
velvet7 26-Apr-11 2:38am
To answer to the question you asked from Abhinav: I would like to make the read time a bit shorter this way, because now it takes ~3 second (on my computer, and this will be used on a slower one!). So to check it, I have to read all cells.
CodeHawkz 26-Apr-11 4:54am
:) Oh.. How many records are we talking about here? 100000 at least? And what is the value of the blank cell? A space??
velvet7 26-Apr-11 9:00am
There are about a million records, and a space can't be a datetime, so I don't think.
ZeeroC00l 26-Apr-11 2:42am
I am not an expert but how can the cell be left blank when the cell is set to NOL NULL ?
CodeHawkz 26-Apr-11 4:52am
Blank = A space? :)
ZeeroC00l 26-Apr-11 9:14am
Well First of all, you can't assign space to everything. What if the field is a date/time field ? In that case spce wont be meaningless.

Hypothetically, say if your cell contains space, then you cant check for NULL in the where condition. And what if the number of space is more than 1 ? That would make things more complex
Sergey Alexandrovich Kryukov 26-Apr-11 11:30am
How they don't allow null? It's weird.
Abhinav S 26-Apr-11 2:30am
Try checking for nulls in your query.
This is correct, a 5.
Abhinav S 26-Apr-11 2:29am
Thank you.
Rate this:
Please Sign up or sign in to vote.

Solution 2

The comments were growing too long to keep track of, so I am posting this as an answer instead.

Can you please, post the create table SQL of the particular table you are talking about, well, if the table got around 100+ fields, omit other fields. And also, tell us what is the database engine that you are using? GDB is for what kind of database?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100