Product Documentation

FairCom Java & .NET Stored Procedures

Previous Topic

Next Topic

SQLCursor.wasNULL

Checks if the value in a fetched field is null.

Format

public boolean wasNULL(int field)

Returns

True if the field is null, false otherwise.

Parameters

field

An integer that specifies which field of the fetched record is of interest (1 denotes the first column of the result set, 2 denotes the second, and so on). wasNULL() checks whether the value in the currently-fetched record of the column denoted by field is null.

Throws

DhSQLException

Example


CREATE PROCEDURE test_wasNULL()

BEGIN

int small_sp = new Integer(0);

SQLCursor select_btypes = new SQLCursor ("SELECT small_fld from sfns");

select_btypes.open();

select_btypes.fetch();

if ((select_btypes.wasNULL(1)) == true)

small_sp = null;

else

select_btypes.getValue(1,INTEGER);

select_btypes.close();

END

TOCIndex