Troy,
Try this:
<cfquery>
select...from....
where
rowid IN ( #PreserveSingleQuotes(Key)# )
</query>
I often have this issue when assembling variables to be placed in an SQL
string, PreserveSingleQuotes seems to sort it.
--
Neil Robinson
> -----Original Message-----
> From: Troy Simpson [mailto:[EMAIL PROTECTED]]
> Sent: 01 August 2000 15:44
> To: cf-talk
> Subject: Single quote being replace in Query. Why? (Troy)
>
>
> I am creating a dynamic string to be included in the WHERE clause of a
> SELECT statement.
> I need to include single quotes in the string. Here is the literal
> select statement:
>
> SELECT
> rowid,
> desc
> FROM
> table
> WHERE
> rowid IN ( 'AAAESKEK34K', 'AAAEE64D8D' )
>
>
> I create my string like this inside of a loop:
> <cfset Keys = Keys & " ' " & #vKeyList# & " ' ">
>
> And my query statement is like this:
> <cfquery name="qryResults" datasource="DSN">
> SELECT
> rowid,
> desc
> FROM
> table
> WHERE
> rowid IN ( #Key# )
> </query>
>
> Why is it that when I execute the template, I get an ERROR like this:
> Oracle Error Code = 907
> ORA-00907: missing right parenthesis
>
> SQL = "SELECT rowid, desc FROM table WHERE ROWID IN (
> ''AAABI+AAFAAABdUAAL'', ''AAABI+AAFAAABdUAAK'',
> ''AAABI+AAFAAABdUAAJ'',
> ''AAABI+AAFAAABdHAAe'' )"
>
> ***ColdFusion is substitution my single quotes with double quotes and
> this is choking the query.
>
> Thanks,
> Troy
>
> --
> Troy Simpson | North Carolina State University
> NCSU Libraries | Campus Box 7111 | Raleigh | North Carolina
> ph.919.515.3855 | fax.919.513.3330
>
>
> --------------------------------------------------------------
> ----------------
> Archives: http://www.mail-archive.com/[email protected]/
> 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.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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.