Actually, I think you can solve this problem easily. If the only two
bad options are zero and "" then try this...
<cfparam name="Variables.myPassIn" default="" />
<cfif Variables.myPassIn is 0>
<cfset Variables.myPassIn = "" />
</cfif>
<cfprocparam cfsqltype="CF_SQL_INTEGER" value="#Variables.myPassIn#"
null="#not len(Variables.myPassIn)#" />
Of course replace Variables.myPassIn with whatever your variable is.
Steve
-----Original Message-----
From: Kris Jones [mailto:[email protected]]
Sent: Thursday, October 15, 2009 8:52 AM
To: cf-talk
Subject: Re: cfprocparam - null setting
The former: It ignores anything passed to it, and sets the value to
null.
Note, however, that whatever you are passing to the procparam must still
validate; e.g., a variable in the value attribute must exist:
<cfprocparam .... value="#mygreatvariable#" null="#not
isdefined('mygreatvariable)#">
Will throw a CF error.
Cheers,
Kris
> I have a question about cfprocparam. If I use the "nulll" option, does
it
> ignore anything passed to it and set the value to null or
>
> Does it set a null value when nothing is passed to it.
>
>
>
> I have a stored procedure that chokes on an integer value when either
zero
> or an empty string is passed.
>
> My other option is to pass an exec statement through cfquery and try
to use
> the settable null parameter or cfquery param.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327238
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4