473,394 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

are nulls bad

aaj
Hi

I am probably going to regret asking this because I'm sure you are going to
tell me my design is bad 8-) ah well we all have to learn....

anyway

I often use Nulls as a marker to see if certain tasks have been completed.

A typical example would be a column say invoice_value

when new work is entered and a new record is appended, I leave the
invoice_value column as NULL, so if I want a View for uninvoiced work I
check for the invoice_value being equal to NULL, and alternatively if I want
invoiced work, I check for not null. I did it this way to save putting in
another column that needed to be set to TRUE or FALSE. (I do similar things
elsewhere aswell)

so far everything seems to work OK but reading some old stuff on Google I
get the feeling that NULLS should be left alone, have I done wrong?

many thanks

Andy

Jul 20 '05 #1
3 1994
On Tue, 25 May 2004 15:08:27 +0100, aaj wrote:
Hi

I am probably going to regret asking this because I'm sure you are going to
tell me my design is bad 8-) ah well we all have to learn....

anyway

I often use Nulls as a marker to see if certain tasks have been completed.

A typical example would be a column say invoice_value

when new work is entered and a new record is appended, I leave the
invoice_value column as NULL, so if I want a View for uninvoiced work I
check for the invoice_value being equal to NULL, and alternatively if I want
invoiced work, I check for not null. I did it this way to save putting in
another column that needed to be set to TRUE or FALSE. (I do similar things
elsewhere aswell)

so far everything seems to work OK but reading some old stuff on Google I
get the feeling that NULLS should be left alone, have I done wrong?

many thanks

Andy


Hi Andy,

I don't think NULLS are bad. I do think they arer tricky and many errors
have been caused by improper understanding of NULLS and three-valued
logic.

As to your design- I don't think it's bad. In similar cases, I tend to use
a column that stores the date/time a task is finished. And (like you) I
use column_name IS NULL (*not* column_name = NULL!!!!) to find unfinished
work.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 20 '05 #2
aaj,

I agree with Hugo, but here's an alternate viewpoint from Aaron's site:

http://www.aspfaq.com/show.asp?id=2073

-Andy

"aaj" <a.*@c.com> wrote in message
news:40**********************@news.easynet.co.uk.. .
Hi

I am probably going to regret asking this because I'm sure you are going to tell me my design is bad 8-) ah well we all have to learn....

anyway

I often use Nulls as a marker to see if certain tasks have been completed.

A typical example would be a column say invoice_value

when new work is entered and a new record is appended, I leave the
invoice_value column as NULL, so if I want a View for uninvoiced work I
check for the invoice_value being equal to NULL, and alternatively if I want invoiced work, I check for not null. I did it this way to save putting in
another column that needed to be set to TRUE or FALSE. (I do similar things elsewhere aswell)

so far everything seems to work OK but reading some old stuff on Google I
get the feeling that NULLS should be left alone, have I done wrong?

many thanks

Andy

Jul 20 '05 #3
aaj
Thanks for the replies, I feel a little better

I'll give the link some more study

thanks again

Andy

"aaj" <a.*@c.com> wrote in message
news:40**********************@news.easynet.co.uk.. .
Hi

I am probably going to regret asking this because I'm sure you are going to tell me my design is bad 8-) ah well we all have to learn....

anyway

I often use Nulls as a marker to see if certain tasks have been completed.

A typical example would be a column say invoice_value

when new work is entered and a new record is appended, I leave the
invoice_value column as NULL, so if I want a View for uninvoiced work I
check for the invoice_value being equal to NULL, and alternatively if I want invoiced work, I check for not null. I did it this way to save putting in
another column that needed to be set to TRUE or FALSE. (I do similar things elsewhere aswell)

so far everything seems to work OK but reading some old stuff on Google I
get the feeling that NULLS should be left alone, have I done wrong?

many thanks

Andy

Jul 20 '05 #4

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

Similar topics

0
by: Dan Perlman | last post by:
From: "Dan Perlman" <dan@dpci.NOSPAM.us> Subject: ODBC creating nulls? Date: Friday, July 09, 2004 10:43 AM Hi, Below is my VB6 code that writes data from an Access 2000 table to a PG table....
2
by: Steve Walker | last post by:
Hi all. I've been tasked with "speeding up" a mid-sized production system. It is riddled with nulls... "IsNull" all over the procs, etc. Is it worth it to get rid of the nulls and not allow...
6
by: mike | last post by:
I'm doing what I thought was a simple GROUP BY summary of fairly simple data and the my numbers aren't working out Some results are showing up <NULL> when I know the data is in the database ...
0
by: Rhino | last post by:
I am working with SQL Functions in DB2 for Windows/Linux/UNIX (V8.2.1) and am having a problem setting input parameters for SQL Functions to null in the Development Center. My simple function,...
1
by: PST | last post by:
Here's a problem I'm trying to deal with: I'm working on a Frontpage 2000 website for a boat handicapping system, built in Access 97. What I'm trying to accomplish is: The user enters a...
13
by: jt | last post by:
I can't seem to find a way to concatenate strings that have nulls within the string. I have a string that I need another string that has nulls in it and what to append the 2nd string, 3 string...
3
by: Simon | last post by:
Hi all, Do you think the best way to avoid the problems of nulls in the database is just to provide default values via the db schema? Alternatively, is it better to allow nulls, seeing as the...
2
by: Rey | last post by:
Howdy all. My problem deals w/inserting nulls into database (SQL Svr 2K) for the datetime fields activityDate and followUpDate where nulls are allowed. >From the web form, the user can type...
6
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.