Tia,
Since the effects of VIEWs and SYNONYMs can seem similar, and if you just look at the effects of each, then it can sometimes be difficult to discern the differences between VIEWs and SYNONYMs. So, to distinguish them, we must look closer at their fundamental purposes. First, let's distinguish their definitions and uses:
SYNONYM: An alias or pseudonym (that is stored in the database) for another database object such as a TABLE or a VIEW.
VIEW: A named SELECT statement that is stored in the database and itself becomes a two-dimensional, queriable object.
Now, when you query a SYNONYM or you query a VIEW, the result is a two-dimensional (ROWS and COLUMNS) set of output -- that is the effect.
Additionally, you can create a SYNONYM (an alternate name) for a VIEW, and/or you can create a VIEW (a named SELECT statement) against a SYNONYM. But they are not doing the same things.
To help distinguish: you can do a
"CREATE VIEW some_name AS SELECT ..." which gathers data from five tables or views in five different schemas (users). You cannot, however, say:
"CREATE SYNONYM my_name FOR SELECT ...", gathering data from five tables or views. You can say, "CREATE SYNONYM my_name FOR some_name;"
So the key to distinguishing VIEWs and SYNONYMs is focusing on
purpose and
method/syntax of each: VIEW names a SELECT statement; SYNONYM creates an alias for a table or view.
Did this help or not?
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA @ 16:53 (06Feb04) GMT, 09:53 (06Feb04) Mountain Time)