13 January,2012 by Tom Collins

Within a database multiple SCHEMAS can exist. If  a table or view exists in a schema different from the default SCHEMA of the logon and the reference to the object does not include a qualified name , then the object can’t be found.

For example , you may want to do a db2 list tables and view the list pf tables from another schema.

Use the SET CURRENT SCHEMA method.

For example , If the default SCHEMA is DB2TEST   , and you want to view the tables of the schema DB2OTHER do:

db2 set current schema = DB2OTHER



See Also

ADMIN_DROP_SCHEMA to drop a schema

Author: Rambler(http://www.dba-db2.com)


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on DB2 SET CURRENT SCHEMA

Comments are moderated, and will not appear until the author has approved them.

dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright