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:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Queries parameters as JSON object.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SQL | 10.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
Command | The command reference number gained with SQL.NewCommand. | $Command |
Returns JSON or error.
Set parameters and show them:
# Create insert command with setting values
Set Variable [ $Command ; Value: MBS("SQL.NewCommand"; $Connection; "INSERT INTO 'Test' (FirstName, LastName, Birthday, NumberOfOrders, TotalSales) VALUES (:1,:2,:3,:4,:5)") ]
Set Variable [ $result ; Value: MBS("SQL.SetParamAsText"; $Command; 1; SQLite fun::FirstName) ]
Set Variable [ $result ; Value: MBS("SQL.SetParamAsText"; $Command; 2; SQLite fun::LastName) ]
Set Variable [ $result ; Value: MBS("SQL.SetParamAsDate"; $Command; 3; SQLite fun::Birthday) ]
Set Variable [ $result ; Value: MBS("SQL.SetParamAsNumber"; $Command; 4; SQLite fun::NumberOfOrders) ]
Set Variable [ $result ; Value: MBS("SQL.SetParamAsFloat"; $Command; 5; SQLite fun::TotalSales) ]
# Let us show instead of running it
Show Custom Dialog [ "JSON" ; MBS( "SQL.GetParamsAsJSON"; $Command ) ]
# cleanup
Set Variable [ $result2 ; Value: MBS("SQL.FreeCommand"; $Command) ]
This function is free to use.
Created 11st March 2020, last changed 11st March 2020