Cfqueryparam allows to to specify that NULL values are allowed anyway, so
you don't need to do that check.

Russ 

-----Original Message-----
From: Victor Moore [mailto:[EMAIL PROTECTED] 
Sent: 27 September 2006 16:51
To: CF-Talk
Subject: Insert best practice

Hi,

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>

First one seems more compact but not sure the delay evaluation. I mean for a
couple a columns I guess it doesn't matter but for a big table it may add
up.
The second one looks more clear. At least for me

Thanks
Victor




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:254405
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to