Download Wonderware FactorySuite SQL Access Manager User's Guide
Transcript
30
Chapter 4
SQLNumRows(ConnectionId)
Return the number of rows of the logical table. Because this function may
return an error code, the recommended use of the function is as follows:
DIM TEMP AS INTEGER;
TEMP = SQLNumRows(ConnectionId);
IF (TEMP >= 0) THEN
RowCount = TEMP;
ELSE
ResultCode = TEMP;
ENDIF;
Definition
A default statement is a statement associated with a connection ID. It can be a
textual SQL statement (SELECT, INSERT, DELETE, or UPDATE), the name
of a query in MS Access (with or without parameters), or the name of a stored
procedure in MS SQL Server (with or without parameters). The default
statement is modified by SQLLoadStatement, SQLSetStatement and
SQLAppendStatement and is used by SQLExecute whenever StatementId = 0
is specified.
SQLPrepareStatement(ConnectionId,
StatementId)
Prepare the default statement and return a StatementId (1, 2, 3, and so on). This
preparation is useful for statements with parameters that need to be set using
the SQLSetParam{Type} functions. SQLHandle is specified as the second
parameter to this function in older versions of SQL Access; however, the
current version of SQL Access renames SQLHandle into StatementId for all
functions. The functional behavior remains the same.
SQLPrev(ConnectionId)
Go to the previous row of the logical table and fetch values of that row into
InTouch tags.
SQLRollback(ConnectionId)
Roll back the transaction that was created by the last SQLTransact.
SQLSelect(ConnectionId, TableName, BindList,
WhereExpr, OrderByExpr)
Instructs the database to retrieve information from a table. When a
SQLSelect() function is executed, a temporary Results Table is created in
memory, containing records that can be browsed using SQLFirst(),
SQLLast(), SQLNext(), SQLNumRows and SQLPrev().
Execute the statement:
SELECT FROM TableName WHERE WhereExpr ORDER BY OrderByExpr
InTouch SQL Access Manager User’s Guide