You use spiTransaction for an external update function to connect to a target database. The software uses it to access the Smart Instrumentation database connection collection based on the current login. Also, you can use this object to query the database.
Since you custom component and spiTransaction class are both "in process" components, you can use the spiTransaction to query the Smart Instrumentation database without the need to create a new database transaction.
Method Name |
Return Type |
Description |
---|---|---|
OpenTrans |
Int |
Creates a pointer to Smart Instrumentation connection and returns the connection ID (which is an integer value). |
ExecuteImmediate |
DataSet |
Enables a programmer to execute SELECT sentences only. |
We recommend using the NOLOCK function with the aggregation commands when using an MSSQL database. This helps to prevent locking tables. For example :
"SELECT CMPNT_ID FROM COMPONENT (NOLOCK) WHERE UPPER(CMPNT_NAME) =..."