ABL keyword as fieldname in a dynamic temp-table and READ-XM

Posted by Mike Fechner on 10-Feb-2020 20:45

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? 

Posted by Ken McIntosh on 11-Feb-2020 13:39

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

All Replies

Posted by Stefan Drissen on 10-Feb-2020 21:51

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?

Posted by Mike Fechner on 10-Feb-2020 22:12

[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.

Posted by Stefan Drissen on 10-Feb-2020 22:24

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.

Posted by Mike Fechner on 10-Feb-2020 22:28

Not sure if that should make me happy or not … thanks for trying Stefan.
 
If nobody from development or anybody else has an idea I’ll log this with tech support. Didn’t find anything in the documentation about such a behavior.

Posted by Mike Fechner on 10-Feb-2020 22:32

Not sure why Stefan's post has disappeared ... but here's his Dojo that reproduces the issue:

abldojo.services.progress.com/

Posted by Stefan Drissen on 10-Feb-2020 22:39

The "rich" editor mutilated my post, after cleaning it up it went into the moderation queue. I could be a spammer...

Posted by Mike Fechner on 10-Feb-2020 22:42

Oh sure!
 
Von: Stefan Drissen <bounce-14941@community.progress.com>
Gesendet: Montag, 10. Februar 2020 23:41
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] ABL keyword as fieldname in a dynamic temp-table and READ-XML
 
Update from Progress Community
 

The "rich" editor mutilated my post, after cleaning it up it went into the moderation queue. I could be a spammer...

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by Ken McIntosh on 11-Feb-2020 13:39

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

Posted by Stefan Drissen on 11-Feb-2020 15:43

Wow - as clunky as it sounds - it actually works - I think Mike will be happy (and he can report his bug to TS).

Posted by Mike Fechner on 11-Feb-2020 21:19

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.

This thread is closed