specify default schema for a database in db2 client

Ahmad picture Ahmad · Jan 28, 2014 · Viewed 7.5k times · Source

Do we have any way to specify default schema in cataloged DBs in db2 client in AIX.

The problem is , when it's connecting to DB, it's taking user ID as default schema and that's where it's failing.

We have too many scripts that are doing transactions to DB without specifying schema in their db2 sql statements. So it's not feasible to change scripts at all.

Also we can't create users to match schema.

Answer

ymog picture ymog · Jan 28, 2014

You can try to type SET SCHEMA=<your schema> ; before executing your queries.