Good evening,
a dynamic temp-table can contain a field named "TITLE" (an ABL keyword) - a static temp-table cannot - OK.
When I WRITE-XML such a dynamic temp-table (with schema), the resulting XML contains as expected the field named "TITLE" in both the schema and the data section.
However, when I create a dynamic dataset (no tables added yet) and READ-XML the xml file, the resulting temp-table in the dataset contains a field named "TITLE1" - probably to workaround the ABL keyword restriction. However, as a dynamic temp-table can contain a field named "TITLE" this does not seem to be required.
Is that a bug - or a feature? And is there a way to turn that behavior off?
Hi [mention:f74159d0d7ac493497e441f53f353b10:e9ed411860ed4f2ba0265705b8793d05] ,
It looks like it could be a bug so I would report it to your local TS center.
In case it's not obvious you can work around this using SERIALIZE-NAME.
e.g. After ht:temp-table-prepare( "tt" ), add
ht:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("title"):SERIALIZE-NAME = "title".
Ken Mc
I do not see this happening on 11.7.4, 12.0 or 12.2 esap-2 - see abldojo.services.progress.com:443/
Maybe something else going on?
[View:/cfs-file/__key/communityserver-discussions-components-files/19/CustomerForm.xml:320:240]
Here's my repro (12.1).:
BLOCK-LEVEL ON ERROR UNDO, THROW. DEFINE VARIABLE hDataset AS HANDLE NO-UNDO. DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO. DEFINE VARIABLE i AS INTEGER NO-UNDO. /* *************************** Main Block *************************** */ CREATE DATASET hDataset . hDataset:READ-XML ("file", "Repository/Cache/Default/CustomerForm.xml", ?, ?, ?) . ASSIGN hBuffer = hDataset::MetaForm . DO i = 1 TO hBuffer:NUM-FIELDS: DISPLAY hBuffer:BUFFER-FIELD (i):NAME FORMAT "x(40)" WITH DOWN. DOWN 1 . END.
Oops - I was simplifying a bit too much. New nice concise repro here.
def var ht as handle. def var hb as handle. def var lcc as longchar extent 2. def var hds as handle extent 2. def var hf as handle no-undo extent 2. create dataset hds[1]. create temp-table ht. ht:add-new-field( "title", "character" ). ht:temp-table-prepare( "tt" ). hb = ht:default-buffer-handle. hds[1]:add-buffer( hb ). hb:buffer-create(). hb:buffer-field( "title" ):buffer-value = "forbidden". hds[1]:write-xml( "longchar", lcc[1], true, ?, ?, true ). message 'initial' skip(1) string( lcc[1] ) skip(2). create dataset hds[2]. hds[2]:read-xml( "longchar", lcc[1], ?, ?, ? ). hds[2]:write-xml( "longchar", lcc[2], true ). message 'ds' skip(1) string( lcc[2] ) skip(2). message 'field name:' hds[2]::tt:buffer-field(1):name.
Not sure why Stefan's post has disappeared ... but here's his Dojo that reproduces the issue:
The "rich" editor mutilated my post, after cleaning it up it went into the moderation queue. I could be a spammer...
Hi [mention:f74159d0d7ac493497e441f53f353b10:e9ed411860ed4f2ba0265705b8793d05] ,
It looks like it could be a bug so I would report it to your local TS center.
In case it's not obvious you can work around this using SERIALIZE-NAME.
e.g. After ht:temp-table-prepare( "tt" ), add
ht:DEFAULT-BUFFER-HANDLE:BUFFER-FIELD("title"):SERIALIZE-NAME = "title".
Ken Mc
Wow - as clunky as it sounds - it actually works - I think Mike will be happy (and he can report his bug to TS).
Thanks Ken. That does the trick.
So I need to add the lower case version of the field name as the serialize name to enforce the prodata:fieldName="TITLE" in the schema section of the XML document.
I'll log this with your colleagues in R'dam tomorrow.