On 2/20/03 1:17 PM, "Aidan Whitehall" <[EMAIL PROTECTED]> wrote:
> I've got an array of structures and am looping through them and writing > several queries on the fly. However, I can't hit on just the right > combination of quotation marks to stop it throwing an error. > > Does anyone know how to write it correctly, outputting either null or > the value surrounded by apostrophes? A change in direction would be to consider if you could construct your queries with CFQUERYPARAM. Then you wouldn't need to worry about quoting or apostrophes. I'm not good off-the-cuff with cfqueryparam. I'm sure someone here can give a good example of a null check added to a cfqueryparam ... Any takers? > > #Iif(not StructKeyExists(values[i], "proximity"), DE("null"), "'" & > "values[i]["proximity"]" & "'"))# > > > Thanks! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4