Title: Stored Procedure Default value

I have a Stored Procedure, I am passing variables to it, some of them are passed as null

Example:
<cfprocparam type="In"
                                cfsqltype="CF_SQL_BIT"
                                value="1"
                                null="#iif(structKeyExists(session.contactNew.form, "smoker"), DE("no"), DE("yes"))#">

So, if the key exists in the structure its passing the value 1, otherwise it passes the parameter as NULL

In the stored procedure itself I declare the parameter with a default value, example;

@smoker BIT = 0,

My understanding was that if the parameter was passed as NULL it would take the default value of 0, is this correct?

Or will it only take the default value if the parameter does not exist, ie. not passed to the SP at all?

If thats the case, then you really can't work with default values in the SP.


PS. I know I could just pass it either 0 or 1instead of NULL, but this question has been on my mind for a while now....

Taco Fleur
07 3535 5072

Tell me and I will forget
Show me and I will remember
Teach me and I will learn

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to