CLOB fields not generically assignable

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
Tom R

CLOB fields not generically assignable

Post by Tom R » Wed 02 Nov 2005 15:26

The scenario:
Delphi 7
NET connection
non-persistent fields (dynamic queries)

When attempting to assign values (targetDS.FieldByName(fn).Value := sourceDS.FieldByName(fn).Value), I get the exception:

ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 819
ORA-06512: at line 1

This code worked fine with dbexpoda 1.87, but we need to upgrade for Win2003 SP1 and Oracle 10gR2. Using an OCI connection also works, but we support so many DB servers that managing tnsnames.ora would be a nightmare.

I'm looking for either a workaround (other than determining whether the field is a CLOB or not before setting its value) or a fix.

-Tom R

Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Thu 03 Nov 2005 08:20

We cannot reproduce your problem with Oracle server, Oracle server, database charset AL32UTF8, DbxOda 100. We tried to insert 15000 of English characters.
Please specify your version of Oracle server, database charset, client charset (in TSQLConnection parameters)

Tom Reedy

Post by Tom Reedy » Thu 03 Nov 2005 19:15

targetDS is connected to Oracle server, charset WE8MSWIN1252 and sourceDS is connected to Interbase 6.0 with dbexpint

I found a work-around by using an intermediate TStringList to transfer the content:
slClobValue := TStringList.Create;
slClobValue.Text := sourceDS.fieldbyname(fn).AsString;

The same error occurs when directly saving the content of a TRichEdit to a CLOB TField:

The workaround for this is to stream to a TStringList first:
TempStringList := TStringList.Create;
TempStream.Position := 0;

The workarounds get me by for now, but are inefficient.

Tom Reedy

Post Reply