Update including BLOB

clivew

Member²
How best can I update a table with a BLOB field when I also want to update other fields?

The only example I found only updated the LOB field and used SELECT...FOR UPDATE.

Thanks - Clive
 
The 'select for update' in the example has 2 purposes:

1. Lock the record (required if you want to write LOB data)
2. Obtain the LOB Locator

If you also want to update other columns, you can easily combine things:
Code:
update lob_table
set col1 = :var1,
    col2 = :var2,
    lob_column = empty_blob()
returning lob_column into :lob_variable
Now you have updated the columns, locked the record, and obtained the LOB Locator. You can subsequently use this LOB Locator to write the new data.

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