DOA and temporary LOB

Tolyan

Member
Please advise me.
I have an initialized temporary LOB declared in specification part of oracle package: gdp_edit.pp_temp_ext_comments.
I want to write data to this LOB from delphi by DOA.
I created this code fragment:

ppLob:=TLOBLocator.CreateTemporary((fDataSet as TOracleDataSet).Session, otBLOB, true);
ppDS:=TOracleQuery.Create(nil);
ppDS.Session:=(fDataSet as TOracleDataSet).Session;
ppDS.DeclareVariable('p_id',otInteger);
ppDS.SetVariable('p_id',fDataSet.FieldByName('ID').AsInteger);
ppDS.DeclareVariable('p_ext_notes',otBLOB);
ppDS.SetComplexVariable('p_ext_notes',ppLob);
// ip_clear_and_init_comments initializes temporary LOB in package (gdp_edit.pp_temp_blob).
ppDS.SQL.Text:='begin gdp.gdp_edit.ip_clear_and_init_comments(:p_id); :p_ext_notes:=gdp.gdp_edit.pp_temp_blob; end;';
ppDS.Execute;
ppExtComLines.SaveToStream(ppLob); // Filling temporary LOB

After this a see that ppLob contains (for example) string 'WWWWWWWWW', BUT:
length of pp_temp_blob in package gdp_edit is 0.

May be exists another way to write data to temporary LOB?

I'am waiting for any advices.
 
My DOA version is 4.0.3

P.S. You may delete user "Tolyan1" from this forum. It is my clone ( with the same password ;) ).
I have create it when have problems with cookies.
 
Originally posted by Tolyan:
Please advise me.
I have an initialized temporary LOB declared in specification part of oracle package: ...
ppDS.Execute;
ppExtComLines.SaveToStream(ppLob); // Filling temporary LOB
I'am waiting for any advices.
I guess that you have first fill yout temporary BLOB in Delphi and only after this execute TQuery.
So first:
ppExtComLines.SaveToStream(ppLob); // Filling temporary LOB

and only then
ppDS.Execute;
 
Thanks a lot! :)
It is working after a few changes.

ppExtComLines.SaveToStream(ppLob);
ppDS.DeclareVariable('p_ext_notes',otBLOB);
ppDS.SetComplexVariable('p_ext_notes',ppLob);
ppDS.SQL.Text:='begin gdp.gdp_edit.ip_clear_and_init_comments(:p_id); gdp.gdp_edit.pp_temp_blob:=:p_ext_notes; end;';
ppDS.Execute;
 
Back
Top