I had the same problem, but outside of UDFs..  I was testing dynamic SQL
statements, and ran into a situation where the var i created would have
single quotes around the appropriate items, but when the SQL server got it,
it had double single quotes.  If i removed the original single quotes
(hoping for at least on pair of single quotes) all quotes were removed.  The
same thing happend if i tried to use double quotes, when the SQL server got
it, it had double double quotes and the SQL server threw an error.

I'm using CF5, i dont know whether this is an issue with CF4.5 or not.

I played with it for about an hour and found some other way around my
particular problem.  I'd still like to know if this is a legitimate issue,
and if there is some kind of workaround.



If anyone knows...
-Ryan

-----Original Message-----
From: Thomas Chiverton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 6:22 AM
To: CF-Talk
Subject: CF5 adding extra quote marks to cfquery


I'm playing with some UDF's, and have this section of code
--
<cfoutput>
where:<br>
#MakeWhereClause(CreateRecordID( qQuery))#
</cfoutput>
                
<cfquery name="qDoesit" datasource="#request.dbname#">
select * from actuals where #MakeWhereClause(CreateRecordID( qQuery))#
</cfquery>      
--
This produces:
--
where:
dateid='04-Jan-01' and gcljobno=200140206 and taskid='GCL001' and
starttime='09:00' and resourceid='tchiverton' 
--
Then the error:
--
ODBC Error Code = S1000 (General error) 
[Oracle][ODBC][Ora]ORA-00933: SQL command not properly ended 
SQL = "select * from actuals where dateid=''04-Jan-01'' and
gcljobno=200140206 and taskid=''GCL001'' and starttime=''09:00'' and
resourceid=''tchiverton''"
--

So although my MakeWhere UDF is returning a correctly escaped SQL string,
when it goes inside the cfquery, and does the same bit of code, CF seems to
be adding extra quote marks.

Is this known behaviour ? Any way to run it off ? Other pleas for help
appreciated ? :-)

Regards,

Thomas Chiverton
Intranet Architect
01565 757 909
Another fine development by Boring Sigs Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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