BBjStoredProcedureData::setResultSet

Description

In BBj 6.0 and higher, this method sets the channel to be used as the stored procedure's result set.

Syntax

Return Value

Method

void

setResultSet(int p_sqlChannel)

Parameters

Variable

Description

p_sqlChannel

Handle of the SQL channel to use as a result set.

Return Values

None.

Remarks

Either this method or setUpdateCount can be called once. Subsequent invocations result in an !ERROR=207 (BBJ_STATE).

Example

rem 'A sample Stored Procedure program

rem 'Get a Stored Procedure object from the BBj File System
sp! = BBjAPI().getFileSystem().getStoredProcedureData()

rem 'Get the input parameter from the application
NAME$ = sp!.getParameter("NAME")

rem 'Open up the database that the client application is using
chan = unt
sqlopen(chan)"BASIS.DB_CONNECTION"

rem 'Now generate and return the result set back to the client application
sqlprep(chan) "select * from customer where first_name like ?"
sqlexec(chan) NAME$
sp!.setResultSet(chan)
sqlclose(chan)

See Also

BBjAPI

BBjStoredProcedureData

ObjectVariables

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.