> I was wondering which one are best practices when doing a db
> insert/update:
> <cfqueryparam value="#lfield#" cfsqltype="CF_SQL_INTEGER"
> null="#iif((filed eq ""), de("yes"), de("no"))#" />,
>
> or
> <cfif val (field) gt 0)>
> <cfqueryparam value="#lfield#"
> cfsqltype="CF_SQL_INTEGER" /> <cfelse>
> null
> </cfif>
Def the first one in my opinion.
Roll your own isNull() UDF to get rid of the IIF. You will get to reuse
it a few times I promise!
(you could use isEmpty off of CFLIB IIRC as well if your NULL choices
are pretty limited)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254409
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4