Sorry if this turns out to be gibberish but I'm been battling with a
host of unicode problems today and I am quickly losing track.
I can't make ChopBlanks work properly in DBD::ODBC. It works if I use:
$dbh->{ChopBlanks} = 1;
$sth = $dbh->prepare(q/select * from sometable/);
and does not work if I use:
$sth = $dbh->prepare(q/select * from sometable/);
$sth->{ChopBlanks} = 1;
and it seems "ChopBlanks = DBIc_has(imp_sth, DBIcf_ChopBlanks);" is not
true in DBD::ODBC's dbdimp.c.
Various DBD's use DBIc_has (DBD::ODBC, DBD::Pg, DBD::Oracle) or DBIc_is
(DBD::mysql).
The DBI::DBD documentation says (for XS):
"Note that you can also obtain standard attributes such as /AutoCommit/
and /ChopBlanks/ from the attributes parameter, using
|DBD_ATTRIB_GET_IV| for integer attributes."
and
"The dbd_db_STORE_attrib method
You do not handle all attributes; on the contrary, you should not handle
DBI attributes here: leave this to DBI. (There are two exceptions,
/AutoCommit/ and /ChopBlanks/, which you should care about.)"
I presumed a DBD should "care" about ChopBlanks as DBI is not going to
remove the trailing blanks not that DBI is not going to store the
ChopBlanks value and yet when I call DBIc_has(imp_sth, DBIcf_ChopBlanks)
on a sth it returns false even though I set $sth->{ChopBlanks} = 1.
DBD::ODBC (like all the other DBDs I've checked) does not handle
ChopBlanks in the STORE or FETCH routines.
Any ideas what is wrong?
Thanks
Martin