PBNewSPInvocation

Description

Uses an alternative method to invoke a stored procedure.

Applies to

Syntax

PBNewSPInvocation='value'

Parameter

Description

value

Specifies whether the standard method or an alternative method is used to invoke a stored procedure. Values are:

Default

PBNewSPInvocation='No'

Usage

Output parameters might not be returned when you use an embedded SQL command to call a stored procedure. You can set PBNewSPInvocation to ‘Yes' to use an alternative method to invoke a stored procedure. The behavior of the PowerBuilder ODBC driver when this parameter is set is consistent with the default behavior of the OLE DB and JDBC drivers.

If PBNewSPInvocation is set to ‘Yes', the alternative method is used when you retrieve data into a DataWindow object that uses a stored procedure. This parameter has no effect when you use RPC to invoke a stored procedure.

When PBNewSPInvocation is set to ‘Yes', the values of the PBUseProcOwner and CallEscape parameters are ignored.

Examples

Example 1

To set the parameter for all connections, add the following line to every relevant section (such as ;IBM DB2/NT 2.1 DB2CLI for a DB2 connection on Windows) in your pbodb125.ini file:

PBNewSPInvocation='Yes'

For more information about editing pbodb125.ini, see the Appendix in Connecting to Your Database.

You can also set the parameter at runtime. For example:

SQLCA.DBParm="PBNewSPInvocation='Yes'"

The value that is set at runtime overrides the value in the pbodb125.ini file.

To obtain the value of the stored procedure’s output parameter, use the OUTPUT or OUT keyword. For example:

DECLARE sp_test PROCEDURE FOR SP1 VAR0=:ARGIN, VAR1=:ARGOUT OUTPUT USING SQLCA;

If the stored procedure contains result sets, you must fetch the result sets first. If the stored procedure has a return value and you want to obtain it, use the format RC=SP1:

DECLARE sp_test PROCEDURE FOR RC=SP1 VAR0=:ARGIN, VAR1=:ARGOUT OUTPUT USING SQLCA;

See also

DefaultProcOwner