Sorry you weren't aware of the "ordering" issue.  It often makes me 
wonder what CFSTOREDPROC is really doing, aside from invoking a 
platform-specific call to an SP...

At any rate, the way I deal with null/not null situation is this:

<cfprocparam type="In" cfsqltype="CF_SQL_CHAR" dbvarname="ctcd" 
value="#arguments.ctcd#" null="#YesNoFormat(NOT Len(arguments.ctcd))#" 
maxlength="3">

..essentially, the whether or not it is NULL is determined by any 
string length of the parameter passed in.

It is a kludge, but a clever one which I lifted from another.

S. Isaac Dealey wrote:

>I knew there were reasons I had avoided using <cfstoredproc> prior to
>ColdFusion MX ...
>
>So with the advent of MX and not wanting to force my clients / customers to
>use the odbc bridge drivers, I decided to convert all of my "exec sp_myproc"
>syntax in <cfquery> tags to <cfstoredproc> tags and after pounding my head
>for about an hour trying to figure out why a given procedure didn't work, I
>came accross 1 ( count them, ONE ) obscure reference on an obscure forum
>that mentions that the order of the <cfprocparam> tags must be the same as
>the order of the parameters as defined in the stored procedure.
>
>Also, although the documentation for <cfprocparam> says the attribute
>null="" takes a boolean, yes/no value, it does not -- it takes no value and
>passes null regardless of any value given.
>
>Does anyone know if either or both of these are still true in CFMX?
>
>Or if either of them are MSSQL specific and if so why?
>
>Not that it will matter much if I hope to continue to support CF5, but it's
>really annoying and frustrating to have to do this all the time:
>
><cfif yesnoformat(attributes.myattribute)>
>       <cfprocparam type="in" dbvarname="myparam"
>       value="#attributes.myattribute#"
>       cfsqltype="cf_sql_integer">
><cfelse>
>       <cfprocparam type="in" dbvarname="myparam"
>       null cfsqltype="cf_sql_integer">
></cfif>
>
>Instead of simply using either a <cfif> statement (and allowing the
>procedure to use a default value) OR a null attribute, ie:
>
><cfif ...>
>       <cfprocparam>
></cfif>
>
>or
>
><cfprocparam ... null="#isnull#">
>
>
>
>Thanks,
>
>
>Isaac Dealey
>Certified Advanced ColdFusion 5 Developer
>
>New Epoch
>www.turnkey.to
>954-776-0046
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to