ORA-22835 on saving BLOB to LONG RAW column

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Mon 08 Nov 2010 09:44

AlexP wrote:Hello,

You should set the OraQuery1.Options.TemporaryLobUpdate property to true, the TOraQuery parameters for BLOB should be DataType = OraBlob and ParamType = ptInput, and for LONG RAW they should be DataType = Blob and ParamType = ptInput.
well, there you have the problem, so there's no single code that allows full input for both datatypes.

Is there a way to detect the parameter datatype (eg after Prepare, like with InterBase)?
AlexP wrote: The sql statment:

INSERT INTO TEST_BLOB
(ID, TST_LONG_ROW, TST_BLOB)
VALUES
(:ID, :TST_LONG_ROW, :TST_BLOB)

To insert data use the following code:

OraQuery1.ParamByName('ID').AsInteger:= 1;
OraQuery1.ParamByName('TST_LONG_ROW').LoadFromStream(stream,ftBlob);
OraQuery1.ParamByName('TST_BLOB').LoadFromStream(stream, ftOraBlob);
OraQuery1.Execute;

It this case all data (BLOB and LONG RAW) will be inserted correctly.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 08 Nov 2010 13:04

hello,

Now the TOraQuery.Prepare method doesn't work with BLOB ParamType correctly.
We are trying to fix it.
We will notify you as soon as we have any results.

Now you should manually set the ParamType for BLOB fields like:

OraQuery1.ParamByName('TST_LONG_ROW').ParamType:= ptInput;
OraQuery1.ParamByName('TST_BLOB').ParamType:=ptInput;

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Mon 08 Nov 2010 13:07

AlexP wrote:hello,

Now the TOraQuery.Prepare method doesn't work with BLOB ParamType correctly.
We are trying to fix it.
We will notify you as soon as we have any results.

Now you should manually set the ParamType for BLOB fields like:

OraQuery1.ParamByName('TST_LONG_ROW').ParamType:= ptInput;
OraQuery1.ParamByName('TST_BLOB').ParamType:=ptInput;
So, if you can find a fix for this, ODAC will be able to detect "ftBlob" or "ftOraBlob" by itself?

That would be a most welcome fix.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 08 Nov 2010 13:48

Hello,

Yes, we will try to identify the type of BLOB fields correctly.

Post Reply