On Mon, Oct 21, 2002 at 05:34:11PM -0500, Stephen Clouse wrote:
> This is not a DBD::Oracle bug, but an OCI "feature" (see MetaLink note
> 1009209.6). Oracle strips all trailing whitespace off a variable bound as
> VARCHAR2 (which is DBD::Oracle's default). Since the value is nothing but
> whitespace, this results it in being interpreted as NULL (thanks in part to
> Oracle's broken treatment of zero-length strings, but that's another rant
> entirely).
>
> You can fix this "feature" by adding this to the top of your script, to import
> the type constants:
>
> use DBD::Oracle qw( :ora_types );
hmm. that doesn't look very portable to me... If anything, I'd like a solution
which is RDBMS independent.
Looking further, I saw
use DBI qw (:sql_types);
$argh->bind_param(2, ' ', SQL_CHAR );
but I'm not sure how portable *that* is.
Shouldn't DBI just do the right (portable) thing, and if for some reason users
want the broken behaviour they can explicitly mention they want it?
Ed