Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
A synonym is not a view. You can have one table say ATEST.table_t and create a synonym that is BTEST.table_t and CTEST.table_t. They would all point to the exact table. This may be needed depending on how the system is setup. We need to do this when we create a common program that runs across 3 different lines of business. We have our scheduler setup to run the jobs with a userid specific to that line of business. They pickup the synonym reference instead of the common reference.
A view can be built from multiple table via a normal SELECT statement and can still have synonyms.
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
SYNONYM : Is an alternate name for a base table or view. Each user can assign his or her own synonyms for any table or view that was created by some other fully qualified name.
VIEW : It is a predefined selection of data in base tables. It is a virtual table that does not physically exist but is processed as a table. It is derived from one or more base tables, or views or combinations of views and tables. The view definition is stored in the DB2 catalog. Changes to the data in the view can change the data in the base table.