The SQLCommandFetchRow Function fetches a row from the result set of an SQLCommand Data Object.
Informal Syntax:
SQLCommandFetchRow( CommandText )
Formal Syntax:
SQLCommandFetchRow( CommandText:=Expression )
The SQLCommandFetchRow Function has these parameters:
Parameter | Type | Description |
---|---|---|
CommandID | UDINT | The identifier of the SQLCommand Data Object. |
The function returns a BOOL value indicating if a row is available.
The meaning of the return value depends on the type of SQL Command executed:
SQL Command | Return Value |
---|---|
SELECT Statement | TRUE if a row was successfully fetched. FALSE if no more rows are available. |
INSERT Statement | The function returns FALSE |
UPDATE Statement | The function returns FALSE |
DELETE Statement | The function returns FALSE |
The function should only be called when the CommandID parameter refers to a valid SQLCommand Data Object.
For examples of use see the Examples section of the SQLCommandFromTagDB Function Block.
The SQLCommandFetchRow Function is an extension to the IEC 61131-3 standard.
To learn how to use the SQLCommand data object.
To learn how to use data objects in IEC 61131-3 code.
To learn how IEC 61131-3 is used in Fernhill SCADA.
For the meaning of terms used in Fernhill SCADA.