We have one(!) customer where setting an Oracle CLOB field to NULL fails with
[FireDAC][Phys][Ora] ORA 22275 - Invalid LOB locator specified
The query that is sent to the database* is
update tt_hrs set
TT_INFO = ?
where
TT_HRS_ID = ?
Params:
0 - : <NULL>
1 - : 276727
Querying the dataset through FireDAC shows me that lDataset.Fields[i].DataType
for field TT_HRS
is ftWideMemo
.
Many things I find on the internet are associated with the 'old way' (Oracle 8.0.5 IIRC) of updating CLOBS where you used
UPDATE ClobTable
SET
Value = EMPTY_CLOB()
WHERE
Id = :Id
RETURNING
Value
INTO
:Value
but AFAIK these kind of statements are no longer required.
In SQLPLUS I can execute these without issues on our own Oracle 12c database, so the difference between EMPTY_CLOB()
and NULL
does not seem to matter:
update tt_hrs set tt_info='test' where tt_hrs_id=276727;
update tt_hrs set tt_info=NULL where tt_hrs_id=276727;
update tt_hrs set tt_info=empty_clob() where tt_hrs_id=276727;
- As the error message shows we use FireDAC in a Delphi Tokyo 10.2.2 32-bit Windows app.
- There is no NOT NULL constraint on the field, it is not in an index, there are no triggers.
- The client uses OracleDB12 Release 1.
- Our update code is generated by FireDAC from a TClientDataSet connected to a grid that the user edits.
Question:
Is there anything in Oracle settings that might explain this behavior?
Maybe they set some 'compatibility mode' to support old applications or something... I'm not familiar enough with Oracle.
Note: It wouldn't by any chance be related to the issue with 2-byte chars I reported earlier?
Clutching at straws here...
* We can log this because we have a TDataSetProvider descendant that logs what is being sent in an overridden DoBeforeExecute
.