IDatabaseCommand¶
- class IDatabaseCommand¶
Bases:
ImpactCOMWrapperBase- Description:
Provides methods and properties for executing any SQL statement in a database.
- Remarks:
The IDatabaseCommand object can be used for executing SQL statements such as update and delete commands. Always use parameters if possible to pass values that may change or are entered by a user. Introduced in Impact 11.0.0.35.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property connection¶
Gets Connection.
- Description:
Returns the IDatabaseConnection for this command.
- Returns:
The value of Connection.
- Return type:
- property parameter_count¶
Gets parameter_count.
- Description:
Returns the number of parameters required in the SQL.
- Returns:
The value of parameter_count.
- Return type:
parameter_count (int)
- property sql¶
Gets SQL.
- Description:
Gets/sets the SQL for the command.
- Returns:
The value of SQL.
- Return type:
sql (str)
- execute_sql()¶
- Description:
Executes the SQL using the parameters supplied.
- Remarks:
If no transaction is running then the command is automatically executed within a local transaction. To prevent malicious use, the IDatabaseCommand.execute_sql and IDatabaseConnection.execute_sql_lines methods have additional security checks. When used with a normal Impact licence, any script calling these methods must be signed. For further information about script signing, please see the Impact documentation, or ask your support representative.
- parameter(index)¶
- Description:
Returns a specific IDatabaseParameterValue object by index or name.
- Parameters:
index (any) – Specifies the index of the object to retrieve.