> I have a line of Oracle pl/sql (9i) where I'm trying to add cfqueryparam in > CF7. > > I have: > #iif(len(trim(arguments.inStruct.a_person_id))eq > 0,DE("NULL"),DE("#arguments.inStruct.a_person_id#"))#, > > a coworker suggested: > <cfqueryparam value = "#arguments.inStruct.a_person_id#" CFSQLType = > "CF_SQL_NUMERIC" null="#IIF(len(arguments.inStruct.a_person_id),0,1)#"> > > But in reviewing it, I cannot tell if that is correct or not. I've gone over > the sql several times. Also, I don't know DE().
The DE function is kind of confusing, as it's only used within string evaluation to ... delay that evaluation. So, in your starting case, DE prevents its string argument from being evaluated as code. (You want the literal value of arguments.inStruct.a_person_id, not to treat that value as a CF expression from which you'd later get a literal value.) Your coworker's suggestion may well be correct, but it can be simplified. You don't need IIF in this case: <cfqueryparam ... null="#not len(arguments.inStruct.a_person_id)#"> Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352379 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm