BBjStoredProcedureData

Description

In BBj 6.00 and higher, BBjStoredProcedureData provides access to the parameters and return values of the stored procedure.

Creation

BBjAPI > BBjFileSystem > BBjStoredProcedureData

Return Value Method
BBjStoredProcedureData getStoredProcedureData()

Methods of BBjStoredProcedureData

Return Value Method
String getBBjProgram()
BBjVector getConnectionProperties()
String getConnectionProperty(String propertyName)
String getDatabaseName()
Object getParameter(String paramName)
String getPassword()
String getProcedureName()
String getUserName()
void setParameter(String paramName, Object value)
void setRecordSet(BBjRecordSet recordSet)
void setResultSet(int sqlChannel)
void setResultSet(java.sql.ResultSet resultSet)
void setReturn(Object value)
void setUpdateCount(int updateCount)

Remarks

The BBjStoredProcedureData is available only during execution of a stored procedure.

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, mode="PROCEDURE")sp!.getDatabaseName()

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)

rem 'Now set the return code
sp!.setReturn("1")
Example Type: BBj

See Also

BBjAPI

BBjTriggerData

BBjFileSystem

CREATE/ALTER PROCEDURE

CREATE/ALTER TRIGGER

Stored Procedure Case Study

Debugging Stored Procedures

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