On Sun, Jan 20, 2002 at 03:27:51PM -0800, Michael A Chase wrote:
> I'd prefer a private attribute in DBD::Oracle since it's an Oracle specific
> problem.

The particular problem prompting this is Oracle specific, but I have had
requests from users of other databases to make ChopBlanks more generic.

Plus I think there's more than one driver that does that already.

Tim [undecided].

> --
> Mac :})
> ** I normally forward private questions to the appropriate mail list. **
> Give a hobbit a fish and he eats fish for a day.
> Give a hobbit a ring and he eats fish for an age.
> ----- Original Message -----
> From: "Tim Bunce" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Sunday, January 20, 2002 15:14
> Subject: DBD::Oracle: "" vs NULL, and a possible change to the ChopBlanks
> attribute
> 
> 
> > It's well know that Oracle#s state of the art database server can
> > rarely tell the difference between an empty string and a NULL
> > (I presume that's not changed recently, though I'd be very happy
> > to be told otherwise).
> >
> > So people who don't want empty strings being stored as NULLs in
> > their fields tend to use some specific non-empty string insead,
> > a single space being very common.
> >
> > The DBI has an attribute called ChopBlanks that, when set true,
> > enables the automatic removal of trailing spaces from fetched CHAR
> > field data (which Oracle has 'helpfully' padded out to the declared
> > fixed width).
> >
> > I'm considering extending the definition of ChopBlanks to include
> > VARCHAR type fields. This has been requested several times over the
> > years by DBI users. The change would neatly hide the use of a space
> > to represent an empty string.
> >
> > I'd like to get some feedback on this idea from DBD::Oracle users.
> >
> > I'm especially interested in the risk of changing the behaviour of
> > existing code. That would _only_ happen if you explicitly set
> > ChopBlanks, and fetch VARCHAR data that has trailing spaces, and the
> > removal of those spaces would change the behaviour of your application.
> >
> > An alternative approach would be to add a new private attribute
> > that just translates a single space value into an empty value.
> > That would be "safer" but less generically useful.
> >
> > Tim
> >
> > p.s. I've sent this to both [EMAIL PROTECTED] and [EMAIL PROTECTED]
> > Please delete at least one of these addresses when replying. Thanks.
> >
> > p.p.s. A corresponding mechanism to optionally automatically treat
> > empty strings bound to placeholders as a single space will probably
> > also be added to DBD::Oracle and enabled via private attribute.
> 
> 

Reply via email to