SQL.GetCommandOption
--------------------

Gets a string value of a specific command option.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [2.6](newinversion26.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.GetCommandOption"; Command; Key ) 

**MBS**( **"SQL.GetCommandOption";** /\* Gets a string value of a specific command option. \*/  
**$Command**; /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/   
**$Key**) /\* A string key of the command option.e.g. "" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |
| Key | A string key of the command option. | "" |

### Result

Returns value or error message.

### Description

Gets a string value of a specific command option.  
  
Call this method to get value(s) of server specific command options. See Server specific notes.  
  
A command related option may be specified in either connection object or SACommand object. If it is specified in connection object it affects all the commands on that connection.  
  
If an option is not specially assigned to the command object the Library takes this option from related connection object (see [SQL.GetConnectionOption](SQLGetConnectionOption.md) method). If an option is not specified in neither command nor connection objects, the Library takes the default option value.  
  
see also  
[https://www.sqlapi.com/ApiDoc/class\_s\_a\_command.html](https://www.sqlapi.com/ApiDoc/class_s_a_command.html)  
### See also

- [SQL.GetCommandOptions](SQLGetCommandOptions.md)
- [SQL.GetConnectionOption](SQLGetConnectionOption.md)
- [SQL.NewCommand](SQLNewCommand.md)
- [SQL.SetCommandOption](SQLSetCommandOption.md)

### Release notes

- **Version 8.4**
    - Added [SQL.GetCommandOptions](http://www.mbsplugins.eu/SQLGetCommandOptions.shtml), [SQL.GetConnectionOptions](http://www.mbsplugins.eu/SQLGetConnectionOptions.shtml), [SQL.GetFieldOptions](http://www.mbsplugins.eu/SQLGetFieldOptions.shtml) and [SQL.GetParamOptions](http://www.mbsplugins.eu/SQLGetParamOptions.shtml) functions to query options list.

This function is free to use.

Created 18th August 2014 , last changed 10th January 2020

  
[SQL.GetAutoCommit](SQLGetAutoCommit.md) - [SQL.GetCommandOptions](SQLGetCommandOptions.md)

[HTML Version](SQLGetCommandOption.shtml)