PBNewSPInvocation

Description

Uses an alternative method to invoke a stored procedure.

Applies to

ODBC

Syntax

PBNewSPInvocation='value'

Parameter

Description

value

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

  • No

    (Default) Use the standard method to invoke a stored procedure.

  • Yes

    Use the alternative method to invoke a stored procedure.


Default value

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 driver.

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

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 pbodb.ini file:

PBNewSPInvocation='Yes'

For more information about editing pbodb.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 pbodb.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