try the "PreservSingleQuotes" CF Function.. such as...

<!------------------------------------->
SELECT
    rowid,
    desc
FROM
    table
WHERE
    rowid IN  (PreserveSingleQuotes(Key))
<!------------------------------------->


that is it :)



Jeremy Allen
[EMAIL PROTECTED]
[Insert cool title here]

-----Original Message-----
From: Troy Simpson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 10:44 AM
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.

Reply via email to