SQLCommandRowCount Function

Help Contents

Introduction

The SQLCommandRowCount function returns the number of rows associated with an SQLCommand Data Object.

Syntax

Informal Syntax:

SQLCommandRowCount( CommandID )

Formal Syntax:

SQLCommandRowCount( 
        CommandID:=Expression )

Parameters

The SQLCommandRowCount Function has these parameters:

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

Return Value

The function returns a UDINT value indicating a row count associated with an SQLCommand Data Object.

The meaning of the return value depends on the type of SQL Command executed:

SQL CommandReturn Value
SELECT Statement The number of rows in the result set
INSERT Statement The number of rows added to the table
UPDATE Statement The number of rows modified in the table
DELETE Statement The number of rows deleted from the table

Remarks

The function should only be called when the CommandID parameter refers to a valid SQLCommand Data Object.

Examples

For examples see the Examples section of the SQLCommandFromTagDB Function Block.

Standards Compliance

The SQLCommandRowCount 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.

Glossary

For the meaning of terms used in Fernhill SCADA.