Print Thread
Edit NCLOB fields?
#61251 03/14/20 06:03 PM
Joined: Mar 2010
Posts: 14
H
Member
OP Offline
Member
H
Joined: Mar 2010
Posts: 14
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?

Re: Edit NCLOB fields?
hollowb7 #61252 03/14/20 07:05 PM
Joined: Mar 2010
Posts: 14
H
Member
OP Offline
Member
H
Joined: Mar 2010
Posts: 14
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)


Re: Edit NCLOB fields?
hollowb7 #61253 03/14/20 07:12 PM
Joined: Mar 2010
Posts: 14
H
Member
OP Offline
Member
H
Joined: Mar 2010
Posts: 14
NLS_CHARACTERSET=AL32UTF8
nls_language=GERMAN

Re: Edit NCLOB fields?
hollowb7 #61255 03/16/20 10:06 AM
Joined: Aug 1999
Posts: 22,210
Member
Offline
Member
Joined: Aug 1999
Posts: 22,210
Can you check if the field is of type TWideMemoField, and if the BlobType of the field is ftWideMemo?


Marco Kalter
Allround Automations
Re: Edit NCLOB fields?
Marco Kalter #61256 03/16/20 05:49 PM
Joined: Mar 2010
Posts: 14
H
Member
OP Offline
Member
H
Joined: Mar 2010
Posts: 14
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".

Re: Edit NCLOB fields?
hollowb7 #61259 03/17/20 10:19 AM
Joined: Aug 1999
Posts: 22,210
Member
Offline
Member
Joined: Aug 1999
Posts: 22,210
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.


Marco Kalter
Allround Automations
Re: Edit NCLOB fields?
Marco Kalter #61277 03/20/20 10:37 AM
Joined: Mar 2010
Posts: 14
H
Member
OP Offline
Member
H
Joined: Mar 2010
Posts: 14
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.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.110s Queries: 15 (0.022s) Memory: 2.5206 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-05-06 15:01:08 UTC
Valid HTML 5 and Valid CSS