On 02/04/2004 09:39 PM, [EMAIL PROTECTED] wrote:

Executing this:-

UPDATE BLAH SET TRANSLATION=? WHERE ROWID=?

used always to work for me, but after a recent upgrade, I notice that
trailing blank lines are getting truncated during this update.
Executing this statement instead, and the problem goes away:-

UPDATE BLAH SET TRANSLATION=? || '' WHERE ROWID=?

I'm using DBI 1.32 afaik (from the "man" page) with the latest oracle
database on RedHat ES 3.0.

Using the former version of Oracle on RedHat 9, there was no bug (both
"update" statements perform the same - nothing gets truncated).

Using an update statement without BIND variables works fine on
everything - eg:-

UPDATE BLAH SET TRANSLATION='line with

trailing blank lines

' WHERE ROWID='jkasdfkjhdfjk'

I tried a range of different connect strings and other stuff, but
after 3 hours of experimentation, I've narrowed it down to the above
info. nothing else I could find/do has any effect on the problem.

I think this is probably a bug (either in oracle, perl, RedHat or
DBI!) but if anyone knows otherwise, or has any other suggestions for
me to try (besides adding ||'' all thought my code!) please let me
know!

The Oracle OCI library trims trailing spaces for VARCHAR bind variables. It has been that way via DBI for at least a couple years. The workaround is to call $sth->bind_param( 1, SQL_CHAR ) before the first execute() call. The bind variable type is remembered for future execute() calls.

See ora_ph_type in http://search.cpan.org/dist/DBD-Oracle/Oracle.pm as
well.

--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to