first of all, the correct syntax is INSERT INTO.  you only used INSERT.
also, keep the name of the table (X_Invoices) close to that open parenthesis
(no spaces in between).  i dunno if It'll do any good,  but I am paranoid.
that should solve your problem


<cfquery datasource="IS_Budget" name="SaveInvoiceQry">
        INSERT X_Invoices (Vendor, Inv_GL, Inv_City, Inv_Dept, Inv_Date,
Inv_No, Inv_Desc, ApprovedDate, Notes, Inv_Amount)

values ('#Vendor#', '#Inv_GL#', '#Inv_City#', '#Inv_Dept#',
'#Inv_Date#', '#Inv_No#', '#Inv_Desc#', '#ApprovedDate#', '#Notes#',
#Inv_Amount#)
</cfquery>





-----Original Message-----
From: Gieseman, Athelene [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:33 PM
To: CF-Talk
Subject: OT: SQL Question


I am getting the following SQL error:

Microsoft][ODBC SQL Server Driver][SQL Server]There are fewer columns in the
INSERT statement than values specified in the VALUES clause. The number of
values in the VALUES clause must match the number of columns specified in
the INSERT statement.  

This doesn't happen all the time.  I can't seem to find what's unique about
the records that do insert from those that don't.

The insert statement is as follows:

<cfquery datasource="IS_Budget" name="SaveInvoiceQry">
        INSERT X_Invoices (Vendor, Inv_GL, Inv_City, Inv_Dept, Inv_Date,
Inv_No, Inv_Desc, ApprovedDate, Notes, Inv_Amount)
        values ('#Vendor#', '#Inv_GL#', '#Inv_City#', '#Inv_Dept#',
'#Inv_Date#', '#Inv_No#', '#Inv_Desc#', '#ApprovedDate#', '#Notes#',
#Inv_Amount#)
</cfquery>

I'm sure I'm not seeing something obvious.  But it looks to me like there
are 10 items for each of the values and table columns.  Can anyone see what
I'm not?

Athelene Gieseman
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to