Re: DBD-Oracle-1.18/err_unicode/err_twolongstr.msg
am 28.07.2006 14:44:30 von scolesThanks Jan this is very helpful. I will have a look at it this morning and
perhaps I can figure out if it is a bug in DBD or Oracle.
Cheers John Scoles
"Jan Kasprzak"
news:20060727180113.GJ1703@fi.muni.cz...
> Hello,
>
> I want to add a "me too" with a description to the messages in
> DBD-Oracle-1.18/err_unicode/err_twolongstr.msg. I also get the
>
> ORA-01461: can bind a LONG value only for insert into a LONG column
>
> message after moving my system to UTF-8.
>
> The test case is:
>
> CREATE TABLE test_table (
> id integer not null primary key,
> txt varchar2(4000)
> )
>
> Just an empty table with two columns.
>
> Now set NLS_LANG=american_america.AL32UTF8, get some $dbh
> with PrintError => 1, and do
>
> use utf8;
> my $val = ("\x{159}" x 0) . ('a' x 1334); # make an is_utf8() string
> $dbh->do(q{
> UPDATE test_table SET txt = ? WHERE id = ?
> }, {}, $val, 1);
>
> It fails with the above ORA-01461 message.
>
> Now some observations:
>
> - removing the ("\x{159}" x 0) part (thus making the string $val being
> non-utf8) makes the problem disappear.
> - changing the 1334 to 1333 makes the problem disappear (and for anything
> bigger than 1333 it does not work, and for anything shorter or equal
> it works).
> - changing the "WHERE id = ?" to "WHERE id = 1" and removing the second
> binded parameter (or removing the whole WHERE clause) makes the
> problem disappear.
> - this is perl-5.8.6 on Fedora Core 4-i386, oracle-9.2.0 client.
> It works for me on these two systems:
> ia64 (SGI Altix), SUSE SLES9, oracle-9.2.0 client, and
> x86_64, Fedora Core 5, oracle instantclient-10.2. So it seems
> it is oracle-9.2.0/i386 client specific.
> - I have set $dbh->trace(15) just before the $dbh->do() statement,
> and ran the above script first unmodififed, and then with
> the number 1334 changed to 1333. I am attaching the diff -u
> of these two traces. I think the first significant change is
> the error from ->execute.
>
> I believe this is an error in 9.2.0/i386 client, but I may be wrong.
>
> Hope this helps somebody to fix the problem.
>
> -Yenya
>
> --
> | Jan "Yenya" Kasprzak
> |
> | GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E
> |
> | http://www.fi.muni.cz/~kas/ Journal: http://www.fi.muni.cz/~kas/blog/
> |
>> I will never go to meetings again because I think face to face meetings
>> <
>> are the biggest waste of time you can ever have. --Linus Torvalds
>> <
>