ORA-22275: invalid LOB locator specified

ORA-22275: invalid LOB locator specified

Postby 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.
lepr8
 
Posts: 4
Joined: Tue 29 Jan 2013 10:41

Re: ORA-22275: invalid LOB locator specified

Postby 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();
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: ORA-22275: invalid LOB locator specified

Postby lepr8 » Fri 01 Feb 2013 14:09

thanks for reply.

it's work.


thank you very much!
lepr8
 
Posts: 4
Joined: Tue 29 Jan 2013 10:41

Re: ORA-22275: invalid LOB locator specified

Postby 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.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: ORA-22275: invalid LOB locator specified

Postby 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:
Ting
 
Posts: 1
Joined: Fri 14 Jun 2013 06:41

Re: ORA-22275: invalid LOB locator specified

Postby AlexP » Fri 14 Jun 2013 10:17

Hello,

Please specify your IDE version
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle