Product Documentation

FairCom Java & .NET Stored Procedures

Previous Topic

Next Topic

SQLIStatement.rowCount

Returns the number of rows affected (selected, inserted, updated, or deleted) by the FairCom DB SQL statement. This method is common to the SQLCursor, SQLIStatement, and SQLPStatement classes.

Format

public int rowCount()

Returns

An integer indicating the number of rows.

Parameters

None

Throws

DhSQLException

The following example uses the rowCount() method of the SQLIStatement class. It nests the method invocation within SQLResultSet.set() to store the number of rows affected (1, in this case) in the procedure’s result set.

Example


CREATE PROCEDURE sis_rowCount()

RESULT ( ins_recs BIGINT )

BEGIN

SQLIStatement insert_test103 = new SQLIStatement (

"INSERT INTO test103 (fld1) values (17)");


insert_test103.execute();

SQLResultSet.set(1,new Long(insert_test103.rowCount()));

SQLResultSet.insert();

END

TOCIndex