The fields that you're inserting into wouldn't happen to be number fields
would they?

if so you might want to do <cfparam name="form.var" default="0">

-----Original Message-----
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 14 November 2001 12:50 p.m.
To: CF-Talk
Subject: SQL INSERT


This seems like such a beginner question, but can you use INSERT INTO with
form fields that are left blank?  ( i am using <cfparam name="form.var"
default=""> for the radio buttons, and check boxes on the action page )

Im getting a "Syntax error in INSERT INTO statement".  THe statement works
fine if all the fields in the form are filled out.  If i submit the form
with all blanks i get this error.

The resulting SQL statement looks something like this on the action page:

SQL =
INSERT INTO products (FILENAME,DIM,CONFIG)
VALUES ('',,'')

This is with a MS Access database also.

DO i have to have to do:
INSERT INTO products (<CFIF form.var is not "">FILENAME</CFIF>)
VALUES (<CFIF form.var is not "">#form.filename#</CFIF>)

I hope not!




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to