> I am wondering if there is a more efficient way to do this. I
> want to be able to blindly pass in my vars to a stored
> procedure, and let SQL determine if a NULL is required or
> not. One variable example is below on how I am passing it, as
> well as the first few lines of the stored procedure. Is this
> the only way to achieve this and not store a space in the column?
>
> <cfif trim(AUTH_AUTH_AVS) NEQ "">
> <cfprocparam type="In" variable="@AUTH_AUTH_AVS"
> cfsqltype="CF_SQL_VARCHAR" value="#auth_auth_avs#"> <cfelse>
> <cfprocparam type="In" variable="@AUTH_AUTH_AVS"
> cfsqltype="CF_SQL_VARCHAR" null="Yes">
> </cfif>
>
> And the start of the stored proc:
> CREATE PROCEDURE nwoSP_insTblCCAuthLog (
> @auth_auth_avs char (1)  = NULL ,

You could simplify that a bit by embedding your conditional logic within the
NULL attribute of your CFPROCPARAM:

<cfprocparam ... value="#AUTH_AUTH_AVS#" null="#YesNoFormat(NOT
Len(Trim(AUTH_AUTH_AVS))#">

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to