SQLCommandIsNullValue Function

Help Contents

Introduction

The SQLCommandIsNullValue function returns TRUE if a column value is NULL. The column value is taken from the current row of the result set of an SQLCommand Data Object. This function should only be called after SQLCommandFetchRow() has returned TRUE.

Syntax

Informal Syntax:

SQLCommandIsNullValue( CommandID, ColumnIndex )

Formal Syntax:

SQLCommandIsNullValue( 
        CommandID:=Expression,
        ColumnIndex:=Expression )

Parameters

The SQLCommandIsNullValue Function has these parameters:

Parameter Type Description
CommandID UDINT The identifier of the SQLCommand Data Object.
ColumnIndex UDINT The zero based column index of the column to test.

Return Value

The SQLCommandIsNullValue function returns a BOOL value indicating whether the column value is NULL.

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

SQL CommandReturn Value
SELECT Statement TRUE if the column value is NULL. FALSE if the column value is not NULL.
INSERT Statement No value returned. The function generates a runtime error
UPDATE Statement No value returned. The function generates a runtime error
DELETE Statement No value returned. The function generates a runtime error

Remarks

The function should only be called when:

Examples

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

Standards Compliance

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