Two problems...
Firstly:
> VALUES ('#field1#, #field2#, #field3#')
should be
> VALUES ('#field1#', '#field2#', '#field3#')
>
Secondly
INSERT INTO TABLENAME (FIELDNAME) should be either just
INSERT INTO TABLENAME
(That is if you know that there are only three columns in the table and you
know the order of the columns) or should be
INSERT INTO TABLENAME (fieldname1, fieldname2, fieldname3)
If on the other hand you are attempting to insert three values into one
table three times then you should place all the values within a list and
loop through the list inserting each one individually.
Would suggest putting a CFTRY and CFCATCH in place to capture any DB errors
(duplicate insert) as you may want to continue processing all entries.
Adam Reynolds
ColdFusion Consultant
HJ Heinz
Tel: 01344 397016 Fax: 01344 397010
Mobile: 07973 386620
Email: [EMAIL PROTECTED]
> ----------
> From: Spencer Saunders[SMTP:[EMAIL PROTECTED]]
> Sent: 09 May 2000 12:37
> To: cftalk
> Subject: SQL insert question
>
> I am trying to insert multiple variables into one field in a DB but each
> variable in it's own row. The problem I keep running into is that all the
> variables keep getting inserted into one row and not individual ones. My
> INSERT code as follows.
>
> <cfquery datasource="whatever">
> INSERT into Tablename (Fieldname)
> VALUES ('#field1#, #field2#, #field3#')
> </cfquery>
>
> Thanks in advance.
>
> spencer
>
> --------------------------------------------------------------------------
> ----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
**********************************************************************
This email and any attachments are confidential and solely
for the use of the intended recipient. They may contain
material protected by legal professional or other privilege.
If you are not the intended recipient or the person responsible
for delivering to the intended recipient, you are not authorised
to and must not disclose, copy, distribute or retain this email
or its attachments. Although this email and its attachments
are believed to be free of any virus or other defect, it is the
responsibility of the recipient to ensure that they are virus free
and no responsibility is accepted by the company for any
loss or damage arising from receipt or use thereof.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.