right.  because when you lump several statements together via CFQUERY, only the 
information from the last one is returned (IIRC).

try moving it to the last slot, see what happens.

christopher olive
cto, vp of web development, vp it security
atnet solutions, inc.
410.931.4092
http://www.atnetsolutions.com


-----Original Message-----
From: BEN MORRIS [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 4:08 PM
To: CF-Talk
Subject: Scary SQL non-error on multiple inserts


I came across a scary sql non-error. Thought I'd share.  It can be convenient to toss 
multiple insert statements into one cfquery.  Consider the below code where the field 
'Description' is varchar(10):

<cfquery datasource="#application.Datasource#">
INSERT INTO Table (Code, Description) VALUES ('a', 'yo')
INSERT INTO Table (Code, Description) VALUES ('b', 'this string is too long')
INSERT INTO Table (Code, Description) VALUES ('c', 'yo')
</cfquery>

This will not throw an error. (I am using CF 4.5/SQL Server 2K)

If you did the second statement first, it will throw a sql data truncation error.  In 
the above case, it will insert the first and third row, but not the second.

If you do 3 separate <cfquery>s, then of course, the second would throw an error.


______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to