• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

HELP! cfprocparam not sending NULL value

New Here ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

I'm trying to send the value null to my stored procedure if the value of conf_date is 1/1/1900. It's not working! Here's how I'm trying to do it:

<cfif arguments.conf_date EQ "1/1/1900">
<cfprocparam type="in" cfsqltype="cf_sql_date" dbvarname="@conf_date" null="yes">
<cfelse>
<cfprocparam type="in" cfsqltype="cf_sql_date" dbvarname="@conf_date" value="#arguments.conf_date#" null="no">
</cfif>
TOPICS
Advanced techniques

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

I was curious so I looked it up.

The reference manual says,
"Optional. Yes or No. Indicates whether the parameter is passed as a null. If you specify Yes, the tag ignores the value attribute."

You don't have a value attribute to ignore. Maybe that's it, maybe it's not.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 16, 2006 May 16, 2006

Copy link to clipboard

Copied

try this
<cfif arguments.conf_date EQ "1/1/1900">
<cfprocparam type="in" cfsqltype="cf_sql_date" dbvarname="@conf_date" value="null" null="yes">
<cfelse>
<cfprocparam type="in" cfsqltype="cf_sql_date" dbvarname="@conf_date" value="#arguments.conf_date#" null="no">
</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 16, 2006 May 16, 2006

Copy link to clipboard

Copied

Just in case you use CF MX or CF 7 (this is from live docs):
Changed the dbvarname attribute behavior: it is now ignored for all drivers. ColdFusion MX uses JDBC 2.2 and does not support named parameters.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 16, 2006 May 16, 2006

Copy link to clipboard

Copied

LATEST
I seperate the logic from the tag

<cfif arguments.conf_date EQ "1/1/1900">
<cfset dateNull = "Yes">
<cfelse>
<cfset dateNull = "No">
</cfif>
<cfprocparam type="in" cfsqltype="cf_sql_date" dbvarname="@conf_date" value="#arguments.conf_date#" null="#dateNull#">

Ken

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation