Posted By: hollowb7 Edit NCLOB fields? - 03/14/20 06:03 PM
I am using TOracleDataset with:
SELECT S.ROWID, S.* FROM STAMM S

The table contains 1 NCLOB field that is displayed in in TDBMemo.
As soon as we do
StammTable.Edit;

the text in the TDBMemo gets changed to "??".

When we save with
StammTable.post;
StammTable.session.commit;

it still shows "??".
Even when we change the record (next; previous;) we see "??".
Searching this forum, I found that for CLOBs the dataset needs to be re-opened.
Besides that was a thread that was posted many years ago ... I cannot imagine that this is the suggested way of working with (N)CLOB fields.
Indeed: when we close and re-open the dataset we do see the correct data again in the TDBMemo.
Of cause, that is not really an option when you do "table.edit".

What is the recommendation to handle NCLOB fields?
Posted By: hollowb7 Re: Edit NCLOB fields? - 03/14/20 07:05 PM
Actually, when the DBMemo does have data, we cannot change the record at all. Then we get an error "Record has been changed by another user".


DOA: 4.1.3.5
OCI: D:\ORACLE\app\oracle\product\11.2.0\server\bin\oci.dll
session.ConvertUTF: cuUTF8ToUTF16 (cannot change this - even when connected=false)
session.ForceWideStringFields=false
session.NullLOBIsEmpty=false
session.TemporaryLOB=tlNoCache
session.UseOCI7=false
OracleDataset.CompressBLOBs=false
OracleDataset.RefreshOptions=(all checked)
OracleDataset.StringFieldsOnly=false

Delphi 10.3.3 (Rio)

Posted By: hollowb7 Re: Edit NCLOB fields? - 03/14/20 07:12 PM
NLS_CHARACTERSET=AL32UTF8
nls_language=GERMAN
Posted By: Marco Kalter Re: Edit NCLOB fields? - 03/16/20 10:06 AM
Can you check if the field is of type TWideMemoField, and if the BlobType of the field is ftWideMemo?
Posted By: hollowb7 Re: Edit NCLOB fields? - 03/16/20 05:49 PM
There is a property "BlobType" and that was "ftOraCLob" (when field was added to the field list of the TOracleDataset.
Changed that to ftWideMemo.
This did not changed the issue.

There is no property "FieldType" or "Type".
Posted By: Marco Kalter Re: Edit NCLOB fields? - 03/17/20 10:19 AM
The field type is the actual TField subclass. You can see it at the top of the object inspector when selecting the field in the dataset fields editor.
Posted By: hollowb7 Re: Edit NCLOB fields? - 03/20/20 10:37 AM
Many thanks Marco!

This did the trick finally.
I have started this "migration" project from Paradox to Oracle actually in 2018 with Delphi 6 and by then these BLOB fields were added to the TOracleDataset as TMemoField.
Removed the Memo fields and added them again to the TOracleDataset fieldlist. Voila: now in Delphi 10.3.3 these are of type TWideMemoField.
And all works as expected now.
© Allround Automations forums