you can do it by simply typing the word null:
INSERT INTO table( field1, field2 )
VALUES( '#value1#', null )
It's not a great idea because SQL 7 is not very efficient at searching null
fields. It's better that it have some value. If a form field is not filled
in just put it in anyway as a blank (the field must be varchar or nvarchar -
char fields will fill the entire field length with blanks and searching for
a single blank '' will fail):
INSERT INTO table( field1, field2 )
VALUES( '#value1#', '#trim(value2)#' )
This shouldn't affect your CF code since Cold Fusion sees nulls as blanks
anyway
Bryan Love ACP
[EMAIL PROTECTED]
-----Original Message-----
From: David Clay [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 9:34 AM
To: CF-Talk
Subject: NULLs
I would like to insert a NULL value into a SQL 7 table if a field is not
filled in.
How do I go about doing this? Is this a wise thing to do? Why doesn't SQL
7 automatically do that?
Any help would be greatly appreciated. Thank you fro your time.
Dave Clay
Internet Facilitator
Trus Joist, A Weyerhaeuser Business
5995 Greenwood Plaza Blvd, Suite 100
Greenwood Village, CO 80111
303.770.8506
303.770.8506
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists