1

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?

1

1 Answer 1

1

You can set the schema...

        .-CURRENT-.          .-=-.
>>-SET--+---------+--SCHEMA--+---+--+-schema-name-----+--------><
                                    +-USER------------+
                                    +-SESSION_USER----+
                                    +-SYSTEM_USER-----+
                                    +-CURRENT_USER----+
                                    +-host-variable---+
                                    '-string-constant-'

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0001016.htm

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------'

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0001014.htm

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.