- Tony Fahlberg
- PowerBuilder
- Saturday, 4 December 2021 07:30 PM UTC
Hi - We are migrating our application from the old "ole db" provider for MSSQL Server to PowerBuilder 2021 and the "msoledbsql" provider. I am having issues when using PROCEDURE FOR executions where we did not specify the schema/prefix of the procedure in the declaration when using a non-sysadmin user to connect to the database.
DECLARE last_enctr_proc PROCEDURE FOR r_sp_last_encounter (vs.)
DECLARE last_enctr_proc PROCEDURE FOR dbo.r_sp_last_encounter
The database user (copathusr) I am using has been assigned dbo_owner role with default schema of dbo. When looking at the SQL Server Profiler I can see PowerBuilder attempting to get the procedure parameters using the following call but passing in the login user for the PROCEDURE_SCHEMA which returns no records and later causes the procedure call to fail.
exec [copathsql].[sys].sp_procedure_params_100_rowset N'r_sp_last_encounter',1,N'copathusr',NULL
When using a sysadmin user to connect to the database I observe the following in the SQL Server Profiler and the procedure call works as expected.
exec [copathsql].[sys].sp_procedure_params_100_rowset N'r_sp_last_encounter',1,N'dbo',NULL
We have hundreds of places we use PROCEDURE FOR declarations that would need to specify the schema to use (prepend dbo). Is there a DBParam or configuration I can use on the MSOLEDBSQL connection to set the default schema/prefix that PowerBuilder will use (something like PBCatalogOwner)?
Thanks,
Tony
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.