[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ulysse::rdb_vms_competition

Title:DEC Rdb against the World
Moderator:HERON::GODFRIND
Created:Fri Jun 12 1987
Last Modified:Thu Feb 23 1995
Last Successful Update:Fri Jun 06 1997
Number of topics:1348
Total number of notes:5438

796.0. "Oracle synonyms, Rdb equivalent ?" by TYFYS::MUNNS () Wed Nov 14 1990 23:50

    In the Oracle environment, synonyms can be defined for table names,
    so that table names are not hardcoded in applications.  Is their
    an equivalent mechanism in the Rdb environment ?
T.RTitleUserPersonal
Name
DateLines
796.1If you must...HGOVC::DEANGELISMomuntaiThu Nov 15 1990 04:5121
�                       <<< Note 796.0 by TYFYS::MUNNS >>>
�                     -< Oracle synonyms, Rdb equivalent ? >-

�    In the Oracle environment, synonyms can be defined for table names,
�    so that table names are not hardcoded in applications.  Is their
�    an equivalent mechanism in the Rdb environment ?

Well, I don't know whether this is the reason for synonyms or not. I mean
why does it matter that the table names are hardcoded? Once applications are in
production, tablenames never change in my experience. One reason why ORACLE has
synonyms is that if user X defines a table TABLE1, and user Y wants to use it
then, after granting access to that table touser Y, user Y needs to refer to
the table as X.TABLE1, ie if he just says TABLE1, ORACLE will tell him the
table doesn't exist. Therefore you can define a synonym TABLE1 for user Y that
equates to X.TABLE1. Now he can refer to the table as TABLE1.

I guess if you really want to do it you could always define a view for each
table. Then if the underlying tablename changes, you just need to change the 
view, not the programs. 

John.
796.2Synonyms as logicalsTYFYS::MUNNSThu Nov 15 1990 18:548
    The customer who mentioned that they make heavy use of synonyms does so
    for 2 reasons:
    
    1.  Synonyms prevent the hardcoding of table names, they act as
        logicals.
    2.  Synonyms are used to enforce security in Oracle systems.
    
    Reply .1 answers to reason 2, does Rdb have a mechanism for reason 1 ?
796.3ViewsHGOVC::DEANGELISMomuntaiFri Nov 16 1990 03:1719
�                       <<< Note 796.2 by TYFYS::MUNNS >>>
�                           -< Synonyms as logicals >-

�    1.  Synonyms prevent the hardcoding of table names, they act as
�        logicals.

Well, the customer really hasn't answered the question :- "When would you
change a tablename in an application"? Typically, you select columns from
tables. What's the point of being able to change the table name when all the
columns are still the same? Does it really matter what the table is called?

Again, having said that, you can hide the table name with a view, and use the
view name in the application. If you must change the name of the table, then
just change the view definition in the database. The application remains the
same.

However, there is no direct equivalent to SYNONYMS in Rdb.

John.