Insert information to Clob

snowboys

Member
My table:
create table testclob (name char(10),contents clob);

First:
when my SQl is : insert into testclob (name,contents) values(10,empt_clob())
SetComplexVariable('contents', LOB) is an error: 'unknown variable: :contents'
Where variable of 'contents' is defined?

second:
when my SQl is : insert into testclob (name,contents) values(10,:contents)
LOB.Write(Buffer, 100) is an error: 'TLOBLocator:Invalid handle.'
why?

Please tell me how to treat it.Thanks a lot.

snowboys
 
The SQL should be:
Code:
insert into testclob (name,contents)
  values(10,empt_clob())
  returning contents into :contents_var
The :contents_var must be declared as CLOB variable through the Variables property of the TOracleQuery instance.

To assign the variable to the LOB:
Code:
SetComplexVariable('contents_var', LOB);

------------------
Marco Kalter
Allround Automations
 
Back
Top