Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Queries fields values current record 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.
Show records as JSON:
# Create select and run it
Set Variable [ $Command ; Value: MBS("SQL.NewCommand"; $Connection; "SELECT * FROM Test") ]
# Run it
Set Variable [ $result ; Value: MBS("SQL.Execute"; $Command) ]
If [ $result ≠ "OK" ]
Show Custom Dialog [ "Error: " & $result ]
Else
Loop
Set Variable [ $result ; Value: MBS("SQL.FetchNext"; $Command) ]
Exit Loop If [ $result ≠ 1 ]
Show Custom Dialog [ "JSON" ; MBS( "SQL.GetFieldsAsJSON"; $Command ) ]
End Loop
End If
# Cleanup
Set Variable [ $result2 ; Value: MBS("SQL.FreeCommand"; $Command) ]
This function is free to use.
Created 11st March 2020, last changed 11st March 2020