Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Dictionary.AddSQLRecord

Adds values from a record to dictionary via SQL.

Component Version macOS Windows Linux Server iOS SDK
Dictionary FMSQL 7.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Dictionary.AddSQLRecord"; DictionaryRef; Keys; SQL Statement; FileName { ; Params... } )   More

Parameters

Parameter Description Example Flags
DictionaryRef The reference number to the dictionary. $dic
Keys The list of keys for the dictionary.
Could be the same as the field list.
"FirstName¶LastName¶Company"
SQL Statement SQL Statement as a Text string
FileName The target database name. Can be empty to not limit query to one database. ""
Params... Pass here parameters.
One parameter to this function for each parameter you want to pass to the SQL statement.
123 Optional

Result

Returns OK or error.

Description

Adds values from a record to dictionary via SQL.
From the result set, the first record is used for values and given key list for the keys.
Returns error in case of SQL error with error message.
As we only use first record, you can use FETCH FIRST 1 ROWS ONLY in the SQL command to only query first record.

This function is currently only supported for FileMaker 11 and newer. If you need it for older versions, please contact us.

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat Params parameter as often as you need.

Examples

Query record and get JSON:

Set Variable [ $dic ; Value: MBS("Dictionary.Create") ]
Set Variable [ $r ; Value: MBS( "Dictionary.AddSQLRecord"; $dic; "Vorname¶Nachname¶Firma"; "SELECT Vorname, Nachname, Firma FROM Kontakte"; "Kontakte") ]
Set Variable [ $json ; Value: MBS( "Dictionary.ToJSON"; $dic ) ]
Set Variable [ $r ; Value: MBS( "Dictionary.Release"; $dic ) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 21st September 2017, last changed 5th June 2021


Dictionary.AddSQL - Dictionary.AddSQLRecords