Sterin, Ilya <[EMAIL PROTECTED]> wrote:

> Within the where clause of the query that is prepared...'

> where foo = ?

> When binding an undef value when executing, this executes "where foo =
> NULL".  In Oracle there is a difference between foo = NULL and foo is NULL.
> This also kind of disallows you to prepare the statement, since you must
> check for the undef binding value and reprepare with "is NULL".

Ok, I'll bite.
Let bar be a table with foo and baz being strings or varchars
or similar.

    insert into bar (foo,baz) values ('NULL', 'inserted string NULL');
    insert into bar (foo,baz) values ( NULL , 'inserted (undefined) NULL');

    select * from bar where foo = ?

> Maybe someone knows a better way of doing this, but I would envision a
> facility that does this for you when binding NULLs to where clause
> placeholders.

Try binding 
    my $bindvar = "NULL";
and tell me which of the 2 rows will be selected.  Tell me
what would happen if DBI transformed the NULL in $bindvar to
"is null".

Think that instead of "Remember, NULL is special" you had
"Remember, any string or varchar or char etc. that has the
value 'NULL' (4 ascii chars) is not selectable".

I do not see yet if DBI or DBD::Oracle could map the undef
value to NULL.

-Wolfgang

Reply via email to