p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: sql insert probs


Message #1 by "Daniel O'Dorisio \(Work\)" <dodorisio@h...> on Wed, 18 Jul 2001 17:07:57 -0400
ahhh interesting concept!
thanks for the advice... dont think i will use that on this db though since
we dont really require that much sophistication.
i knew if i posted to this list i would get some good advice from you.
thanks!

daniel

Daniel O'Dorisio
dodorisio@h...
xxx-xxx-xxxx


-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Thursday, July 19, 2001 11:27 PM
To: Code Clinic
Subject: [proasp_codeclinic] RE: sql insert probs


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Daniel O'Dorisio" <dodorisio@h...>
Subject: [proasp_codeclinic] RE: sql insert probs


: not sure i get what you are saying?
:
: the thing is, some of the data like the 3 extra fax numbers and the extra
: phone number, and the extra email address, and the website field may not
: need any data or it may not be available. so the user cant input it. but
: what was happening when i inserted the value of a blank textbox, was i was
: inserting a ZLS. that isnt the same as a null.. correct?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Well, the last bit is correct - ZLS <> NULL.

I suppose I was saying that usually a NULL is used to indicate an unknown.
For example, if you don't know that a customer has a fax, then you'd use a
NULL. If you know a customer doesn't have a fax, you'd use a ZLS.

Now, whether you want to build this level of sophistication into your DB
depends on your specifications (hence, I said, check your specs).

A sample way to handle this issue (assuming you do want NULLs) would be:
a) if the customer doesn't enter a fax number, then you presume that they
don't have one, so enter a ZLS.
b) if you are entering a customer record, but you don't know whether they
have a fax number, then just don't insert anything into that field, and it
will remain NULL

Cheers
Ken


  Return to Index