Reputation: 19699
I would like to force the current schema to be the same as current user. It seems to be possible to set current schema in DB2 9.7 with statement: SET SCHEMA '...'
If schema is to be set same as user, is it then: SET SCHEMA USER?
How do I then refer to that schema when e.g. calling a stored procedure?
Upvotes: 1
Views: 4071
Reputation:
You can set the schema...
.-CURRENT-. .-=-.
>>-SET--+---------+--SCHEMA--+---+--+-schema-name-----+--------><
+-USER------------+
+-SESSION_USER----+
+-SYSTEM_USER-----+
+-CURRENT_USER----+
+-host-variable---+
'-string-constant-'
But for SP you have to use SET PATH...
.-CURRENT-. .-=-.
>>-SET--+-+---------+--PATH-+--+---+---------------------------->
'-CURRENT_PATH------'
.-,------------------------.
V |
>----+-schema-name----------+-+--------------------------------><
+-SYSTEM PATH----------+
+-USER-----------------+
+-+-CURRENT PATH-+-----+
| '-CURRENT_PATH-' |
+-CURRENT PACKAGE PATH-+
+-host-variable--------+
'-string-constant------'
Upvotes: 1