Tim Bunce wrote: >On Fri, Jan 18, 2002 at 05:11:48PM +0100, H.Merijn Brand wrote: > >> "ChopBlanks" (boolean, inherited) >> This attribute can be used to control the trimming of trailing >> space characters from fixed width character (CHAR) fields. No >> other field types are affected, even where field values have >> trailing spaces. >> >>**WHY** only from fixed width character fields, and not from varchar2 fields ? >>:(((( >> >>We've got a multidatabase environment, in which we try *very* hard not to get >>NULL fields - ever -. This means we have to insert triggers in Oracle to >>inhibit it's fu**ing annoying behaviour of translating empty varchar fields to >>NULL. (If I insert an empty string I expect an empty string, and not a null field!) >> > >That has to be one of Oracle's most annoying, er, um, 'features'. > >>The triggers translate all empty strings to a string with just a single space >>in it on insert and update. >> > >I am open to changing my mind on this one. > >I'd appreciate any input from driver authors who either: > >a) set ChopBlanks on by default (which they probably shouldn't) >
Not guilty (referring to DBD::Informix, of course). Is ChopBlanks settable in the DBI->connect? If not, please can we make it so (and if it is, thanks, and when did that happen - and I know it was probably 5 years ago, but ...) > >or >b) don't want ChopBlanks extended to VARCHAR fields > I take the view that trailing blanks are nominally significant in a VARCHAR field. If you want to provide ChopBlanks functionality for VARCHAR too, use a separate attribute ChopVarcharBlanks or something. I fully accept that distinguishing an empty string from a NULL is hard work - I don't want to explain what Informix does, but it does manage to do it for VARCHARs at the storage level. It's just a real pain at the client side (meaning for DBD::Informix). >(Let's defer the issue of which _specific_ string types ChopBlanks >should apply to for now and just consider CHAR and VARCHAR's at >this point.) > OK. NCHAR and CHAR should be chopped. VARCHAR and NVARCHAR should not. Anything else is not fully standard. Speaking personally, I don't think text blobs should be chopped for the same reasons that varchar should not - they are nominally significant. -- Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED]) Guardian of DBD::Informix 1.00.PC1 -- see http://www.cpan.org/ #include <disclaimer.h>
