SQL.CommandType
---------------

Gets the command type currently associated with the command object.

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

MBS( "SQL.CommandType"; Command ) 

**MBS**( **"SQL.CommandType";** /\* Gets the command type currently associated with the command object. \*/  
**$Command**) /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |

### Result

Returns command type or error message.

### Description

Gets the command type currently associated with the command object.  
  
Returns one of the following values:  
| CmdUnknown | Command type is not defined. Library will detect command type automatically when needed. |
|---|---|
| CmdSQLStmt | Command is an SQL statement. |
| CmdSQLStmtRaw | Command is an SQL statement that mustn't be interpreted by SQLAPI++. |
| CmdStoredProc | Command is a stored procedure or a function. |

  
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.CommandText](SQLCommandText.md)
- [SQL.NewCommand](SQLNewCommand.md)
- [SQL.SetCommandText](SQLSetCommandText.md)

This function is free to use.

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

  
[SQL.CommandText](SQLCommandText.md) - [SQL.Commit](SQLCommit.md)

[HTML Version](SQLCommandType.shtml)