Forum OpenACS Development: Re: How to prevent empty string -> NULL conversion
2: Re: How to prevent empty string -> NULL conversion (response to 1)
Posted by Don Baccus on 07/19/05 01:01 AM
Probably the easiest thing to do is to have your function substitute the empty string for null ...
This behavior is mimicking an Oracle-ism, which we do in order to make it possible to write portable code that works with both RDBMS's. Also, without these semantics you couldn't pass NULL in a bindvar.
Another possibility is to do '$variable' rather than :variable. If this variable comes from a form, though, be wary of "SQL smuggling" (avoiding this source of hackability is the reason we use bindvars in the first place).