Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Adds values to a dictionary via SQL.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Dictionary 5.1 Yes Yes Yes Yes Yes
MBS( "Dictionary.AddSQL"; DictionaryRef; SQL Statement; FileName { ; Params } )   More


Parameter Description Example value
DictionaryRef The reference number to the dictionary as returned by Dictionary.Create function. $dic
SQL Statement SQL Statement as a Text string
FileName The target database name. Can be empty to not limit query to one database. ""
Params Optional
Optional, pass here parameters. One parameter to this function for each parameter you want to pass to the SQL statement.


Returns number of items added or error.


Adds values to a dictionary via SQL.
From the result set, the first field is used as key and second field if exists as value.
Returns error in case of SQL error with error message.
You don't need to use ORDER BY in SQL as the order in a dictionary is defined by storage which for you means unordered.

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


Test function:

# create dictionary
$dic = MBS("Dictionary.Create")
# add keys and values via SQL
MBS("Dictionary.AddSQL"; $dic; "SELECT TextField, NumberField FROM \"Test Table\"")
# query keys
$keys = MBS("Dictionary.Keys"; $dic)
# and values
$values = MBS("Dictionary.ValueForKey"; $dic; "Hello")
# free
MBS("Dictionary.Release"; $dic )

Add zip codes for three countries from 3 databases to dictionary:

MBS( "Dictionary.AddSQL"; $dic; "SELECT ('DE' + \"_5_stellige_PLZ\"),Ort FROM \"PLZ Deutschland Konvertiert\" "; "PLZ Deutschland" ) +
MBS( "Dictionary.AddSQL"; $dic; "SELECT ('AT' + \"_4_stellige_PLZ\"),Ort FROM \"PLZ Österreich Konvertiert\" "; "PLZ Österreich" ) +
MBS( "Dictionary.AddSQL"; $dic; "SELECT ('CH' + \"_4_stellige_PLZ\"),Ort FROM \"PLZ Schweiz Konvertiert\" "; "PLZ Schweiz" )

See also

Blog Entries

Created 12nd March 2015, last changed 13th February 2017

DialogModifications.Uninstall   -   Dictionary.AddSQLRecord

Feedback: Report problem or ask question.

MBS FileMaker Plugins