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

Empty datefield not passing any parameter?

Guest
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

I'm entering service calls (date requested (DateCalled), date performed (DateService), tech name, notes) into a db. I'm using the same form to edit existing calls or add new ones. I want the ability to add a record without submitting the date performed (so the user can edit that record with the data later).

I've put in code that compares the two dates to make sure the date performed isn't before the date requested, and to make sure the date performed isn't in the future. All that works. When I try to add a condition to test for an empty string, I get a "Formal parameter '@TNotes' was defined as OUTPUT but the actual parameter not declared OUTPUT." error -- and the procedures all work FINE except in this one instance, so I don't want to change the stored procedures.

This breaks both on new records, and if you edit an existing record to remove the DateService. It seems to me that the empty string isn't getting passed to the db at all, because I think that error indicates that my stored procedure is expecting more (or maybe fewer somehow) parameters than it got.

Any insights or hints are welcomed. I'm attaching a pile of code. First section displays form to edit existing record/add new one. Second is the action page to edit/add the record. Last three bits are the stored procedures.

TOPICS
Advanced techniques

Views

261

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

correct answers 1 Correct answer

Guide , Jul 11, 2007 Jul 11, 2007
>> When I try to add a condition to test for an empty string, I get a "Formal parameter
>> '@TNotes' was defined as OUTPUT but the actual parameter not declared OUTPUT." error

Are you setting a default for date peformed when its an empty string?

<cfif NOT IsDate(form.DateService)>
<cfset form.DateService = (whatever default date you want)>
</cfif>

Or if its appropriate for your procedure, you could submit a NULL value instead of a default date
<cfprocparam type="in" value="#form.DateServic...

Votes

Translate

Translate
Guide ,
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

>> When I try to add a condition to test for an empty string, I get a "Formal parameter
>> '@TNotes' was defined as OUTPUT but the actual parameter not declared OUTPUT." error

Are you setting a default for date peformed when its an empty string?

<cfif NOT IsDate(form.DateService)>
<cfset form.DateService = (whatever default date you want)>
</cfif>

Or if its appropriate for your procedure, you could submit a NULL value instead of a default date
<cfprocparam type="in" value="#form.DateService#" null="yes" ....>

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
Guest
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

LATEST
cf_dev2, I kiss your feet.

I put a CFIF in the middle of the CFSTOREDPROC to test for the empty string, and return a null if it's there; otherwise it passes the value.

Thank you!

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