Big problems with TParam for CLOB columns
Posted: Wed 26 Oct 2005 16:36
Hi!
We try to insert data into a table with two CLOB columns.
If the blob text is shorter than 4000 characters all works fine.
If we try to insert more than 4000 characters into a CLOB field, we
receive different errors depending on the code we use to setup the TParam.
Here are the possible error messages:
ORA-01461 can bind a LONG value only for insert into a LONG column
ORA-12571 // no text!!!
ORA-01460 unimplemented or unreasonable conversion requested
LOB not initialized
We have tried:
p: TParam; // the param from the TSQLDataset
s: string; // a string with 11000 bytes
a)
p.AsBlob:=s;
// error on execsql
b)
p.Datatype:=ftOraCLob;
p.Value:=s;
// error on execsql
c)
p.AsMemo:=s;
// error on execsql
d)
p.Datatype:=ftOraCLOB;
p.SetBlobData(@s[1], Length(s));
// error on execsql
e)
p.Datatype:=ftBlob;
p.SetBlobData(@s[1], Length(s));
// error on execsql
f)
p.Datatype:=ftString;
p.SetBlobData(@s[1], Length(s));
// error on execsql
and so on. None of them works with more than 4000 bytes of data.
What is a working method of setting up this parameter with
more than 400 Bytes ??
Are there any limits on CLOB params ??
Thanks
Silvio
We try to insert data into a table with two CLOB columns.
If the blob text is shorter than 4000 characters all works fine.
If we try to insert more than 4000 characters into a CLOB field, we
receive different errors depending on the code we use to setup the TParam.
Here are the possible error messages:
ORA-01461 can bind a LONG value only for insert into a LONG column
ORA-12571 // no text!!!
ORA-01460 unimplemented or unreasonable conversion requested
LOB not initialized
We have tried:
p: TParam; // the param from the TSQLDataset
s: string; // a string with 11000 bytes
a)
p.AsBlob:=s;
// error on execsql
b)
p.Datatype:=ftOraCLob;
p.Value:=s;
// error on execsql
c)
p.AsMemo:=s;
// error on execsql
d)
p.Datatype:=ftOraCLOB;
p.SetBlobData(@s[1], Length(s));
// error on execsql
e)
p.Datatype:=ftBlob;
p.SetBlobData(@s[1], Length(s));
// error on execsql
f)
p.Datatype:=ftString;
p.SetBlobData(@s[1], Length(s));
// error on execsql
and so on. None of them works with more than 4000 bytes of data.
What is a working method of setting up this parameter with
more than 400 Bytes ??
Are there any limits on CLOB params ??
Thanks
Silvio