cf replaces ' with '' in query
i am having a really odd issue trying to execute a database query with a cf script.
basically, i am looping through a csv file, creating an INSERT query as a string, and then running a cfquery using this string variable for the query text.
but, what is weird is that i am doing what i normally do to insert text info, but cf is messing it up (it seems like).
for instance, i start by declaring the first part of the statement:
<CFSET qryVar = "INSERT INTO table (field1, field2, etc...) VALUES ">
then as i loop, i do:
<CFSET qryVar = qryVar & "( '#item1#', '#item2', etc...)">
now, what is happening is that when i use qryVar in my CFQUERY:
<CFQUERY name="blah" datasource="blah">
#qryVar#
</CFQUERY>
it is changing a single quote into two single quotes.
what i saved in the string:
( 'string', 'string', etc...)
what is being used:
( ''string'', ''string'', etc.)
note: '' is two single ', not a ". so, i am getting an error because it is reading the '' as a null/empty text value, and is then trying to use the text as objects as the syntax would see it.
why would cf be changing my ' to ''?
