ORA-22275: invalid LOB locator specified

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
lepr8
Posts: 4
Joined: Tue 29 Jan 2013 10:41

ORA-22275: invalid LOB locator specified

Post by lepr8 » Fri 01 Feb 2013 07:55

Hi, I obtain this error when i do a INSERT SQL command in a table where CLOB field is present.

Example

create table ART_1 (
id number(5,0) not null,
testo CLOB not null
)

.........
valore:='TEST'
sql.Text:='insert into ART_1 values (100,:a1)';
Params[0].DataType:=ftOraClob;
stream:=TStringStream.create(valore);
stream.Position:=0;
Params[0].LoadFromStream(stream,ftOraClob);
stream.free;
ExecSQL();


Thanks.

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

Re: ORA-22275: invalid LOB locator specified

Post by AlexP » Fri 01 Feb 2013 11:10

Hello,

To insert CLOB/BLOB values, you should use Oracle EMPTY_CLOB/EMPTY_BLOB functions. The following is your fixed sample:

Code: Select all

  valore := 'TEST';
  SQLQuery1.sql.Text := 'insert into ART_1(id, testo) values (100,EMPTY_CLOB()) RETURNING testo  INTO :testo';
  SQLQuery1.Params[0].ParamType := ptInput;
  SQLQuery1.Params[0].DataType := ftOraClob;
  stream := TStringStream.create(valore);
  stream.Position:=0;
  SQLQuery1.Params[0].LoadFromStream(stream,ftOraClob);
  stream.free;
  SQLQuery1.ExecSQL();

lepr8
Posts: 4
Joined: Tue 29 Jan 2013 10:41

Re: ORA-22275: invalid LOB locator specified

Post by lepr8 » Fri 01 Feb 2013 14:09

thanks for reply.

it's work.


thank you very much!

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

Re: ORA-22275: invalid LOB locator specified

Post by AlexP » Fri 01 Feb 2013 14:26

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

Ting
Posts: 1
Joined: Fri 14 Jun 2013 06:41

Re: ORA-22275: invalid LOB locator specified

Post by Ting » Fri 14 Jun 2013 06:47

sorry. I have the same problem.
I have to use stored procedure to assigned the clob field.
How could I specify the LOB locator through stored procedure? :cry:

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

Re: ORA-22275: invalid LOB locator specified

Post by AlexP » Fri 14 Jun 2013 10:17

Hello,

Please specify your IDE version

Post Reply