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?
Architect of the SmartComponent Library and WinKit
Hi Stefan Drissen ,
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".
Kenneth S. McIntosh
Principal Technical Support Engineer
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?
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 .
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.
create temp-table ht.
ht:add-new-field( "title", "character" ).
ht:temp-table-prepare( "tt" ).
hb = ht:default-buffer-handle.
hds:add-buffer( hb ).
hb:buffer-field( "title" ):buffer-value = "forbidden".
hds:write-xml( "longchar", lcc, true, ?, ?, true ).
message 'initial' skip(1) string( lcc ) skip(2).
create dataset hds.
hds:read-xml( "longchar", lcc, ?, ?, ? ).
hds:write-xml( "longchar", lcc, true ).
message 'ds' skip(1) string( lcc ) skip(2).
message 'field name:' hds::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...
You received this notification because you subscribed to the forum. To unsubscribe from only this thread,
post as spam/abuse.
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.