Hi,
I am trying to implement BLOB Locators concept in oracle db using pro*c/c++.
My DB table columns are of BLOB datatype and i want to insert/update data using BLOB Locators and that data is passed as parameter in the function.

As i have understood till this point the Locators concept, please comment if i am wrong:-
  • Declare the Locator variable - OCIBlobLocator *<locator_variable>;
  • Allocate the memory for Locator variable - EXEC SQL ALLOCATE :<locator_variable>;
  • Map the Locator variable with the DB Column - EXEC SQL SELECT <column_name> INTO :<locator_variable> FROM <table_name>;
  • Perform the operation(in this case UPDATE operation) - EXEC SQL UPDATE <table_name> SET <cloumn_name>=:<locator_variable>;
  • Free the memory of Locator variable - EXEC SQL FREE :<locator_variable>;


In my case i am having data passed as parameter in the function, so how to map the locator variable to particular column.

While updating the BLOB column i am getting the Segmentation Fault(core dump). So during UPDATE operation what <locator_variable> contains memory address or the data value.

I my opinion i am having address mapping problem, while updating the BLOB column.

Can you guys suggest any thing. Thanks for your help.