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 DataWindow Designer should qualify the stored procedure with the owner name in the SQL EXECUTE statement passed to the driver.

DataWindow Designer 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 DataWindow Designer 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:

  • Yes If the owner associated with the stored procedure is different from the current user ID, DataWindow Designer qualifies the stored procedure with its owner name in the SQL EXECUTE statement and passes this information to the driver. This allows users to execute stored procedures they do not own. For example:

    EXECUTE FRAN.MYPROCEDURE
    

  • No (Default) DataWindow Designer does not qualify the stored procedure with its owner name in the SQL EXECUTE statement passed to the driver. For example:

    EXECUTE MYPROCEDURE
    

Default

PBUseProcOwner = 'No'

Usage

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

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

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

If DataWindow Designer does not find a PBUseProcOwner value in these locations, it defaults to a value of 'No'.

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

If you define a DataWindow object with an Adaptive Server 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 Adaptive Server Anywhere stored procedure you are using, you can avoid this syntax error by setting PBUseProcOwner to No so that DataWindow Designer 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 DataWindow Designer should qualify the stored procedure with its owner name in the SQL EXECUTE statement: