Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference between Synonym and view..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Radha3

New User


Joined: 17 Apr 2008
Posts: 4
Location: Bangalore

PostPosted: Thu Apr 24, 2008 9:41 am    Post subject: Difference between Synonym and view..
Reply with quote

Could you please any one explain me what is the difference between synonym and View in db2.....

Under which situation we will use synonym ... which situation we can use view
Back to top
View user's profile Send private message

stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Apr 24, 2008 10:19 am    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu Apr 24, 2008 2:36 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
Radha3

New User


Joined: 17 Apr 2008
Posts: 4
Location: Bangalore

PostPosted: Thu Apr 24, 2008 2:40 pm    Post subject:
Reply with quote

Thanks alot stodolas & gautam icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts REXX to view the PGM or PROC jackzhang75 CLIST & REXX 11 Tue Jun 20, 2017 1:20 am
No new posts How to see VIEW definition from BMC c... rohanthengal DB2 1 Thu May 04, 2017 1:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us