Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

SQLCommandMBS.CommandText as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Gets the command text associated with the SACommand object.
Example:
dim s as new SQLCommandMBS(nil, "select * from test")

MsgBox s.CommandText
Notes:
Use the CommandText method to return the command text declared in SACommand constructor or setCommandText method.

All text strings sent to the plugin must have a defined encoding. Else the internal text encoding conversions will fail.
(Read and Write property)

Feedback, Comments & Corrections

SQLCommandMBS.CommandType as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Gets the command type currently associated with the SACommand object.
Notes:
One of the following values from SACommandType_t enum:

  • kCommandTypeUnknown Command type is not defined. Library will detect command type automatically when needed.
  • kCommandTypeSQLStmt Command is an SQL statement.
  • kCommandTypeSQLStmtRaw Command is an SQL statement that mustn't be interpreted by SQLAPI++.
  • kCommandTypeStoredProc Command is a stored procedure or a function.
Remarks

The command type can be explicitly set in SACommand constructor and setCommandText method, but it's not necessary to do it.

The CommandTypemethod returns the command type value that was specified in SACommand constructor or setCommandText method. If you declared the command type value as kCommandTypeUnknown (the default value) then command type is detected by the Library and the CommandType method returns this detected value.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.Connection as SQLConnectionMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: The connection for the command.
Notes:
When you set the connection on a command object that already has associated connection, the previous association will be correctly discarded (with closing opened command if needed) and new connection will be set.

If you attempt to call any method on a SACommand object that requires database access with no valid connection, an error occurs.
(Read and Write property)

Feedback, Comments & Corrections

SQLCommandMBS.FieldCount as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Returns the number of fields (columns) in a result set.
Notes:
FieldCount method returns the number of fields created implicitly after the command execution if a result set exists.

A field is represented by SAField object. You can get field value and description using Field method.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.Fields as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 14.0 Yes Yes Yes Yes No
Function: Provides dictionary with all fields.
Notes:
This dictionary should help for debugging to inspect all fields and their text value.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.hasCache as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 16.1 Yes Yes Yes Yes No
Function: Whether cache is active.
Notes: (Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.isExecuted as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Whether this command was already executed.
Notes: (Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.isExecuting as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 14.3 Yes Yes Yes Yes No
Function: Whether this command is executing.
Notes:
You only see this true if you use threaded queries and look on the property from another thread.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.isOpened as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Returns true if the SACommand object is opened; otherwise false.
Notes: (Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.isResultSet as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Tests whether a result set exists after the command execution.
Notes:
Returns true if the result set exists; otherwise false.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.ParamCount as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Returns the number of parameters associated with the SACommand object.
Notes:
ParamCount method returns the number of parameters created explicitly by using CreateParam method or (if parameters were not created before) creates them implicitly (can query native API if needed and therefore can throw exception on error) and returns the number of created parameters.

Command parameter is represented by SAParam object. You can look SAParam objects through and assign their values with Param and ParamByIndex methods.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.Parameters as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 14.0 Yes Yes Yes Yes No
Function: Provides dictionary with all parameters.
Notes:
This dictionary should help for debugging to inspect all parameters and their text value.
(Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.RowsAffected as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 9.3 Yes Yes Yes Yes No
Function: Returns the number of rows affected by the last insert/update/delete command execution.
Example:
dim con as SQLConnectionMBS // your connection

dim sql as string = "UPDATE Test SET MyField=1"
dim c as new SQLCommandMBS(con, sql)

c.Execute

MsgBox str(c.RowsAffected)
Notes: (Read only property)

Feedback, Comments & Corrections

SQLCommandMBS.Tag as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property SQL MBS SQL Plugin 14.0 Yes Yes Yes Yes No
Function: The tag property.
Example:
dim c as SQLCommandMBS // your command object

// store reference to window/control, so we have it available in events
c.Tag = self
Notes:
You can store here whatever you like.
(Read and Write property)

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS SQL Plugin.




Links
MBS FileMaker tutorial videos