| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
FM.SQL.XMLRecord
Returns a row as XML object.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| FM FMSQL XML | 10.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "FM.SQL.XMLRecord"; SQLref; RecordNodeName; Row; FieldNames { ; Flags } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| SQLref | The reference number returned by FM.SQL.Execute function. | $SQLRef | |
| RecordNodeName | The name for the parent XML nodes for ome record. Defaults to "record". |
"Company" | |
| Row | The row you like to get. Zero based. |
0 | |
| FieldNames | A list of field names for the XML. | "Model¶Names" | |
| Flags | The flags for the XML creation. Pass 1 to get all values as text. Pass 2 to get all dates, times and timestamps in SQL format. |
1+2 | Optional |
Result
Returns OK or error.
Description
Returns a row as XML object.You provide list of field names, which should be in same order as fields in SQL result.
Optionally we can return SQL dates, times and timestamps as SQL format.
Containers are returned as Base64 encoded data.
Examples
Query records as XML:
# run query to get some data
Set Variable [ $sql ; Value: MBS( "FM.SQL.Execute"; ""; "SELECT \"First\", \"Last\", Company, \"Photo Container\" FROM Contacts") ]
# query data
Set Variable [ $xml ; Value: MBS( "FM.SQL.XMLRecord"; $sql; "person"; 0; "First¶Last¶Company¶Photo"; 2) ]
# store result
Set Field [ Contacts::Output ; $xml ]
# free memory
Set Variable [ $xml ; Value: MBS( "FM.SQL.Release"; $sql) ]
Set Variable [ $sql ; Value: MBS( "FM.SQL.Execute"; ""; "SELECT \"First\", \"Last\", Company, \"Photo Container\" FROM Contacts") ]
# query data
Set Variable [ $xml ; Value: MBS( "FM.SQL.XMLRecord"; $sql; "person"; 0; "First¶Last¶Company¶Photo"; 2) ]
# store result
Set Field [ Contacts::Output ; $xml ]
# free memory
Set Variable [ $xml ; Value: MBS( "FM.SQL.Release"; $sql) ]
See also
Release notes
- Version 14.2
- Added firstRow and lastRow parameter to FM.SQL.JSONRecords and FM.SQL.XMLRecords functions.
Blog Entries
- MBS FileMaker Advent calendar - Door 21 - XML
- What is new in the MBS FileMaker Plugin Version 10.3
- FileMaker records to XML or JSON
This function checks for a license.
Created 29th June 2020, last changed 6th March 2026