The default constraint only works when you are not explicitly inserting or
updating the value of a column to something, including NULL. So since you
have the default constraint in place, then simply do:
<cfif LEN((TRIM(form["sortORD_#myIDX#"]))>
link_sort = <cfqueryparam value="#Form["sortORD_#myIDX#"]#"
cfsqltype="CF_SQL_VARCHAR">
</cfif>
On Fri, Sep 12, 2008 at 2:30 PM, Les Mizzell <[EMAIL PROTECTED]> wrote:
> OK, if I set my column "link_sort" with a default value of "99", and put
> this in my query...
>
> link_sort =
> <cfqueryparam
> value="#Form["sortORD_#myIDX#"]#"
> cfsqltype="CF_SQL_VARCHAR"
> null="#not len(Form["sortORD_#myIDX#"])#">
>
> ....and submit a blank form field - it inserts a NULL instead of the "99"
> default value.
>
> What's wrong?
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:312461
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4