Generates a struct through the fields and data of a map.
1 struct.fromMap
<struct.fromMap>
<map /> !
</struct.fromMap>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Emap | Map | Map to convert. |
Returns | |
---|---|
Type | Description |
Struct | Returns a struct with an element by each field of the map. Each element of the struct will have as key the name of the field and as value its content. |
Example
Example of conversion of a map to a struct.
Copy
<xsql-script name='struct_set_sample1'> <body> <map name='map_a'> <item>tabname.customer_code<string>C00045634</string></item> <item>tabname.customer_name<string>John Matthew</string></item> <item>tabname.customer_telef<string>654453443</string></item> </map> <set name='s1'> <struct.fromMap> <map_a/> </struct.fromMap> </set> <println><string>CODE: <s1.customer_code />, NAME: <s1.customer_name />, PHONE: <s1.customer_telef /></string></println> </body> </xsql-script>
The print on screen will be the following: CODE: C00045634, NAME: John Matthew, PHONE: 654453443