Miyako -

On 12 Oct 2016, at 02:28, Keisuke Miyako <keisuke.miy...@4d.com> wrote:

> you can add tables and fields via the clipboard or the new IMPORT STRUCTURE 
> command.

Your answer gave me the confidence to go back and look harder at the solution. 
Turns out 4D had a problem with the formatting in the document header: <?xml 
version="1.0" encoding="UTF-8”?>. I had version=“1” instead of version=“1.0” 
and that was enough to break it.

Another thing - I couldn’t find any documentation at all for the “type” 
attribute (which doesn’t correspond to 4D’s data type constants). Even the DTD 
doesn’t decode them so I just copied each field type in turn and inspected 4D’s 
XML dump to build a mapping table. (Listed below in case they’re useful to 
anyone else).

Everything works great now and I can lift a structure definition straight from 
a spreadsheet data dictionary, paste into an empty table and **kerboom**. Table 
implemented !

On 12 Oct 2016, at 11:44, Arnaud de Montard <arn...@init5.fr> wrote:

> Why not SQL instead?

Yes - SQL could have been possible. I don’t like using SQL for making permanent 
structure changes though, ever since I noticed that relations made with SQL are 
somehow “different” from ones made in the structure editor. I think the XML is 
more native to 4D.

Thanks for the responses !



4D Structure definition type mappings:

Alpha   10 (With “limiting_length” attribute)
Text    10 (Without “limiting_length attribute)
Date    8
Time    9
Boolean 1
Integer 3
Longint 4
Integer 64 Bit  5
Real    6
Float   7
Blob    18
Picture 12
Object  21
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com

Reply via email to