Product Documentation

FairCom Java & .NET Stored Procedures

Previous Topic

Next Topic

SQLCursor.registerOutParam

Registers the expected type of OUT and INOUT parameters. This method is common for SQLCursor, SQLIStatement and SQLPStatement classes.

Format

public void registerOutParam(int pIndex, short dType)

Returns

None

Parameters

pindex

An integer that specifies which OUT/INOUT parameter is to be registered (1 denotes the first parameter, 2 denotes the second, and so on).

dtype

The expected type of the OUT/INOUT parameter.

Note: SQLCursor class has another form of registerOutParam(), which takes three arguments. The syntax of this method is:

public void registerOutParam(int pIndex, short dType, short scale)

pIndex and dType are the same as the two arguments in SQLCursor.registerOutParam() method. The scale specifies the number of digits after the decimal point.
This method is not implemented in FairCom DB SQL and invocation of this method results in error:

“Scale for registerOutParam not implemented”.

Throws

DhSQLException

Example


CREATE PROCEDURE register_proc()

BEGIN

// cust_proc is a procedure with an IN, OUT and an INOUT arguments of type

// integer, string and numeric respectively.

SQLCursor cust_cur = new SQLCursor("call cust_proc(?,?,?)");

cust_cur.registerOutParam(2, CHAR);

cust_cur.registerOutParam(3, NUMERIC);

cust_cur.open();

// Process results

cust_cur.close();

END

TOCIndex