|Lesson 9||Deleting LOB data using PL/SQL|
|Objective||Use DBMS_LOB to delete LOB data.|
LOBcolumn have their own distinct
LOBlocators and their own copies of the
LOBvalues irrespective of whether these
LOBvalues are the same. This means that deleting one row has no effect on the data or
LOBlocator within another row, even if one LOB was originally copied from another row.
DELETE FROM Customer_photo_obj_table WHERE customer_id = 10; DROP TABLE Customer_photo_obj_table; TRUNCATE TABLE Customer_photo_obj_table;
ERASE()procedure allows you to erase a part of or the entire LOB, depending on the amount of data and offset parameters passed to the procedure. The actual number of bytes or characters erased can differ from the number specified in the
AMOUNTparameter if the end of the
LOBparameter is reached. Erased characters are replaced with zero-byte fillers  for BLOBs and spaces for CLOBs.
EMPTY_BLOB()functions. In this evaluative simulation, we will update the LOB value with an actual file using the
DBMS_LOB.ERASEfunction to erase a part of the LOB data. This function requires three parameters: the LOB, the number of bytes to be erased, and the starting point for erasing the data.