PBUseProcOwner

Description

When you access a database through the ODBC interface and define a DataWindow object that uses a stored procedure as its data source, PBUseProcOwner specifies whether PowerBuilder should qualify the stored procedure with the owner name in the SQL EXECUTE statement passed to the driver.

PowerBuilder qualifies the stored procedure with an owner only if the owner associated with the stored procedure is different from the ID of the current user (the developer building the DataWindow object or the user running the application containing the DataWindow object).

Applies to

Syntax

PBUseProcOwner='value'

Parameter

Description

value

Specifies whether PowerBuilder should qualify the stored procedure with its owner name in the SQL EXECUTE statement built by the DataWindow object and passed to the driver. Values are:

Default

PBUseProcOwner='No'

Usage

Determining the PBUseProcOwner value PowerBuilder searches the following in this order to determine the PBUseProcOwner value:

  1. The section for your database profile in the PowerBuilder initialization file (in the development environment) or the value of the transaction object’s DBParm property (in an application).

  2. The section for your ODBC driver in the PBODB125 initialization file.

If PowerBuilder does not find a PBUseProcOwner value in these locations, it defaults to a value of “No”.

If DBA owns the SQL Anywhere® stored procedure DBA (database administrator) is a reserved word in SQL Anywhere syntax.

If you define a DataWindow object with a SQL Anywhere stored procedure as its data source and DBA owns the stored procedure, the painter passes the following SQL EXECUTE statement to the ODBC driver if PBUseProcOwner is set to “Yes”:

EXECUTE DBA.MYPROCEDURE

This statement generates a syntax error because it includes the DBA reserved word.

If DBA owns the SQL Anywhere stored procedure you are using, you can avoid this syntax error by setting PBUseProcOwner to No so that PowerBuilder does not qualify the stored procedure with DBA.

In some situations, however, you must qualify the stored procedure with the DBA owner. For example, the DBA might want to grant execute permission to another user ID. In this case, you can avoid errors by editing the SQL EXECUTE syntax to enclose DBA in quotes, like this:

EXECUTE "DBA".MYPROCEDURE

Examples

Example 1

To specify that PowerBuilder should qualify the stored procedure with its owner name in the SQL EXECUTE statement: