I have a variable I build before inserting into my query called where

<cfset where = "#where##table#id = '#attributes.id#'">

Then I put into my query...
<cfquery name="search"
  datasource="#session.datasource#">
 SELECT t.id,t.product_name,t.operator,t.stage,t.qc_lot,r.s4_time,r.s5_time
 FROM trip_data t, report_stamps r
 WHERE t.id = r.id AND #where#
</cfquery>

If I output the variable before the query like so (line 2) I get t.id='100'

1. <cfset where = "#where##table#id = '#attributes.id#'">
2. <cfoutput>#where#</cfoutput><cfabort>
3. <cfquery name="search"
4.  datasource="#session.datasource#">
5.  SELECT
t.id,t.product_name,t.operator,t.stage,t.qc_lot,r.s4_time,r.s5_time
6.  FROM trip_data t, report_stamps r
7.  WHERE t.id = r.id AND #where#
8. </cfquery>

However when I ditch line 2 the query output has two single quotes
surrounding my variable.
EXAMPLE OUTPUT IN QUERY
1. SELECT t.id,t.product_name,t.operator,
2.      t.stage,t.qc_lot,r.s4_time,r.s5_time
3. FROM trip_data t, report_stamps r
4. WHERE t.id = r.id AND t.id = ''100''

Notice line 4

Does anyone know why CFML adds this mysterious second set of single quotes
when I output within the cfquery tags?




Ray Bujarski
Direct 858-845-7669
Pager  858-636-9900

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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