Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Adds values to a dictionary via SQL.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Dictionary | 5.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
DictionaryRef | The reference number to the dictionary. | $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, pass here parameters. One parameter to this function for each parameter you want to pass to the SQL statement. | 123 | Optional |
Returns number of items added or error.
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" )
Created 12nd March 2015, last changed 1st March 2021
Dictionary.AddDictionary - Dictionary.AddSQLRecord
Feedback: Report problem or ask question.