Inserting a BLOB using TLOBLocator

I need to insert a BLOB into a table. I'm able to insert an empty one, select it from the table, but I want to insert some real data stored in "buff" buffer.

char buff[200];
TLOBLocator *bLocator;

bLocator = new TLOBLocator(OrclSession, otBLOB); // or otCLOB
bLocator->SetEmpty();
bLocator->Write(buff, 100);
- this launches an EOracleError with message 'ORA-22275' ivalid LOB locator specified. The same are LoadFromFile method and Size property.
I cannot figure out what's going on. Could you help me? Many thanks.
 
I've got it!

bLocator = new TLOBLocator(OrclSession, otBLOB);

OrclQuery->DeclareVariable("ora_blob", otBLOB);
OrclQuery->SetComplexVariable("ora_blob", bLocator);
OrclQuery->SQL->Text = "insert into _table values (..., EMPTY_BLOB(),...) returning _column into
redface.gif
ra_blob";
OrclQuery->Execute();
bLocator->Write(buff, 100);
 
Back
Top