in reply to Re: DBI, place holders and CGI forms
in thread DBI, place holders and CGI forms

My db is 10G oracle. I don't understand your bind to null answer. Do you mean bind the variable for example $foo = $cgi->param('foo') || undef; and call execute with $foo, or something else?

Replies are listed 'Best First'.
Re^3: DBI, place holders and CGI forms
by kennethk (Abbot) on Jun 02, 2011 at 15:57 UTC
    Something functionally equivalent, yes. DBD::Oracle will map undef to an Oracle null. I would probably build a hash with expected field/value pairs (protection against an untrusted client), and pass that into my query routine. Any unspecified parameter would therefore be automatically mapped to undef.

      but beware you cannot do "where mycol = ?" and then pass a value of undef (mapping to NULL) and expect it to work.