SQLCommandFetchRow Function

Help Contents


The SQLCommandFetchRow Function fetches a row from the result set of an SQLCommand Data Object.


Informal Syntax:

SQLCommandFetchRow( CommandText )

Formal Syntax:

        CommandText:=Expression )


The SQLCommandFetchRow Function has these parameters:

Parameter Type Description
CommandID UDINT The identifier of the SQLCommand Data Object.

Return Value

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 CommandReturn 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.

Standards Compliance

The SQLCommandFetchRow Function is an extension to the IEC 61131-3 standard.

Further Information

SQLCommand Data Object

To learn how to use the SQLCommand data object.

Data Objects

To learn how to use data objects in IEC 61131-3 code.

IEC 61131-3

To learn how IEC 61131-3 is used in Fernhill SCADA.


For the meaning of terms used in Fernhill SCADA.