Re: Using IIf() in query value

2006-06-05 Thread Tom Chiverton
On Friday 02 June 2006 23:20, Jim McAtee wrote:
 cfquery datasource=#dsn#
 INSERT INTO cctransactions (
   name,
   response
   )
 VALUES (
   '#form.name#',
   '#IIf(StructKeyExists(authresponse, http_response),
 authresponse.http_response,
 DE())#'
   )
 /cfquery


VALUES (
  cfqueryparam value=#form.name#,
  cfif StructKeyExists(authresponse, http_response
cfqueryparam value=#authresponse.http_response#
cfelse

/cfif
  )

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.

We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the 
Year at the 2005 Growth Company Awards


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242397
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54


Using IIf() in query value

2006-06-02 Thread Jim McAtee
I'm working in CF5. I thought single quotes within strings were always 
escaped in a cfquery.  I have a query using an IIf() in the value and this 
doesn't appear to be the case.  Does this have something to do with how 
I'm doing the evaluation of the second argument in the IIf() below?

In this simplification of the query the single quote within the first 
string is escaped, but the second one is not, causing an error.

form.name = John O'Mara
authresponse.http_response = 1|1|1|John O'Mara|approved

cfquery datasource=#dsn#
INSERT INTO cctransactions (
  name,
  response
  )
VALUES (
  '#form.name#',
  '#IIf(StructKeyExists(authresponse, http_response),
authresponse.http_response,
DE())#'
  )
/cfquery 


~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242161
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations  Support: http://www.houseoffusion.com/tiny.cfm/54