| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
SQL.ClientVersion
Gets the DBMS client API version number.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| SQL | 2.6 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "SQL.ClientVersion"; Connection ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with SQL.NewConnection. | $Connection |
Result
Returns client version number or error.
Description
Gets the DBMS client API version number.The higher word contains the major client version (the XX value in the XX.YY version number); the lower word contains the minor client version (the YY value in the XX.YY version number).
If an DBMS client was not set calling ClientVersion method return an error.
Examples
Query version of SQLite:
# enable internal SQLite library
Set Variable [ $r ; Value: MBS( "SQL.InternalSQLiteLibrary.Activate" ) ]
#
# new connection with SQLite
Set Variable [ $con ; Value: MBS("SQL.NewConnection") ]
Set Variable [ $r ; Value: MBS( "SQL.SetClient"; $Con; "SQLite" ) ]
#
# query version
Set Variable [ $r ; Value: MBS( "SQL.ClientVersion"; $con ) ]
Set Variable [ $major ; Value: MBS( "Math.BitwiseShiftRight"; $r; 16 ) ]
Set Variable [ $minor ; Value: MBS( "Math.BitwiseAND"; $r; 65535 ) ]
Show Custom Dialog [ "Version" ; $major & "." & $minor & ¶ & MBS( "SQL.InternalSQLiteLibrary.Version" ) ]
#
# free connection
Set Variable [ $r ; Value: MBS("SQL.FreeConnection"; $con) ]
Set Variable [ $r ; Value: MBS( "SQL.InternalSQLiteLibrary.Activate" ) ]
#
# new connection with SQLite
Set Variable [ $con ; Value: MBS("SQL.NewConnection") ]
Set Variable [ $r ; Value: MBS( "SQL.SetClient"; $Con; "SQLite" ) ]
#
# query version
Set Variable [ $r ; Value: MBS( "SQL.ClientVersion"; $con ) ]
Set Variable [ $major ; Value: MBS( "Math.BitwiseShiftRight"; $r; 16 ) ]
Set Variable [ $minor ; Value: MBS( "Math.BitwiseAND"; $r; 65535 ) ]
Show Custom Dialog [ "Version" ; $major & "." & $minor & ¶ & MBS( "SQL.InternalSQLiteLibrary.Version" ) ]
#
# free connection
Set Variable [ $r ; Value: MBS("SQL.FreeConnection"; $con) ]
Query version as calculation:
Let ([
full = MBS( "SQL.ClientVersion"; $Connection ) ;
major = MBS( "Math.BitwiseShiftRight"; full; 16 ) ;
minor = MBS( "Math.BitwiseAND"; full; 65535 ) ];
major & "." & minor
)
full = MBS( "SQL.ClientVersion"; $Connection ) ;
major = MBS( "Math.BitwiseShiftRight"; full; 16 ) ;
minor = MBS( "Math.BitwiseAND"; full; 65535 ) ];
major & "." & minor
)
See also
- Math.BitwiseAND
- Math.BitwiseShiftRight
- SQL.FreeConnection
- SQL.InternalSQLiteLibrary.Activate
- SQL.InternalSQLiteLibrary.Version
- SQL.NewConnection
- SQL.SetClient
- Version
This function is free to use.
Created 18th August 2014, last changed 10th May 2025