alter session set current_schema not used by show error command

smurphy

Member
HI,

Using V8.0 and 9.0 of PL/SQL Developer against Oracle SE1 (11.1), we run scripts in a command window to create/replace packages. We do this for different schemas in the DB. We login as USER_A but set our current schema to USER_B, USER_C, etc ...

The "alter session set current_schema" command works for the compilation of the unqualified package name.

But the check for errors defaults to my current user NOT the current schema. It seems Command Window partially supports "set current_schema". Any way to make this work? Am I missing a config setting for this consistent behavior?

This does work consistently in SQL*Plus command line and Oracle SQL Developer. Any unqualified object reference uses the CURRENT_SCHEMA value not the default user value.

Example of output run in PL/SQL Developer:

select sys_context('userenv', 'current_schema') from dual;
USER_A
show user
User is "user_a"

ALTER SESSION SET CURRENT_SCHEMA=USER_B

show user
User is "user_a"
select sys_context('userenv', 'current_schema') from dual;
USER_B

.
.. Packages ..
.
PACKAGE PKG_DOTTN

Package created
Errors for PACKAGE USER_A.PKG_DOTTN:

 
Confirmed (PSD v7). PSD should use owner = SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') when selecting from the ..._errors view.
 
Is there any way to work around this issue in V8 or V9 releases? Is it fixed in V10? Or is this an enhancement/bug, to be fixed later?

Thanks
 
I don't see any workaround (other than changing your scripts). We'll enhance this in a future patch release.
 
Back
Top